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

  if (options.sourcePath === '/') {
    onError('INVALID_OPERATION');
    return;
  }

  if (!(options.sourcePath in test_util.defaultMetadata)) {
    onError('NOT_FOUND');
    return;
  }

  if (options.targetPath in test_util.defaultMetadata) {
    onError('EXISTS');
    return;
  }

  // Copy the metadata, but change the 'name' field.
  var newMetadata =
      JSON.parse(JSON.stringify(test_util.defaultMetadata[options.sourcePath]));
  newMetadata.name = options.targetPath.split('/').pop();
  test_util.defaultMetadata[options.targetPath] = newMetadata;

  onSuccess();  // enum ProviderError.
}
/**
 * Copies an entry within the same file system.
 *
 * @param {CopyEntryRequestedOptions} options Options.
 * @param {function(Object)} onSuccess Success callback
 * @param {function(string)} onError Error callback with an error code.
 */
Copies an entry within the same file system.
@param {CopyEntryRequestedOptions} options Options.
@param {function(Object)} onSuccess Success callback
@param {function(string)} onError Error callback with an error code.
Copies an entry within the same file system . @param { CopyEntryRequestedOptions } options Options . @param { function ( Object ) } onSuccess Success callback @param { function ( string ) } onError Error callback with an error code .
function onCopyEntryRequested(options, onSuccess, onError) {
  if (options.fileSystemId !== test_util.FILE_SYSTEM_ID) {
    onError('SECURITY');  
    return;
  }
  if (options.sourcePath === '/') {
    onError('INVALID_OPERATION');
    return;
  }
  if (!(options.sourcePath in test_util.defaultMetadata)) {
    onError('NOT_FOUND');
    return;
  }
  if (options.targetPath in test_util.defaultMetadata) {
    onError('EXISTS');
    return;
  }
  var newMetadata =
      JSON.parse(JSON.stringify(test_util.defaultMetadata[options.sourcePath]));
  newMetadata.name = options.targetPath.split('/').pop();
  test_util.defaultMetadata[options.targetPath] = newMetadata;
  onSuccess();  
}
function onCopyEntryRequested ( options , onSuccess , onError ) { if ( options . fileSystemId !== test_util . FILE_SYSTEM_ID ) { onError ( 'SECURITY' ) ; return ; } if ( options . sourcePath === '/' ) { onError ( 'INVALID_OPERATION' ) ; return ; } if ( ! ( options . sourcePath in test_util . defaultMetadata ) ) { onError ( 'NOT_FOUND' ) ; return ; } if ( options . targetPath in test_util . defaultMetadata ) { onError ( 'EXISTS' ) ; return ; } var newMetadata = JSON . parse ( JSON . stringify ( test_util . defaultMetadata [ options . sourcePath ] ) ) ; newMetadata . name = options . targetPath . split ( '/' ) . pop ( ) ; test_util . defaultMetadata [ options . targetPath ] = newMetadata ; onSuccess ( ) ; }
Copies an entry within the same file system.
Copies an entry within the same file system .
// enum ProviderError. // Copy the metadata, but change the 'name' field. // enum ProviderError.