Package org.cryptomator.frontend.fuse
Class ReadOnlyFileHandler
java.lang.Object
org.cryptomator.frontend.fuse.ReadOnlyFileHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intgetattr(Path node, BasicFileAttributes attrs, org.cryptomator.jfuse.api.Stat stat) protected longopen(Path path, Set<StandardOpenOption> openOptions) voidintread(ByteBuffer buf, long size, long offset, org.cryptomator.jfuse.api.FileInfo fi) Reads up tonumbytes beginning atoffsetintobufvoidrelease(org.cryptomator.jfuse.api.FileInfo fi) Closes the channel identified by the given fileHandle
-
Field Details
-
openFiles
-
-
Constructor Details
-
ReadOnlyFileHandler
-
-
Method Details
-
open
- Throws:
IOException
-
open
protected long open(Path path, Set<StandardOpenOption> openOptions) throws AccessDeniedException, IOException - Parameters:
path- path of the file to openopenOptions- file open options- Returns:
- file handle used to identify and close open files.
- Throws:
AccessDeniedException- Thrown if the requested openOptions are not supportedIOException
-
read
public int read(ByteBuffer buf, long size, long offset, org.cryptomator.jfuse.api.FileInfo fi) throws IOException Reads up tonumbytes beginning atoffsetintobuf- Parameters:
buf- Buffersize- Number of bytes to readoffset- Position of first byte to readfi- contains the file handle- Returns:
- Actual number of bytes read (can be less than
sizeif reached EOF). - Throws:
ClosedChannelException- If no open file could be found for the given file handleIOException
-
release
Closes the channel identified by the given fileHandle- Parameters:
fi- contains the file handle- Throws:
ClosedChannelException- If no channel for the given fileHandle has been found.IOException
-
getattr
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-