Class SqlJetFileSystem
java.lang.Object
org.tmatesoft.sqljet.core.internal.fs.SqlJetFileSystem
- All Implemented Interfaces:
ISqlJetFileSystem
Default implementation of ISqlJetFileSystem.
- Author:
- TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccess(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, orto test whether a file is at least readable.invalid reference
SqlJetFileAccesPermission#READlongThe currentTime() method returns a Julian Day Number for the current date and time.booleanDelete the file.getFullPath(File filename) getName()The getName() returns the name of the FS module.Open a memory journal file.open(File path, SqlJetFileType type, 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.
-
Field Details
-
FS_NAME
-
-
Constructor Details
-
SqlJetFileSystem
public SqlJetFileSystem()
-
-
Method Details
-
getName
Description copied from interface:ISqlJetFileSystemThe getName() returns the name of the FS module. The name must be unique across all FS modules.- Specified by:
getNamein interfaceISqlJetFileSystem- Returns:
-
open
public ISqlJetFile open(File path, SqlJetFileType type, Set<SqlJetFileOpenPermission> permissions) throws SqlJetException Description copied from interface:ISqlJetFileSystemThe 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:-
invalid reference
SqlJetFileOpenPermission#MAIN_DB -
invalid reference
SqlJetFileOpenPermission#MAIN_JOURNAL -
invalid reference
SqlJetFileOpenPermission#TEMP_DB -
invalid reference
SqlJetFileOpenPermission#TEMP_JOURNAL -
invalid reference
SqlJetFileOpenPermission#TRANSIENT_DB -
invalid reference
SqlJetFileOpenPermission#SUBJOURNAL -
invalid reference
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.- Specified by:
openin interfaceISqlJetFileSystem- 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.
-
-
getTempFile
- Specified by:
getTempFilein interfaceISqlJetFileSystem- Returns:
- Throws:
IOException
-
delete
Description copied from interface:ISqlJetFileSystemDelete the file. If the sync argument is true, sync() the directory after deleting the file.- Specified by:
deletein interfaceISqlJetFileSystem- Parameters:
path-sync-- Returns:
-
access
Description copied from interface:ISqlJetFileSystemThe flags argument to access() may beSqlJetFileAccesPermission.EXISTSto test for the existence of a file, orSqlJetFileAccesPermission.READWRITEto test whether a file is readable and writable, orto 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:invalid reference
SqlJetFileAccesPermission#READSqlJetFileAccesPermission.EXISTS: Return true if the file existsSqlJetFileAccesPermission.READWRITE: Return true if the file is read and writable.: Return true if the file is readable. Otherwise return false.invalid reference
SqlJetFileAccesPermission#READ- Specified by:
accessin interfaceISqlJetFileSystem- Parameters:
path-permission-- Returns:
- Throws:
SqlJetException
-
currentTime
public long currentTime()Description copied from interface:ISqlJetFileSystemThe currentTime() method returns a Julian Day Number for the current date and time.- Specified by:
currentTimein interfaceISqlJetFileSystem- Returns:
-
randomness
public byte[] randomness(int numBytes) Description copied from interface:ISqlJetFileSystemThe randomness() function returns numBytes bytes of good-quality randomness.- Specified by:
randomnessin interfaceISqlJetFileSystem- Parameters:
numBytes-- Returns:
-
sleep
public long sleep(long microseconds) Description copied from interface:ISqlJetFileSystemThe sleep() method causes the calling thread to sleep for at least the number of microseconds given.- Specified by:
sleepin interfaceISqlJetFileSystem- Parameters:
microseconds-- Returns:
-
memJournalOpen
Description copied from interface:ISqlJetFileSystemOpen a memory journal file.- Specified by:
memJournalOpenin interfaceISqlJetFileSystem
-
getFullPath
- Specified by:
getFullPathin interfaceISqlJetFileSystem- Throws:
SqlJetException
-