An interface representing a file system

@constructor
{DOMString} name the unique name of the file system (readonly)
{DirectoryEntry} root directory of the file system (readonly)
967551
function(name, root) {
    this.name = name;
    if (root) {
        this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
    } else {
        this.root = new DirectoryEntry(this.name, '/', this);
    }
}
659693
function local(rootFolder) {
    // Construct name to remote id map
    const remote = path.join(rootFolder, constants.META_DIR, constants.META_REMOTE);
    const remoteSource = fs.readJsonSync(remote, 'utf8');
    const destination = constants.META_LOCAL;
    return pack(rootFolder, destination);
}
1076613
function(storage) {

		this._data_uids = storage.uids;
		this._data_values = storage.values;
		this._data_names = storage.names;

	}
652002
function(filePath, identifier, name) {
    this.filePath = filePath;
    this.identifier = identifier;
    this.name = name ? name : '';
}
828591
function() {
			var content = '', files = [];
			if (this.$element[0].files === undefined) {
				files[0] = {
					'name' : this.$element[0] && this.$element[0].value
				};
			} else {
				files = this.$element[0].files;
			}

			for (var i = 0; i < files.length; i++) {
				content += files[i].name.split("\\").pop() + ', ';
			}

			if (content !== '') {
				this.$elementFilestyle.find(':text').val(content.replace(/\, $/g, ''));
			} else {
				this.$elementFilestyle.find(':text').val('');
			}
			
			return files;
		}
504165
function( fileName)
    //------------------------------------------------------------------------------------------------------
    {
        // if you want onEventName to work, send options to Events
        // otherwise send nothing
        // but you must call it or throws
        var logDir = path.join(path.dirname(require.main), 'logs');

        if (!fs.existsSync(logDir)){
            fs.mkdirSync(logDir);
        }

        this.fileName = fileName;

        this.filePath = path.join(logDir, fileName);

        this.stream = fs.createWriteStream(this.filePath, {flags : 'a'});
    }
1007009
function(fileURL, newF){
			var fileName;
			if(this.options && this.options.newFileName && this.options.oldFileName) {
				fileName = newF ? this.options.newFileName : this.options.oldFileName;
			} else {
				fileName = fileURL.split("?")[0]; //$NON-NLS-0$
			}
			return fileName;
		}
369122
function(fileEntry) {
              var filename = fileObj.fileName.substring(0, fileObj.fileName.lastIndexOf('.'));
              var ext = fileObj.fileName.substring(fileObj.fileName.lastIndexOf('.'));
              var randomStr = randomString(); // if the file with fileName already exists, append the new filename with _randomStr ...
              fileObj.fileName = filename + '_' + randomStr + ext; // ... and file extension
              resolve({root:root, fileObj: fileObj});
            }
970734
function fsReaddir(path, cb) {
    if (path === '/') return cb(new Error('Reading filesystem at / is disallowed to prevent mistakes.'));
    fs.readdir(path, function(err, dir) { if (err) return cb(err);
      var ab = asyncbuilder(cb);
      u.each(dir, function(name) {
        var push = ab.asyncAppend();
        fs.stat(u.join(path, name), function(err, stats) {
          var entry = !err && { name:name, type:(stats.isDirectory() ? 'dir' : stats.isFile() ? 'file' : 'other') };
          push(err, entry);
        });
      });
      ab.complete();
    });
  }
965530
function(entry) {
        var result;
        if (entry) {
            if (successCallback) {
                // create appropriate Entry object
                result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath) : new FileEntry(entry.name, entry.fullPath);
                successCallback(result);
            }
        }
        else {
            // no Entry object returned
            fail(FileError.NOT_FOUND_ERR);
        }
    }
915200
function(name,shim){
    var constructor = window[name];
    if (!constructor)
        constructor = window[name] = shim.interface;
    delete shim.interface;
    var proto = constructor && constructor.prototype;
    if (shim.prototype) {
        proto = constructor.prototype = shim.prototype;
        delete shim.prototype;
    }
    
    window.console&&console.log("adding interface ", name);
    
    if (shim.hasOwnProperty("constructor")) {
        window[name] = constructor = shim.constructor;
        proto && (shim.constructor.prototype = proto);
        delete shim.constructor;
    }
}
510249
function getNewFilename(list, name) {
  if (list.indexOf(name) === -1) {
    return name;
  }
  const parsed = parseFilename(name);
  const base = parsed.base;
  const ext = parsed.ext;
  if (!base) {
    const newName = getNextNumberName(ext);
    return getNewFilename(list, newName);
  } else {
    const basename = getNextNumberName(base);
    return getNewFilename(list, `${basename}${ext}`);
  }
}
63496
function(location, name) {
  
  this.location = location;
  this.name = name;

  if (this.isUrl(location)) {
    if (this.name)
      this.name = require('sanitize-filename')(this.name, {replacement: '_'});
    if (typeof window === 'undefined')
      this.request = require('request').defaults({headers: {'User-Agent': 'limberest'}});
    else
      this.request = require('browser-request');
  }
  else {
    this.storage = new Storage(this.location, this.name);    
  }

  this.path = this.location;
  if (this.name)
    this.path += '/' + this.name;
}
359246
function( options, callback ) {
            var me = this;
            var error = function(e) { fail(e); if ( callback ) me.fn( me.name, callback ).call( me, me ); };
            requestFileSystem( (options.storage === 'TEMPORARY' ? TEMPORARY : PERSISTENT), (options.size || 1024*1024*1024), function( fs ) {
                fs.root.getDirectory( options.name, {create:true}, function( directory ) {
                    filesystems[options.name] = directory;
                    if ( callback ) me.fn( me.name, callback ).call( me, me );
                }, error );
            }, error );
        }
756282
function (basedir, filefn, dirfn) {
        filefn = filefn || function() {};
        dirfn = dirfn || function() {};

        var readdirSync = function(dir) {
            var files = fs.readdirSync(dir);

            for (var i = 0; i < files.length; i++) {
                var file = dir+'/'+files[i];
                //debug('before fs.statsSync:', file);
                var stats = fs.statSync(file);

                if (stats.isFile()) {
                var prefix = dir.replace(basedir, '');
                    filefn(prefix, dir, files[i], stats);

                } else if (stats.isDirectory()) {
                    var prefix = file.replace(basedir, '');
                    dirfn(prefix, stats);
                    readdirSync(file);

                } else {
                    console.error('error:'.error, 'It is a file type that is not assumed. file:', file);
                    return;
                }
            }
        };
        readdirSync(basedir);
    }
649704
function FilerError({name, code, message, peerID, fileID}){
  // name should be the constructor function name(FilerError in this case), but I don't want to create one constructor for one error.
  this.name = name || 'UnknownError';
  this.code = code || 'ERR_UNKNOWN_ERROR';
  this.message = message || 'unknown error';
  this.peerID = peerID;
  this.fileID = fileID;
}
936134
function FileListBuilder ( parent ) {

    this.files = [];

    this.directory = null;

    this.addFile = function ( file ) {
        this.files.push( file );
        return this;
    };

    // Adds a directory of files 
    this.push = function ( directory ) {
        var child = new FileListBuilder( this );
        this.files = this.files.concat( [ directory+'_.header.js', directory+'*.js' ] );
        child.directory = directory;
        return child;
    };

    this.pop = function () {
        if ( this.directory ) {
            this.files = this.files.concat( ['!'+this.directory+'_.footer.js', this.directory+'_.footer.js' ]  );
        }
        if ( parent ) {
            parent.files = parent.files.concat( this.files );
        }
        return parent;
    };

    this.get = function () {
        return this.files;
    };
}