function onGetMetadataRequested(options, onSuccess, onError) {
  if (options.fileSystemId !== test_util.FILE_SYSTEM_ID) {
    onError('SECURITY');  // enum ProviderError.
    return;
  }

  // Metadata to be returned.
  var metadata;

  switch (options.entryPath) {
    case '/':
      metadata = TESTING_ROOT;
      break;

    case '/' + TESTING_WITH_VALID_THUMBNAIL_FILE.name:
      metadata = TESTING_WITH_VALID_THUMBNAIL_FILE;
      break;

    case '/' + TESTING_ALWAYS_WITH_THUMBNAIL_FILE.name:
      metadata = TESTING_ALWAYS_WITH_THUMBNAIL_FILE;
      break;

    case '/' + TESTING_WITH_INVALID_THUMBNAIL_FILE.name:
      metadata = TESTING_WITH_INVALID_THUMBNAIL_FILE;
      break;

    default:
      onError('NOT_FOUND');  // enum ProviderError.
      return;
  }

  // Returning a thumbnail while not requested is not allowed for performance
  // reasons. Remove the field if needed. However, do not remove it for one
  // file, to simulate an error.
  if (!options.thumbnail && metadata.thumbnail &&
      options.entryPath !== '/' + TESTING_ALWAYS_WITH_THUMBNAIL_FILE.name) {
    var metadataWithoutThumbnail = {
      isDirectory: metadata.isDirectory,
      name: metadata.name,
      size: metadata.size,
      modificationTime: metadata.modificationTime
    };
    onSuccess(metadataWithoutThumbnail);
  } else {
    onSuccess(metadata);
  }
}
/**
 * Returns metadata for a requested entry.
 *
 * @param {GetMetadataRequestedOptions} options Options.
 * @param {function(Object)} onSuccess Success callback with metadata passed
 *     an argument.
 * @param {function(string)} onError Error callback with an error code.
 */
Returns metadata for a requested entry.
@param {GetMetadataRequestedOptions} options Options.
@param {function(Object)} onSuccess Success callback with metadata passed
an argument.
@param {function(string)} onError Error callback with an error code.
Returns metadata for a requested entry . @param { GetMetadataRequestedOptions } options Options . @param { function ( Object ) } onSuccess Success callback with metadata passed an argument . @param { function ( string ) } onError Error callback with an error code .
function onGetMetadataRequested(options, onSuccess, onError) {
  if (options.fileSystemId !== test_util.FILE_SYSTEM_ID) {
    onError('SECURITY');  
    return;
  }
  var metadata;
  switch (options.entryPath) {
    case '/':
      metadata = TESTING_ROOT;
      break;
    case '/' + TESTING_WITH_VALID_THUMBNAIL_FILE.name:
      metadata = TESTING_WITH_VALID_THUMBNAIL_FILE;
      break;
    case '/' + TESTING_ALWAYS_WITH_THUMBNAIL_FILE.name:
      metadata = TESTING_ALWAYS_WITH_THUMBNAIL_FILE;
      break;
    case '/' + TESTING_WITH_INVALID_THUMBNAIL_FILE.name:
      metadata = TESTING_WITH_INVALID_THUMBNAIL_FILE;
      break;
    default:
      onError('NOT_FOUND');  
      return;
  }
  if (!options.thumbnail && metadata.thumbnail &&
      options.entryPath !== '/' + TESTING_ALWAYS_WITH_THUMBNAIL_FILE.name) {
    var metadataWithoutThumbnail = {
      isDirectory: metadata.isDirectory,
      name: metadata.name,
      size: metadata.size,
      modificationTime: metadata.modificationTime
    };
    onSuccess(metadataWithoutThumbnail);
  } else {
    onSuccess(metadata);
  }
}
function onGetMetadataRequested ( options , onSuccess , onError ) { if ( options . fileSystemId !== test_util . FILE_SYSTEM_ID ) { onError ( 'SECURITY' ) ; return ; } var metadata ; switch ( options . entryPath ) { case '/' : metadata = TESTING_ROOT ; break ; case '/' + TESTING_WITH_VALID_THUMBNAIL_FILE . name : metadata = TESTING_WITH_VALID_THUMBNAIL_FILE ; break ; case '/' + TESTING_ALWAYS_WITH_THUMBNAIL_FILE . name : metadata = TESTING_ALWAYS_WITH_THUMBNAIL_FILE ; break ; case '/' + TESTING_WITH_INVALID_THUMBNAIL_FILE . name : metadata = TESTING_WITH_INVALID_THUMBNAIL_FILE ; break ; default : onError ( 'NOT_FOUND' ) ; return ; } if ( ! options . thumbnail && metadata . thumbnail && options . entryPath !== '/' + TESTING_ALWAYS_WITH_THUMBNAIL_FILE . name ) { var metadataWithoutThumbnail = { isDirectory : metadata . isDirectory , name : metadata . name , size : metadata . size , modificationTime : metadata . modificationTime } ; onSuccess ( metadataWithoutThumbnail ) ; } else { onSuccess ( metadata ) ; } }
Returns metadata for a requested entry.
Returns metadata for a requested entry .
// enum ProviderError. // Metadata to be returned. // enum ProviderError. // Returning a thumbnail while not requested is not allowed for performance // reasons. Remove the field if needed. However, do not remove it for one // file, to simulate an error.