<commit_before>'use strict';
/**
 * Created by vedi on 09/14/15.
 */
var
  Promise = require('bluebird'),
  fs = Promise.promisifyAll(require('fs-extra')),
  pathM = require('path'),
  crypto = require('crypto'),
  utils = require('../lib/utils'),
  requireOptions = utils.requireOptions;

module.exports = {

  initialize: function(options) {
    var requiredOptions = ['uploadRoot', 'uploadPath'];
    requireOptions(options, requiredOptions);

    this.uploadRoot = options.uploadRoot + '/';
    this.uploadPath = options.uploadPath;
  },

  getStreamAsync: function (fileMeta) {
    var fileName = this.uploadRoot + fileMeta;
    return fs.createReadStream(fileName);
  },

  putFileAsync: function (path, options) {
    var fileName = this.uploadPath + '/' + this.generateFileName() + '.' + pathM.extname();

    return fs.moveAsync(path, this.uploadRoot + fileName)<commit_msg>fix file path in local<commit_after>'use strict';
/**
 * Created by vedi on 09/14/15.
 */
var
  Promise = require('bluebird'),
  fs = Promise.promisifyAll(require('fs-extra')),
  pathM = require('path'),
  crypto = require('crypto'),
  utils = require('../lib/utils'),
  requireOptions = utils.requireOptions;

module.exports = {

  initialize: function(options) {
    var requiredOptions = ['uploadRoot', 'uploadPath'];
    requireOptions(options, requiredOptions);

    this.uploadRoot = options.uploadRoot + '/';
    this.uploadPath = options.uploadPath;
  },

  getStreamAsync: function (fileMeta) {
    var fileName = this.uploadRoot + fileMeta;
    return fs.createReadStream(fileName);
  },

  putFileAsync: function (path, options) {
    var fileName = this.uploadPath + '/' + this.generateFileName() + pathM.extname(path);

    return fs.moveAsync(path, this.uploadRoot + fileName)
{'fraction_non_alphanumeric': 0.14890016920473773, 'fraction_numerical': 0.00676818950930626, 'mean_word_length': 4.0685714285714285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4180914', 'n_tokens_mistral': 544, 'n_tokens_neox': 534, 'n_words': 113}