Package com.artifex.solib
Interface SOSecureFS
- All Known Implementing Classes:
DefaultSecureFS
public interface SOSecureFS
This interface specifies the basis for implementing a class allowing
proprietary encrypted files, stored in a secure container, to be
accessed by SOLib.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThis class defines the attributes associated with the decrypted file. -
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.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).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 ofset) 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.
-
Method Details
-
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".- Parameters:
path- The file path to be analysed.- Returns:
- True if the file resides within the secure container.
False otherwise.
-
getTempPath
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 inisSecurePath(String).- 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).- 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).- 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).- 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).- 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).- 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).- 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).- 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).- 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).- 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).- 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).- Parameters:
path- The path to the file to be opened.- Returns:
- The file handle object on success.
null on error.
-
closeFile
This method closes an open file within the secure container.- Parameters:
handle- The file handle object to be closed.- Returns:
- True on success. False on failure.
-
setFileLength
This method sets the file length of a file located within the secure container.- Parameters:
handle- The file handle object to be used..- Returns:
- True on success. False on failure.
-
readFromFile
This method reads data from a file located within the secure container.- 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.- 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.- 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.- 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.- 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.- Parameters:
handle- The file handle object to be used.- Returns:
- True on success. False on failure.
-
getSecurePath
String getSecurePath()Return the physical root of the secure container.- Returns:
- The physical path to the secure container.
-
getSecurePrefix
String getSecurePrefix()Return the 'tag' to indicate the file is suitable for decryption.- Returns:
- The secure 'tag' string.
-