| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private FileChannel | fileChannel
The file. |
| private FileLock | fileLock
The file lock. |
| private FileChannel | originalFileChannel
The encrypted file (if encryption is used). |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private static void | |
| public void | |
| public static String | Returns: the corrected file namethe file name f)Fix the file name, replacing backslash with slash. |
| protected long | |
| public int | Returns: priority, bigger number indicate that chunk need to be moved soonerwhere chunk starts block)Overrides org. Calculates relative "priority" for chunk to be moved. |
| private FileLock | |
| public void | open(String
the file name fileName, boolean whether the file should only be opened in read-only mode,
even if the file is writable readOnly, char[] the encryption key, or null if encryption is not encryptionKey)Implements abstract org. Try to open the file. |
| public SingleFileStore | |
| private void | |
| public ByteBuffer | readFully(SFChunk
that owns data to be read chunk, long the read "position" pos, int the number of bytes to read len)Implements abstract org. Read data from the store. |
| public void | |
| public String | |
| public void | truncate(long
the new file size size)Implements abstract org. Truncate the file. |
| protected void | writeFully(SFChunk
to write chunk, long the write position pos, ByteBuffer the source buffer src)Implements abstract org. Write to the file. |
| config | back to summary |
|---|---|
| private final Map<String, Object> config | |
| fileChannel | back to summary |
|---|---|
| private FileChannel fileChannel The file. | |
| fileLock | back to summary |
|---|---|
| private FileLock fileLock The file lock. | |
| originalFileChannel | back to summary |
|---|---|
| private FileChannel originalFileChannel The encrypted file (if encryption is used). | |
| SingleFileStore | back to summary |
|---|---|
| public SingleFileStore(Map<String, Object> config) | |
| backup | back to summary |
|---|---|
| public void backup(ZipOutputStream out) throws IOException Implements abstract org.
| |
| backupFile | back to summary |
|---|---|
| private static void backupFile(ZipOutputStream out, String fileName, FileChannel in) throws IOException | |
| close | back to summary |
|---|---|
| public void close() Overrides org. Close this store.
| |
| correctFileName | back to summary |
|---|---|
| public static String correctFileName(String f) Fix the file name, replacing backslash with slash. | |
| getAfterLastBlock_ | back to summary |
|---|---|
| protected long getAfterLastBlock_() Overrides org.
| |
| getMovePriority | back to summary |
|---|---|
| public int getMovePriority(int block) Overrides org. Calculates relative "priority" for chunk to be moved.
| |
| lockFileChannel | back to summary |
|---|---|
| private FileLock lockFileChannel(FileChannel fileChannel, boolean readOnly, String fileName) throws IOException | |
| open | back to summary |
|---|---|
| public void open(String fileName, boolean readOnly, char[] encryptionKey) Implements abstract org. Try to open the file. | |
| open | back to summary |
|---|---|
| public SingleFileStore open(String fileName, boolean readOnly) Implements abstract org.
| |
| open | back to summary |
|---|---|
| private void open(String fileName, boolean readOnly, Function<FileChannel, FileChannel> encryptionTransformer) | |
| readFully | back to summary |
|---|---|
| public ByteBuffer readFully(SFChunk chunk, long pos, int len) Implements abstract org. Doc from org. Read data from the store.
| |
| sync | back to summary |
|---|---|
| public void sync() Overrides org. Flush all changes.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| truncate | back to summary |
|---|---|
| public void truncate(long size) Implements abstract org. Truncate the file.
| |
| writeFully | back to summary |
|---|---|
| protected void writeFully(SFChunk chunk, long pos, ByteBuffer src) Implements abstract org. Doc from org. Write to the file.
| |