Package com.artifex.solib
Class DefaultSecureFS
java.lang.Object
com.artifex.solib.DefaultSecureFS
- All Implemented Interfaces:
SOSecureFS
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.artifex.solib.SOSecureFS
SOSecureFS.FileAttributes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis method closes an open file within the secure container.booleanThis 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 inisSecurePath(String).booleancreateDirectory(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 inisSecurePath(String).booleancreateFile(String path) This method creates a file within the secure container.
The file path will be constructed using the secure container identifier used inisSecurePath(String).booleandeleteFile(String path) This method deletes a file from within the secure container..
The file path will be constructed using the secure container identifier used inisSecurePath(String).booleanfileExists(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 inisSecurePath(String).getFileAttributes(String path) This method returns the relevant attributes of the file located at the supplied 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 inisSecurePath(String).This method opens an existing file, in the secure container, for updating.
The file path will be constructed using the secure container identifier used inisSecurePath(String).This method opens an existing file, in the secure container, for writing.
The file path will be constructed using the secure container identifier used inisSecurePath(String).longgetFileLength(Object handle) This method obtains the length of a file within the secure container.longgetFileOffset(Object handle) This method obtains the offset, from the start of the file , of the file pointer.Return the physical root of the secure container.Return the 'tag' to indicate the file is suitable for decryption.final StringThis 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 inisSecurePath(String).booleanisSecurePath(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.intreadFromFile(Object handle, byte[] buf) This method reads data from a file located within the secure container.booleanThis 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 inisSecurePath(String).booleanrenameFile(String src, 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 inisSecurePath(String).booleanseekToFileOffset(Object handle, long offset) This method moves the file pointer to the requested offset from 0.booleansetFileLength(Object handle, long length) This method sets the file length of a file located within the secure container.booleanThis method forces buffered data to be written to the underlying device.intwriteToFile(Object handle, byte[] buf) This method writes data to a file located within the secure container.
-
Constructor Details
-
DefaultSecureFS
public DefaultSecureFS()
-
-
Method Details
-
getSecurePath
Return the physical root of the secure container.- Specified by:
getSecurePathin interfaceSOSecureFS- Returns:
- The physical path to the secure container.
-
getSecurePrefix
Return the 'tag' to indicate the file is suitable for decryption.- Specified by:
getSecurePrefixin interfaceSOSecureFS- Returns:
- The secure 'tag' string.
-
isSecurePath
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. For example "/SECURE/filename".- Specified by:
isSecurePathin interfaceSOSecureFS- Parameters:
path- The file path to be analysed.- Returns:
- True if the file resides within the secure container.
False otherwise.
-
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 inisSecurePath(String).- Specified by:
getTempPathin interfaceSOSecureFS- Returns:
- The (pseudo) path to the temporary directory.
-
getFileAttributes
This method returns the relevant attributes of the file located at the supplied path. The path will reference a file within the secure container.
The attributes should refer to the properties of the decrypted file.
The (pseudo) path will be constructed using the secure container identifier used inisSecurePath(String).- Specified by:
getFileAttributesin interfaceSOSecureFS- Parameters:
path- The path to the file to obtain attributes for.- Returns:
- A reference to a
SOSecureFS.FileAttributesobject.
null on error.
-
renameFile
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 inisSecurePath(String).- Specified by:
renameFilein interfaceSOSecureFS- Parameters:
src- The path to the file to be renamed.dst- The path to the destination file.- Returns:
- True on success. False on failure.
-
copyFile
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 inisSecurePath(String).- Specified by:
copyFilein interfaceSOSecureFS- Parameters:
src- The path to the file to be copied.dst- The path to the destination file.- Returns:
- True on success. False on failure.
-
deleteFile
This method deletes a file from within the secure container..
The file path will be constructed using the secure container identifier used inisSecurePath(String).- Specified by:
deleteFilein interfaceSOSecureFS- Parameters:
path- The path to the file to be deleted.- Returns:
- True on success. False on failure.
-
fileExists
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 inisSecurePath(String).- Specified by:
fileExistsin interfaceSOSecureFS- Parameters:
path- The path to the file to be checked.- Returns:
- True if the file exists. False otherwise.
-
recursivelyRemoveDirectory
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 inisSecurePath(String).- Specified by:
recursivelyRemoveDirectoryin interfaceSOSecureFS- Parameters:
path- The path to the directory to be deleted.- Returns:
- True on success. False on failure.
-
createDirectory
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 inisSecurePath(String).- Specified by:
createDirectoryin interfaceSOSecureFS- Parameters:
path- The path to the directory to be created.- Returns:
- True on success. False on failure.
-
createFile
This method creates a file within the secure container.
The file path will be constructed using the secure container identifier used inisSecurePath(String).- Specified by:
createFilein interfaceSOSecureFS- Parameters:
path- The path to the file to be created.- Returns:
- True on success. False on failure.
-
getFileHandleForReading
This method opens an existing file, in the secure container, for reading.
The file path will be constructed using the secure container identifier used inisSecurePath(String).- Specified by:
getFileHandleForReadingin interfaceSOSecureFS- Parameters:
path- The path to the file to be opened.- Returns:
- The file handle object on success.
null on error.
-
getFileHandleForWriting
This method opens an existing file, in the secure container, for writing.
The file path will be constructed using the secure container identifier used inisSecurePath(String).- Specified by:
getFileHandleForWritingin interfaceSOSecureFS- Parameters:
path- The path to the file to be opened.- Returns:
- The file handle object on success.
null on error.
-
getFileHandleForUpdating
This method opens an existing file, in the secure container, for updating.
The file path will be constructed using the secure container identifier used inisSecurePath(String).- Specified by:
getFileHandleForUpdatingin interfaceSOSecureFS- Parameters:
path- The path to the file to be opened.- Returns:
- The file handle object on success.
null on error.
-
setFileLength
This method sets the file length of a file located within the secure container.- Specified by:
setFileLengthin interfaceSOSecureFS- Parameters:
handle- The file handle object to be used..- Returns:
- True on success. False on failure.
-
closeFile
This method closes an open file within the secure container.- Specified by:
closeFilein interfaceSOSecureFS- Parameters:
handle- The file handle object to be closed.- Returns:
- True on success. False on failure.
-
readFromFile
This method reads data from a file located within the secure container.- Specified by:
readFromFilein interfaceSOSecureFS- Parameters:
handle- The file handle object to be used..buf- The buffer to put the read data in.- Returns:
- The amount of data placed in the buffer.
0 on EOF
-1 on error.
-
writeToFile
This method writes data to a file located within the secure container.- Specified by:
writeToFilein interfaceSOSecureFS- Parameters:
handle- The file handle object to be used.buf- The buffer containing the data.- Returns:
- The amount of data written. -1 on error.
-
syncFile
This method forces buffered data to be written to the underlying device.- Specified by:
syncFilein interfaceSOSecureFS- Parameters:
handle- The file handle object to be used.- Returns:
- True on success. False on failure.
-
getFileLength
This method obtains the length of a file within the secure container.
The length returned is that of the decrypted file.- Specified by:
getFileLengthin interfaceSOSecureFS- Parameters:
handle- The file handle object to be used.- Returns:
- The file length. -1 on error.
-
getFileOffset
This method obtains the offset, from the start of the file , of the file pointer.
The offset returned relates to the decrypted file.- Specified by:
getFileOffsetin interfaceSOSecureFS- Parameters:
handle- The file handle object to be used.- Returns:
- The file pointer offset. -1 on error.
-
seekToFileOffset
This method moves the file pointer to the requested offset from 0.
The offset relates to the decrypted file.- Specified by:
seekToFileOffsetin interfaceSOSecureFS- Parameters:
handle- The file handle object to be used.- Returns:
- True on success. False on failure.
-