Updated Branches: refs/heads/master 1bd5b7e0b -> 2a4e41ce7
toURI becomes toURL Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/commit/2a4e41ce Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/tree/2a4e41ce Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/diff/2a4e41ce Branch: refs/heads/master Commit: 2a4e41ce728e06c76a94ca27a787f355580afbf0 Parents: 1bd5b7e Author: Jesse MacFadyen <purplecabb...@gmail.com> Authored: Tue May 22 12:45:37 2012 -0700 Committer: Jesse MacFadyen <purplecabb...@gmail.com> Committed: Tue May 22 12:45:37 2012 -0700 ---------------------------------------------------------------------- .../cordova/file/directoryentry/directoryentry.md | 64 +++++++------- docs/en/edge/cordova/file/fileentry/fileentry.md | 52 ++++++------ 2 files changed, 58 insertions(+), 58 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/2a4e41ce/docs/en/edge/cordova/file/directoryentry/directoryentry.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/file/directoryentry/directoryentry.md b/docs/en/edge/cordova/file/directoryentry/directoryentry.md index 90b4143..006f466 100644 --- a/docs/en/edge/cordova/file/directoryentry/directoryentry.md +++ b/docs/en/edge/cordova/file/directoryentry/directoryentry.md @@ -32,18 +32,18 @@ Properties NOTE: The following attributes are defined by the W3C specification, but are __not supported__ by Cordova: -- __filesystem:__ The file system on which the DirectoryEntry resides. _(FileSystem)_ +- __filesystem:__ The file system on which the DirectoryEntry resides. _(FileSystem)_ Methods ------- The following methods can be invoked on a DirectoryEntry object: -- __getMetadata__: Look up metadata about a directory. +- __getMetadata__: Look up metadata about a directory. - __setMetadata__: Set metadata on a directory. - __moveTo__: Move a directory to a different location on the file system. - __copyTo__: Copy a directory to a different location on the file system. -- __toURI__: Return a URI that can be used to locate a directory. +- __toURL__: Return a URL that can be used to locate a directory. - __remove__: Delete a directory. The directory must be empty. - __getParent__: Look up the parent directory. - __createReader__: Create a new DirectoryReader that can read entries from a directory. @@ -82,12 +82,12 @@ __Quick Example__ } // Request the metadata object for this entry - entry.getMetadata(success, fail); + entry.getMetadata(success, fail); setMetadata ---------------- -Set metadata on a directory. +Set metadata on a directory. **Only works on iOS currently** - this will set the extended attributes of a directory. __Parameters:__ @@ -108,7 +108,7 @@ __Quick Example__ } // Set the metadata - entry.setMetadata(success, fail, { "com.apple.MobileBackup", 1}); + entry.setMetadata(success, fail, { "com.apple.MobileBackup", 1}); __iOS Quirk__ - only the **"com.apple.MobileBackup"** extended attribute is supported. Set the value to **1** to NOT enable the directory to be backed up by iCloud. Set the value to **0** to re-enable the directory to be backed up by iCloud. @@ -143,7 +143,7 @@ __Quick Example__ function fail(error) { alert(error.code); } - + function moveDir(entry) { var parent = document.getElementById('parent').value, newName = document.getElementById('newName').value, @@ -159,7 +159,7 @@ copyTo Copy a directory to a different location on the file system. It is an error to attempt to: - copy a directory inside itself at any depth; -- copy a directory into its parent if a name different from its current one is not provided. +- copy a directory into its parent if a name different from its current one is not provided. Directory copies are always recursive - that is, they copy all contents of the directory. @@ -176,11 +176,11 @@ __Quick Example__ function win(entry) { console.log("New Path: " + entry.fullPath); } - + function fail(error) { alert(error.code); } - + function copyDir(entry) { var parent = document.getElementById('parent').value, newName = document.getElementById('newName').value, @@ -191,16 +191,16 @@ __Quick Example__ } -toURI +toURL ----- -Returns a URI that can be used to locate the directory. +Returns a URL that can be used to locate the directory. __Quick Example__ - - // Get the URI for this directory - var uri = entry.toURI(); - console.log(uri); + + // Get the URL for this directory + var dirURL = entry.toURL(); + console.log(dirURL); remove @@ -217,7 +217,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs when attempting to delete the directory. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(entry) { console.log("Removal succeeded"); } @@ -233,7 +233,7 @@ __Quick Example__ getParent --------- -Look up the parent DirectoryEntry containing the directory. +Look up the parent DirectoryEntry containing the directory. __Parameters:__ @@ -241,17 +241,17 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs when attempting to retrieve the parent DirectoryEntry. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(parent) { console.log("Parent Name: " + parent.name); } - + function fail(error) { alert('Failed to get parent directory: ' + error.code); } - + // Get the parent DirectoryEntry - entry.getParent(success, fail); + entry.getParent(success, fail); createReader @@ -260,9 +260,9 @@ createReader Creates a new DirectoryReader to read entries in a directory. __Quick Example__ - + // create a directory reader - var directoryReader = entry.createReader(); + var directoryReader = entry.createReader(); getDirectory @@ -280,7 +280,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs creating or looking up the directory. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(parent) { console.log("Parent Name: " + parent.name); } @@ -290,7 +290,7 @@ __Quick Example__ } // Retrieve an existing directory, or create it if it does not already exist - entry.getDirectory("newDir", {create: true, exclusive: false}, success, fail); + entry.getDirectory("newDir", {create: true, exclusive: false}, success, fail); getFile @@ -308,7 +308,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs creating or looking up the file. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(parent) { console.log("Parent Name: " + parent.name); } @@ -318,14 +318,14 @@ __Quick Example__ } // Retrieve an existing file, or create it if it does not exist - entry.getFile("newFile.txt", {create: true, exclusive: false}, success, fail); + entry.getFile("newFile.txt", {create: true, exclusive: false}, success, fail); removeRecursively ----------------- -Deletes a directory and all of its contents. In the event of an error (e.g. trying to delete -a directory that contains a file that cannot be removed), some of the contents of the directory may +Deletes a directory and all of its contents. In the event of an error (e.g. trying to delete +a directory that contains a file that cannot be removed), some of the contents of the directory may be deleted. It is an error to attempt to: - delete the root directory of a filesystem. @@ -336,7 +336,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs when attempting to delete the DirectoryEntry. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(parent) { console.log("Remove Recursively Succeeded"); } @@ -346,4 +346,4 @@ __Quick Example__ } // remove the directory and all it's contents - entry.removeRecursively(success, fail); + entry.removeRecursively(success, fail); http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/2a4e41ce/docs/en/edge/cordova/file/fileentry/fileentry.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/file/fileentry/fileentry.md b/docs/en/edge/cordova/file/fileentry/fileentry.md index 7da7de2..36d3f54 100644 --- a/docs/en/edge/cordova/file/fileentry/fileentry.md +++ b/docs/en/edge/cordova/file/fileentry/fileentry.md @@ -38,12 +38,12 @@ NOTE: The following attributes are defined by the W3C specification, but are __n Methods ------- -- __getMetadata__: Look up metadata about a file. +- __getMetadata__: Look up metadata about a file. - __setMetadata__: Set metadata on a file. - __moveTo__: Move a file to a different location on the file system. - __copyTo__: Copy a file to a different location on the file system. -- __toURI__: Return a URI that can be used to locate a file. -- __remove__: Delete a file. +- __toURL__: Return a URL that can be used to locate a file. +- __remove__: Delete a file. - __getParent__: Look up the parent directory. - __createWriter__: Creates a FileWriter object that can be used to write to a file. - __file__: Creates a File object containing file properties. @@ -80,13 +80,13 @@ __Quick Example__ } // Request the metadata object for this entry - entry.getMetadata(success, fail); + entry.getMetadata(success, fail); setMetadata ---------------- -Set metadata on a file. +Set metadata on a file. **Only works on iOS currently** - this will set the extended attributes of a file. __Parameters:__ @@ -107,7 +107,7 @@ __Quick Example__ } // Set the metadata - entry.setMetadata(success, fail, { "com.apple.MobileBackup", 1}); + entry.setMetadata(success, fail, { "com.apple.MobileBackup", 1}); __iOS Quirk__ - only the **"com.apple.MobileBackup"** extended attribute is supported. Set the value to **1** to NOT enable the file to be backed up by iCloud. Set the value to **0** to re-enable the file to be backed up by iCloud. @@ -121,7 +121,7 @@ Move a file to a different location on the file system. It is an error to attemp - move a file into its parent if a name different from its current one isn't provided; - move a file to a path occupied by a directory; -In addition, an attempt to move a file on top of an existing file must attempt to delete and replace that file. +In addition, an attempt to move a file on top of an existing file must attempt to delete and replace that file. __Parameters:__ @@ -148,14 +148,14 @@ __Quick Example__ // move the file to a new directory and rename it entry.moveTo(parentEntry, "newFile.txt", success, fail); } - + copyTo ------ Copy a file to a new location on the file system. It is an error to attempt to: -- copy a file into its parent if a name different from its current one is not provided. +- copy a file into its parent if a name different from its current one is not provided. __Parameters:__ @@ -183,23 +183,23 @@ __Quick Example__ entry.copyTo(parentEntry, "file.copy", success, fail); } - -toURI + +toURL ----- -Returns a URI that can be used to locate the file. +Returns a URL that can be used to locate the file. __Quick Example__ - - // Request the URI for this entry - var uri = entry.toURI(); - console.log(uri); + + // Request the URL for this entry + var fileURL = entry.toURL(); + console.log(fileURL); remove ------ -Deletes a file. +Deletes a file. __Parameters:__ @@ -207,7 +207,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs when attempting to delete the file. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(entry) { console.log("Removal succeeded"); } @@ -223,7 +223,7 @@ __Quick Example__ getParent --------- -Look up the parent DirectoryEntry containing the file. +Look up the parent DirectoryEntry containing the file. __Parameters:__ @@ -231,7 +231,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs when attempting to retrieve the parent DirectoryEntry. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(parent) { console.log("Parent Name: " + parent.name); } @@ -241,7 +241,7 @@ __Quick Example__ } // Get the parent DirectoryEntry - entry.getParent(success, fail); + entry.getParent(success, fail); createWriter @@ -255,7 +255,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs while attempting to create the FileWriter. Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(writer) { writer.write("Some text to the file"); } @@ -265,7 +265,7 @@ __Quick Example__ } // create a FileWriter to write to the file - entry.createWriter(success, fail); + entry.createWriter(success, fail); file @@ -279,7 +279,7 @@ __Parameters:__ - __errorCallback__ - A callback that is called if an error occurs when creating the File object (e.g. the underlying file no longer exists). Invoked with a FileError object. _(Function)_ __Quick Example__ - + function success(file) { console.log("File size: " + file.size); } @@ -287,6 +287,6 @@ __Quick Example__ function fail(error) { alert("Unable to retrieve file properties: " + error.code); } - + // obtain properties of a file - entry.file(success, fail); + entry.file(success, fail);