public class DefaultSecureFS extends java.lang.Object implements SOSecureFS
SOSecureFS.FileAttributes| Constructor and Description |
|---|
DefaultSecureFS() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
closeFile(java.lang.Object handle)
This method closes an open file within the secure container.
|
boolean |
copyFile(java.lang.String src,
java.lang.String dst)
This method copies a file to a new location within the secure
container..
Both source and destination file paths will reside within the secure container and be constructed using the secure container identifier used in isSecurePath(String). |
boolean |
createDirectory(java.lang.String path)
This method creates a directory, and all non-existent directories in
the supplied path, within the secure container.
The path will be constructed using the secure container identifier used in isSecurePath(String). |
boolean |
createFile(java.lang.String path)
This method creates a file within the secure container.
The file path will be constructed using the secure container identifier used in isSecurePath(String). |
boolean |
deleteFile(java.lang.String path)
This method deletes a file from within the secure container..
The file path will be constructed using the secure container identifier used in isSecurePath(String). |
boolean |
fileExists(java.lang.String path)
This method tests for the existence of a file within the secure
container.
The file path will be constructed using the secure container identifier used in isSecurePath(String). |
SOSecureFS.FileAttributes |
getFileAttributes(java.lang.String path)
This method returns the relevant attributes of the file located
at the supplied path.
|
java.lang.Object |
getFileHandleForReading(java.lang.String path)
This method opens an existing file, in the secure container, for
reading.
The file path will be constructed using the secure container identifier used in isSecurePath(String). |
java.lang.Object |
getFileHandleForUpdating(java.lang.String path)
This method opens an existing file, in the secure container, for
updating.
The file path will be constructed using the secure container identifier used in isSecurePath(String). |
java.lang.Object |
getFileHandleForWriting(java.lang.String path)
This method opens an existing file, in the secure container, for
writing.
The file path will be constructed using the secure container identifier used in isSecurePath(String). |
long |
getFileLength(java.lang.Object handle)
This method obtains the length of a file within the secure container.
|
long |
getFileOffset(java.lang.Object handle)
This method obtains the offset, from the start of the file , of the
file pointer.
|
java.lang.String |
getSecurePath()
Return the physical root of the secure container.
|
java.lang.String |
getSecurePrefix()
Return the 'tag' to indicate the file is suitable for decryption.
|
java.lang.String |
getTempPath()
This method returns the directory to be used to store temporary
files created during file translation/saving.
This directory must reside within the secure container as identified in isSecurePath(String). |
boolean |
isSecurePath(java.lang.String path)
This method determines whether the supplied file path resides
within the secure container.
The path may be a pseudo path on which a mapping can be performed to access the actual file. |
int |
readFromFile(java.lang.Object handle,
byte[] buf)
This method reads data from a file located within the secure container.
|
boolean |
recursivelyRemoveDirectory(java.lang.String path)
This method recursively deletes the supplied directory, and it's
sub-directories, located within the secure container.
The path will be constructed using the secure container identifier used in isSecurePath(String). |
boolean |
renameFile(java.lang.String src,
java.lang.String dst)
This method renames a file within the secure container.
Both source and destination file paths will reside within the secure container and be constructed using the secure container identifier used in isSecurePath(String). |
boolean |
seekToFileOffset(java.lang.Object handle,
long offset)
This method moves the file pointer to the requested offset from 0.
|
boolean |
setFileLength(java.lang.Object handle,
long length)
This method sets the file length of a file located within the
secure container.
|
boolean |
syncFile(java.lang.Object handle)
This method forces buffered data to be written to the underlying
device.
|
int |
writeToFile(java.lang.Object handle,
byte[] buf)
This method writes data to a file located within the secure container.
|
public java.lang.String getSecurePath()
getSecurePath in interface SOSecureFSpublic java.lang.String getSecurePrefix()
getSecurePrefix in interface SOSecureFSpublic boolean isSecurePath(java.lang.String path)
isSecurePath in interface SOSecureFSpath - The file path to be analysed.public final java.lang.String getTempPath()
isSecurePath(String).getTempPath in interface SOSecureFSpublic SOSecureFS.FileAttributes getFileAttributes(java.lang.String path)
isSecurePath(String).getFileAttributes in interface SOSecureFSpath - The path to the file to obtain attributes for.FileAttributes object.public boolean renameFile(java.lang.String src,
java.lang.String dst)
isSecurePath(String).renameFile in interface SOSecureFSsrc - The path to the file to be renamed.dst - The path to the destination file.public boolean copyFile(java.lang.String src,
java.lang.String dst)
isSecurePath(String).copyFile in interface SOSecureFSsrc - The path to the file to be copied.dst - The path to the destination file.public boolean deleteFile(java.lang.String path)
isSecurePath(String).deleteFile in interface SOSecureFSpath - The path to the file to be deleted.public boolean fileExists(java.lang.String path)
isSecurePath(String).fileExists in interface SOSecureFSpath - The path to the file to be checked.public boolean recursivelyRemoveDirectory(java.lang.String path)
isSecurePath(String).recursivelyRemoveDirectory in interface SOSecureFSpath - The path to the directory to be deleted.public boolean createDirectory(java.lang.String path)
isSecurePath(String).createDirectory in interface SOSecureFSpath - The path to the directory to be created.public boolean createFile(java.lang.String path)
isSecurePath(String).createFile in interface SOSecureFSpath - The path to the file to be created.public java.lang.Object getFileHandleForReading(java.lang.String path)
isSecurePath(String).getFileHandleForReading in interface SOSecureFSpath - The path to the file to be opened.public java.lang.Object getFileHandleForWriting(java.lang.String path)
isSecurePath(String).getFileHandleForWriting in interface SOSecureFSpath - The path to the file to be opened.public java.lang.Object getFileHandleForUpdating(java.lang.String path)
isSecurePath(String).getFileHandleForUpdating in interface SOSecureFSpath - The path to the file to be opened.public boolean setFileLength(java.lang.Object handle,
long length)
setFileLength in interface SOSecureFShandle - The file handle object to be used..public boolean closeFile(java.lang.Object handle)
closeFile in interface SOSecureFShandle - The file handle object to be closed.public int readFromFile(java.lang.Object handle,
byte[] buf)
readFromFile in interface SOSecureFShandle - The file handle object to be used..buf - The buffer to put the read data in.public int writeToFile(java.lang.Object handle,
byte[] buf)
writeToFile in interface SOSecureFShandle - The file handle object to be used.buf - The buffer containing the data.public boolean syncFile(java.lang.Object handle)
syncFile in interface SOSecureFShandle - The file handle object to be used.public long getFileLength(java.lang.Object handle)
getFileLength in interface SOSecureFShandle - The file handle object to be used.public long getFileOffset(java.lang.Object handle)
getFileOffset in interface SOSecureFShandle - The file handle object to be used.public boolean seekToFileOffset(java.lang.Object handle,
long offset)
seekToFileOffset in interface SOSecureFShandle - The file handle object to be used.