Interface ISqlJetFileSystem
-
- All Known Implementing Classes:
SqlJetFileSystem
public interface ISqlJetFileSystemFile System Interface. An instance of theISqlJetFileSystemobject defines the interface between the SqlJet core and the underlying file system. The randomness(), sleep(), and currentTime() interfaces are not strictly a part of the filesystem, but they are included in theISqlJetFileSystemstructure for completeness.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccess(java.io.File path, SqlJetFileAccesPermission permission)The flags argument to access() may beSqlJetFileAccesPermission.EXISTSto test for the existence of a file, orSqlJetFileAccesPermission.READWRITEto test whether a file is readable and writable, orSqlJetFileAccesPermission#READto test whether a file is at least readable.longcurrentTime()The currentTime() method returns a Julian Day Number for the current date and time.booleandelete(java.io.File path, boolean sync)Delete the file.java.lang.StringgetFullPath(java.io.File filename)java.lang.StringgetName()The getName() returns the name of the FS module.java.io.FilegetTempFile()ISqlJetFilememJournalOpen()Open a memory journal file.ISqlJetFileopen(java.io.File path, SqlJetFileType type, java.util.Set<SqlJetFileOpenPermission> permissions)The flags argument to open() includes all set in the flags argument to ISqlJet.open().byte[]randomness(int numBytes)The randomness() function returns numBytes bytes of good-quality randomness.longsleep(long microseconds)The sleep() method causes the calling thread to sleep for at least the number of microseconds given.
-
-
-
Method Detail
-
getName
java.lang.String getName()
The getName() returns the name of the FS module. The name must be unique across all FS modules.- Returns:
-
open
ISqlJetFile open(java.io.File path, SqlJetFileType type, java.util.Set<SqlJetFileOpenPermission> permissions) throws SqlJetException
The flags argument to open() includes all set in the flags argument to ISqlJet.open(). Flags includes at leastSqlJetFileOpenPermission.READWRITEandSqlJetFileOpenPermission.CREATE. If open() opens a file read-only then it sets flags inISqlJetFile.getPermissions()to includeSqlJetFileOpenPermission.READONLY. Other permissions may be set. SqlJet will also add one of the following flags to the open() call, depending on the object being opened:-
SqlJetFileOpenPermission#MAIN_DB -
SqlJetFileOpenPermission#MAIN_JOURNAL -
SqlJetFileOpenPermission#TEMP_DB -
SqlJetFileOpenPermission#TEMP_JOURNAL -
SqlJetFileOpenPermission#TRANSIENT_DB -
SqlJetFileOpenPermission#SUBJOURNAL -
SqlJetFileOpenPermission#MASTER_JOURNAL
SqlJetIOException. Or the implementation might recognize that a database file will be doing page-aligned sector reads and writes in a random order and set up its I/O subsystem accordingly. SqlJet might also add one of the following flags to the open() method: TheSqlJetFileOpenPermission.DELETEONCLOSEflag means the file should be deleted when it is closed. TheSqlJetFileOpenPermission.DELETEONCLOSEwill be set for TEMP databases, journals and for subjournals. TheSqlJetFileOpenPermission.EXCLUSIVEflag means the file should be opened for exclusive access. This flag is set for all files except for the main database file.- Parameters:
path-Fileor NULL. If NULL then open() must invite its own temporary name for the file. Whenever the filename parameter is NULL it will also be the case that the flags parameter will includeSqlJetFileOpenPermission.DELETEONCLOSE.permissions- Exactly one of theSqlJetFileOpenPermission.READWRITEandSqlJetFileOpenPermission.READONLYflags must be set, and ifSqlJetFileOpenPermission.CREATEis set, thenSqlJetFileOpenPermission.READWRITEmust also be set, and ifSqlJetFileOpenPermission.EXCLUSIVEis set, thenSqlJetFileOpenPermission.CREATEmust also be set. ifSqlJetFileOpenPermission.DELETEONCLOSEis set, thenSqlJetFileOpenPermission.CREATEmust also be set.- Returns:
- Opened file.
- Throws:
SqlJetException- If it is impossible to open file.
-
-
memJournalOpen
ISqlJetFile memJournalOpen()
Open a memory journal file.
-
delete
boolean delete(java.io.File path, boolean sync) throws SqlJetExceptionDelete the file. If the sync argument is true, sync() the directory after deleting the file.- Parameters:
path-sync-- Returns:
- Throws:
SqlJetException
-
access
boolean access(java.io.File path, SqlJetFileAccesPermission permission) throws SqlJetExceptionThe flags argument to access() may beSqlJetFileAccesPermission.EXISTSto test for the existence of a file, orSqlJetFileAccesPermission.READWRITEto test whether a file is readable and writable, orSqlJetFileAccesPermission#READto test whether a file is at least readable. The file can be a directory. Test the existance of or access permissions of file. The test performed depends on the value of flags:SqlJetFileAccesPermission.EXISTS: Return true if the file existsSqlJetFileAccesPermission.READWRITE: Return true if the file is read and writable.SqlJetFileAccesPermission#READ: Return true if the file is readable. Otherwise return false.- Parameters:
path-permission-- Returns:
- Throws:
SqlJetException
-
randomness
byte[] randomness(int numBytes)
The randomness() function returns numBytes bytes of good-quality randomness.- Parameters:
numBytes-- Returns:
-
sleep
long sleep(long microseconds)
The sleep() method causes the calling thread to sleep for at least the number of microseconds given.- Parameters:
microseconds-- Returns:
-
currentTime
long currentTime()
The currentTime() method returns a Julian Day Number for the current date and time.- Returns:
-
getTempFile
java.io.File getTempFile() throws java.io.IOException- Throws:
java.io.IOException
-
getFullPath
java.lang.String getFullPath(java.io.File filename) throws SqlJetException- Throws:
SqlJetException
-
-