public interface IFileSystemImplementation
| Modifier and Type | Method and Description |
|---|---|
void |
addDataToFile(java.lang.String path,
byte[] data,
int offset,
boolean truncate)
Writes new contents to an existing file.
|
boolean |
createFileFromByteArray(java.lang.String path,
byte[] payload)
Creates a File from a byte array and returns
true if success,
false otherwise. |
boolean |
enoughStorageSizeAvailable(java.lang.String dir,
int fileSize)
Checks whether there is enough storage space available for
the given file size in the given directory.
|
boolean |
fileExists(java.lang.String path)
Retrieves whether the given file exists or not.
|
byte[] |
getByteArrayFromFile(java.lang.String path)
Returns the byte array associated to the File object.
|
java.io.InputStream |
getFileInputStream(java.lang.String path)
Retrieves the File input stream.
|
long |
getFileSize(java.lang.String path)
Retrieves the the given file size.
|
long |
getLastModified(java.lang.String path)
Retrieves the last modified date of the given file.
|
java.lang.String |
getName(java.lang.String path)
Retrieves the given file name.
|
java.lang.String |
getStorageRootDir()
Retrieves the directory path where file system storage root point
is located.
|
boolean |
isDirectory(java.lang.String path)
Retrieves whether the given file is a directory or not.
|
boolean |
isSymbolicLink(java.lang.String path)
Retrieves whether the given file is a symbolic link or not.
|
java.lang.String[] |
listFiles(java.lang.String path)
Lists the files under the given path.
|
void |
readFile(java.lang.String path,
byte[] data,
int offset,
int length)
Reads a portion of the given file.
|
void |
removeFile(java.lang.String path)
Removes the given file.
|
void addDataToFile(java.lang.String path,
byte[] data,
int offset,
boolean truncate)
throws java.lang.Exception
path - Path of the file to add data content to.data - The data content to add.offset - The starting offset to start writing data.truncate - Whether to truncate the file after the new data.java.lang.Exception - if any error occur while adding the given data to the
file.boolean createFileFromByteArray(java.lang.String path,
byte[] payload)
throws java.lang.Exception
true if success,
false otherwise.path - Path of the file to create.payload - Byte array with the content.true if success, false otherwisejava.lang.Exception - if any error occur while creating the new file.boolean enoughStorageSizeAvailable(java.lang.String dir,
int fileSize)
dir - Directory of the new file to create.fileSize - Size of the new file to create.true if there is enough storage, false otherwise.boolean fileExists(java.lang.String path)
path - Path of the file to check.true if file exists, false otherwise.byte[] getByteArrayFromFile(java.lang.String path)
throws java.lang.Exception
path - Path of the file to retrieve the byte array.java.lang.Exception - if any error occur while reading the contents of the
file defined by the given path.java.io.InputStream getFileInputStream(java.lang.String path)
throws java.lang.Exception
path - Path of the file to retrieve stream from.java.lang.Exception - if any error occur while getting the InputStream
of the file defined by the given path.long getFileSize(java.lang.String path)
path - Path of the file to retrieve its size.long getLastModified(java.lang.String path)
path - Path to the file to retrieve last modified date.java.lang.String getName(java.lang.String path)
path - Path to the file to retrieve its name.java.lang.String getStorageRootDir()
boolean isDirectory(java.lang.String path)
path - Path of the file to checktrue if file is a directory, false otherwise.boolean isSymbolicLink(java.lang.String path)
path - Path of the file to check.true if file is a symbolic link, false otherwise.java.lang.String[] listFiles(java.lang.String path)
path - Path to list files.void readFile(java.lang.String path,
byte[] data,
int offset,
int length)
throws java.lang.Exception
path - Path of the file to read.data - Byte array to store the read data.offset - Starting file offset to read.length - Amount of bytes to read.java.lang.Exception - if any error occur while reading the file.void removeFile(java.lang.String path)
throws java.lang.Exception
path - Path of the file to remove.java.lang.Exception - if any error occurs when removing the file defined by
the given path.© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.