public class FileBridge extends BaseDataBridge implements IFile, APIBridge
apiGroup| Constructor and Description |
|---|
FileBridge(IFile delegate)
Constructor with delegate.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(FileDescriptor descriptor)
Determine whether the current file/folder can be read from.
|
boolean |
canWrite(FileDescriptor descriptor)
Determine whether the current file/folder can be written to.
|
void |
create(FileDescriptor descriptor,
IFileResultCallback callback)
Creates a file with the specified name.
|
boolean |
delete(FileDescriptor descriptor,
boolean cascade)
Deletes the given file or path.
|
boolean |
exists(FileDescriptor descriptor)
Check whether the file/path exists.
|
void |
getContent(FileDescriptor descriptor,
IFileDataLoadResultCallback callback)
Loads the content of the file.
|
IFile |
getDelegate()
Get the delegate implementation.
|
IFileSystemStorageType |
getFileStorageType(FileDescriptor descriptor)
Returns the file storage type of the file
|
IFileSystemType |
getFileType(FileDescriptor descriptor)
Returns the file type
|
IFileSystemSecurity |
getSecurityType(FileDescriptor descriptor)
Returns the security type of the file
|
APIResponse |
invoke(APIRequest request)
Invokes the given method specified in the API request object.
|
boolean |
isDirectory(FileDescriptor descriptor)
Check whether this is a path of a file.
|
void |
listFiles(FileDescriptor descriptor,
IFileListResultCallback callback)
List all the files contained within this file/path reference.
|
void |
listFilesForRegex(FileDescriptor descriptor,
java.lang.String regex,
IFileListResultCallback callback)
List all the files matching the speficied regex filter within this file/path reference.
|
boolean |
mkDir(FileDescriptor descriptor,
boolean recursive)
Creates the parent path (or paths, if recursive) to the given file/path if it doesn't already exist.
|
void |
move(FileDescriptor source,
FileDescriptor destination,
boolean createPath,
boolean overwrite,
IFileResultCallback callback)
Moves the current file to the given file destination, optionally overwriting and creating the path to the
new destination file.
|
void |
setContent(FileDescriptor descriptor,
byte[] content,
IFileDataStoreResultCallback callback)
Sets the content of the file.
|
void |
setDelegate(IFile delegate)
Set the delegate implementation.
|
getAPIGroup, getAPIVersion, getJSONParserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAPIGroup, getAPIVersionpublic FileBridge(IFile delegate)
delegate - The delegate implementing platform specific functions.public final IFile getDelegate()
public final void setDelegate(IFile delegate)
delegate - The delegate implementing platform specific functions.public boolean canRead(FileDescriptor descriptor)
public boolean canWrite(FileDescriptor descriptor)
public void create(FileDescriptor descriptor, IFileResultCallback callback)
public boolean delete(FileDescriptor descriptor, boolean cascade)
public boolean exists(FileDescriptor descriptor)
public void getContent(FileDescriptor descriptor, IFileDataLoadResultCallback callback)
getContent in interface IFiledescriptor - File descriptor of file or folder used for operation.callback - Result of the operation.public IFileSystemStorageType getFileStorageType(FileDescriptor descriptor)
getFileStorageType in interface IFiledescriptor - File descriptor of file or folder used for operation.public IFileSystemType getFileType(FileDescriptor descriptor)
getFileType in interface IFiledescriptor - File descriptor of file or folder used for operation.public IFileSystemSecurity getSecurityType(FileDescriptor descriptor)
getSecurityType in interface IFiledescriptor - File descriptor of file or folder used for operation.public boolean isDirectory(FileDescriptor descriptor)
isDirectory in interface IFiledescriptor - File descriptor of file or folder used for operation.public void listFiles(FileDescriptor descriptor, IFileListResultCallback callback)
public void listFilesForRegex(FileDescriptor descriptor, java.lang.String regex, IFileListResultCallback callback)
listFilesForRegex in interface IFiledescriptor - File descriptor of file or folder used for operation.regex - Filter (eg. *.jpg, *.png, Fil*) name string.callback - Result of operation.public boolean mkDir(FileDescriptor descriptor, boolean recursive)
public void move(FileDescriptor source, FileDescriptor destination, boolean createPath, boolean overwrite, IFileResultCallback callback)
move in interface IFilesource - File descriptor of file or folder used for operation as source.destination - File descriptor of file or folder used for operation as destination.createPath - True to create the path if it does not already exist.callback - Result of the operation.overwrite - True to create the path if it does not already exist.public void setContent(FileDescriptor descriptor, byte[] content, IFileDataStoreResultCallback callback)
setContent in interface IFiledescriptor - File descriptor of file or folder used for operation.content - Binary content to store in the file.callback - Result of the operation.public APIResponse invoke(APIRequest request)
invoke in interface APIBridgeinvoke in class BaseDataBridgerequest - APIRequest object containing method name and parameters.