Dart Documentationchrome.src.filesCrEntry

CrEntry abstract class

abstract class CrEntry extends ChromeObject implements Entry {
 // This factory returns either a FileEntry or a DirectoryEntry.
 factory CrEntry.fromProxy(JsObject jsProxy) {
   if (jsProxy == null) {
     return null;
   } else if (jsProxy['isFile']) {
     return new ChromeFileEntry.fromProxy(jsProxy);
   } else {
     return new CrDirectoryEntry.fromProxy(jsProxy);
   }
 }

 CrEntry._fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 bool get isDirectory => jsProxy['isDirectory'];
 bool get isFile => jsProxy['isFile'];
 String get fullPath => jsProxy['fullPath'];
 String get name => jsProxy['name'];
 FileSystem get filesystem => new CrFileSystem.fromProxy(jsProxy['filesystem']);

 String toUrl() => this.jsProxy.callMethod('toURL');

 Future<Entry> copyTo(DirectoryEntry parent, {String name}) {
   var completer = new _ChromeCompleterWithError<Entry>.oneArg((obj) => new CrEntry.fromProxy(obj));
   jsProxy.callMethod('copyTo', [(parent as ChromeObject).jsProxy, name, completer.callback, completer.errorCallback]);
   return completer.future;
 }

 Future<Entry> moveTo(DirectoryEntry parent, {String name}) {
   var completer = new _ChromeCompleterWithError<Entry>.oneArg((obj) => new CrEntry.fromProxy(obj));
   jsProxy.callMethod('moveTo', [(parent as ChromeObject).jsProxy, name, completer.callback, completer.errorCallback]);
   return completer.future;
 }

 Future remove() {
   var completer = new _ChromeCompleterWithError<Metadata>.noArgs();
   jsProxy.callMethod('remove', [completer.callback, completer.errorCallback]);
   return completer.future;
 }

 Future<Metadata> getMetadata() {
   var completer = new _ChromeCompleterWithError<Metadata>.oneArg((obj) => new CrMetadata.fromProxy(obj));
   jsProxy.callMethod('getMetadata', [completer.callback, completer.errorCallback]);
   return completer.future;
 }

 Future<Entry> getParent() {
   var completer = new _ChromeCompleterWithError<Entry>.oneArg((obj) => new CrDirectoryEntry.fromProxy(obj));
   jsProxy.callMethod('getParent', [completer.callback, completer.errorCallback]);
   return completer.future;
 }

 String toString() => name;
}

Extends

ChromeObject > CrEntry

Subclasses

CrDirectoryEntry, CrFileEntry

Implements

Entry

Constructors

factory CrEntry.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
factory CrEntry.fromProxy(JsObject jsProxy) {
 if (jsProxy == null) {
   return null;
 } else if (jsProxy['isFile']) {
   return new ChromeFileEntry.fromProxy(jsProxy);
 } else {
   return new CrDirectoryEntry.fromProxy(jsProxy);
 }
}

Properties

final FileSystem filesystem #

inherited from Entry
final FileSystem filesystem

final String fullPath #

inherited from Entry
final String fullPath

final bool isDirectory #

inherited from Entry
final bool isDirectory

final bool isFile #

inherited from Entry
final bool isFile

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

final String name #

inherited from Entry
final String name

Methods

Future<Entry> copyTo(DirectoryEntry parent, {String name}) #

Future<Entry> copyTo(DirectoryEntry parent, {String name}) {
 var completer = new _ChromeCompleterWithError<Entry>.oneArg((obj) => new CrEntry.fromProxy(obj));
 jsProxy.callMethod('copyTo', [(parent as ChromeObject).jsProxy, name, completer.callback, completer.errorCallback]);
 return completer.future;
}

Future<Metadata> getMetadata() #

Future<Metadata> getMetadata() {
 var completer = new _ChromeCompleterWithError<Metadata>.oneArg((obj) => new CrMetadata.fromProxy(obj));
 jsProxy.callMethod('getMetadata', [completer.callback, completer.errorCallback]);
 return completer.future;
}

Future<Entry> getParent() #

Future<Entry> getParent() {
 var completer = new _ChromeCompleterWithError<Entry>.oneArg((obj) => new CrDirectoryEntry.fromProxy(obj));
 jsProxy.callMethod('getParent', [completer.callback, completer.errorCallback]);
 return completer.future;
}

Future<Entry> moveTo(DirectoryEntry parent, {String name}) #

Future<Entry> moveTo(DirectoryEntry parent, {String name}) {
 var completer = new _ChromeCompleterWithError<Entry>.oneArg((obj) => new CrEntry.fromProxy(obj));
 jsProxy.callMethod('moveTo', [(parent as ChromeObject).jsProxy, name, completer.callback, completer.errorCallback]);
 return completer.future;
}

Future remove() #

Future remove() {
 var completer = new _ChromeCompleterWithError<Metadata>.noArgs();
 jsProxy.callMethod('remove', [completer.callback, completer.errorCallback]);
 return completer.future;
}

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

Returns a string representation of this object.

docs inherited from Object
String toString() => name;

String toUrl() #

String toUrl() => this.jsProxy.callMethod('toURL');