src/filesystem/FileSystem.js
function registerProtocolAdapter(protocol, adapter) {
        var adapters;
        if (protocol) {
            adapters = _fileProtocolPlugins[protocol] || [];
            adapters.push(adapter);

            // We will keep a sorted adapter list on 'priority'
            // If priority is not provided a default of '0' is assumed
            adapters.sort(function (a, b) {
                return (b.priority || 0) - (a.priority || 0);
            });

            _fileProtocolPlugins[protocol] = adapters;
        }
    }
function registerProtocolAdapter(protocol, adapter) {
        var adapters;
        if (protocol) {
            adapters = _fileProtocolPlugins[protocol] || [];
            adapters.push(adapter);

            // We will keep a sorted adapter list on 'priority'
            // If priority is not provided a default of '0' is assumed
            adapters.sort(function (a, b) {
                return (b.priority || 0) - (a.priority || 0);
            });

            _fileProtocolPlugins[protocol] = adapters;
        }
    }
function registerProtocolAdapter ( protocol , adapter ) { var adapters ; if ( protocol ) { adapters = _fileProtocolPlugins [ protocol ] || [ ] ; adapters . push ( adapter ) ; // We will keep a sorted adapter list on 'priority' // If priority is not provided a default of '0' is assumed adapters . sort ( function ( a , b ) { return ( b . priority || 0 ) - ( a . priority || 0 ) ; } ) ; _fileProtocolPlugins [ protocol ] = adapters ; } }
Typical signature of a file protocol adapter.
@typedef {Object} FileProtocol~Adapter
@property {Number} priority - Indicates the priority.
@property {Object} fileImpl - Handle for the custom file implementation prototype.
@property {function} canRead - To check if this impl can read a file for a given path.
 
FileSystem hook to register file protocol adapter
@param {string} protocol ex: "https:"|"http:"|"ftp:"|"file:"
@param {...FileProtocol~Adapter} adapter wrapper over file implementation
Typical signature of a file protocol adapter .