| Modifier and Type | Method and Description |
|---|---|
File |
createTempDir(String prefix)
Create a temporary directory in filesystem
|
WritableFile |
newAppendableFile(File file)
Create an WritableFile that either appends to an existing file, or
writes to a new file (if the file does not exist to begin with).
|
Logger |
newLogger(File loggerFile)
Create and return a log file for storing informational messages.
|
RandomInputFile |
newRandomAccessFile(File file)
Create a brand new random access read-only file with the
specified file name.
|
SequentialFile |
newSequentialFile(File file)
Create a brand new sequentially-readable file with the specified file name.
|
WritableFile |
newWritableFile(File file)
Create an object that writes to a new file with the specified
name.
|
long |
nowMicros() |
String |
readFileToString(File file)
Read full file content to string
|
File |
toFile(String filename)
|
DbLock |
tryLock(File lockFile)
Attempts to acquire an exclusive lock on lock file
|
void |
writeStringToFileSync(File file,
String content)
Write
content to file. |
long nowMicros()
File createTempDir(String prefix)
prefix - prefix to use as nameSequentialFile newSequentialFile(File file) throws IOException
IOException - If the file does not exist or inaccessible.RandomInputFile newRandomAccessFile(File file) throws IOException
IOException - If the file does not exist or inaccessible.WritableFile newWritableFile(File file) throws IOException
IOException - If the file not writable.WritableFile newAppendableFile(File file) throws IOException
May return an IsNotSupportedError error if this Env does not allow appending to an existing file. Users of Env (including the leveldb implementation) must be prepared to deal with an Env that does not support appending. TODO
IOException - If the file is inaccessible.void writeStringToFileSync(File file, String content) throws IOException
content to file. Replace existing content.file - file locationcontent - new contentIOException - If the file not writable.String readFileToString(File file) throws IOException
file - file locationIOException - If the file not readable.Logger newLogger(File loggerFile) throws IOException
loggerFile - logger filenull otherwiseIOExceptionDbLock tryLock(File lockFile) throws IOException
lockFile - lock fileIOException - If lock is already held or some other I/O error occursCopyright © 2011–2020. All rights reserved.