EntrySync Interface
The EntrySync
interface of the FileSystem API represents entries in a file system. The entries can be a file or a DirectoryEntry.
Subinterfaces
DirectoryEntrySync, FileEntrySync
Methods
Code EntrySync copyTo(DirectoryEntrySync parent, String name) #
Copy an entry to a different location on the file system. You cannot copy an entry inside itself if it is a directory nor can you copy it into its parent if a name different from its current one isn't provided. Directory copies are always recursive—that is, they copy all contents of the directory.
void vopyTo ( (in DirectoryEntry parent, optional DOMString newName, optional EntryCallback successCallback, optional ErrorCallback errorCallback); );
Parameter
- parent
- The directory to which to move the entry.
- newName
- The new name of the entry. Defaults to the entry's current name if unspecified.
- successCallback
- A callback that is called with the entry for the new object.
- errorCallback
- A callback that is called when errors happen.
Returns
void
EntrySync copyTo(DirectoryEntrySync parent, String name);
Code Metadata getMetadata() #
Look up metadata about this entry.
void getMetada ( in MetadataCallback ErrorCallback );
Parameter
- successCallback
- A callback that is called with the time of the last modification.
- errorCallback
- A callback that is called when errors happen.
Returns
void
Metadata getMetadata();
Code EntrySync getParent() #
Look up the parent DirectoryEntry
containing this entry. If this entry is the root of its filesystem, its parent is itself.
void getParent ( (in EntryCallback successCallback, optional ErrorCallback errorCallback); );
Parameter
- parent
- The directory to which to move the entry.
- newName
- The new name of the entry. Defaults to the entry's current name if unspecified.
- successCellback
- A callback that is called with the entry for the new object.
- errorCallback
- A callback that is called when errors happen.
Returns
void
EntrySync getParent();
Code EntrySync moveTo(DirectoryEntrySync parent, String name) #
Move an entry to a different location on the file system. You cannot do the following:
- move a directory inside itself or to any child at any depth;
- move an entry into its parent if a name different from its current one isn't provided;
- move a file to a path occupied by a directory;
- move a directory to a path occupied by a file;
- move any element to a path occupied by a directory which is not empty.
Moving a file over an existing file replaces that existing file. A move of a directory on top of an existing empty directory replaces that directory.
void moveTo ( (in DirectoryEntry parent, optional DOMString newName, optional EntryCallback successCallback, optional ErrorCallback errorCallback); );
Parameter
- parent
- The directory to which to move the entry.
- newName
- The new name of the entry. Defaults to the entry's current name if unspecified.
- successCallback
- A callback that is called with the entry for the new object.
- errorCallback
- A callback that is called when errors happen.
Returns
void
EntrySync moveTo(DirectoryEntrySync parent, String name);
Code void remove() #
Deletes a file or directory. You cannot delete an empty directory or the root directory of a filesystem.
void remove ( (in VoidCallback successCallback, optional ErrorCallback errorCallback); );
Parameter
- successCallback
- A callback that is called with the entry for the new object.
- errorCallback
- A callback that is called when errors happen.
Returns
void
void remove();
Code String toURL() #
Returns a URL that can be used to identify this entry. It has no specific expiration. Bcause it describes a location on disk, it is valid for as long as that location exists. Users can supply mimeType
to simulate the optional mime-type header associated with HTTP downloads.
DOMString toURL ( (in optional DOMString mimeType); );
Parameter
- mimeType
- For a FileEntry, the mime type to be used to interpret the file, when loaded through this URL.
Returns
DOMString
String toURL();
Fields
Code final DOMFileSystemSync filesystem #
final DOMFileSystemSync filesystem;
This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.