Package org.cryptomator.frontend.fuse
Class ReadWriteFileHandler
java.lang.Object
org.cryptomator.frontend.fuse.ReadOnlyFileHandler
org.cryptomator.frontend.fuse.ReadWriteFileHandler
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
Fields inherited from class org.cryptomator.frontend.fuse.ReadOnlyFileHandler
openFiles -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateAndOpen(Path path, org.cryptomator.jfuse.api.FileInfo fi, FileAttribute<?>... attrs) voidfsync(org.cryptomator.jfuse.api.FileInfo fi, boolean metaData) fsyncvoidftruncate(long size, org.cryptomator.jfuse.api.FileInfo fi) ftruncateintgetattr(Path node, BasicFileAttributes attrs, org.cryptomator.jfuse.api.Stat stat) protected longopen(Path path, Set<StandardOpenOption> openOptions) voidvoidutimens(Path node, org.cryptomator.jfuse.api.TimeSpec mTimeSpec, org.cryptomator.jfuse.api.TimeSpec aTimeSpec) intwrite(ByteBuffer buf, long size, long offset, org.cryptomator.jfuse.api.FileInfo fi) Writes up tosizebytes frombufbeginning atoffsetinto the current fileMethods inherited from class org.cryptomator.frontend.fuse.ReadOnlyFileHandler
close, open, read, release
-
Constructor Details
-
ReadWriteFileHandler
-
-
Method Details
-
getattr
- Overrides:
getattrin classReadOnlyFileHandler
-
createAndOpen
public void createAndOpen(Path path, org.cryptomator.jfuse.api.FileInfo fi, FileAttribute<?>... attrs) throws IOException - Throws:
IOException
-
open
- Overrides:
openin classReadOnlyFileHandler- Parameters:
path- path of the file to openopenOptions- file open options- Returns:
- file handle used to identify and close open files.
- Throws:
IOException
-
write
public int write(ByteBuffer buf, long size, long offset, org.cryptomator.jfuse.api.FileInfo fi) throws IOException Writes up tosizebytes frombufbeginning atoffsetinto the current file- Parameters:
buf- Buffersize- Number of bytes to writeoffset- Position of first byte to write atfi- contains the file handle- Returns:
- Actual number of bytes written
- Throws:
ClosedChannelException- If no open file could be found for the given file handleIOException- If an exception occurs during write.
-
fsync
fsync- Parameters:
fi- contains the file handlemetaData- fsync metadata- Throws:
ClosedChannelException- If no open file could be found for the given file handleIOException- If an exception occurs during write.
-
truncate
- Throws:
IOException
-
ftruncate
ftruncate- Parameters:
size- target sizefi- contains the file handle- Throws:
ClosedChannelException- If no open file could be found for the given file handleIOException- If an exception occurs during write.
-
utimens
public void utimens(Path node, org.cryptomator.jfuse.api.TimeSpec mTimeSpec, org.cryptomator.jfuse.api.TimeSpec aTimeSpec) throws IOException - Throws:
IOException
-