java.lang.Object
org.cryptomator.frontend.fuse.ReadOnlyAdapter
- All Implemented Interfaces:
AutoCloseable,FuseNioAdapter,org.cryptomator.jfuse.api.FuseOperations
- Direct Known Subclasses:
ReadWriteAdapter
public sealed class ReadOnlyAdapter
extends Object
implements FuseNioAdapter
permits ReadWriteAdapter
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cryptomator.jfuse.api.FuseOperations
org.cryptomator.jfuse.api.FuseOperations.Operation -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final org.cryptomator.jfuse.api.Errnoprotected final FileNameTranscoderprotected final FileStoreprotected final LockManagerprotected final OpenFileFactoryprotected final PathFields inherited from interface org.cryptomator.frontend.fuse.FuseNioAdapter
DEFAULT_MAX_FILENAMELENGTHFields inherited from interface org.cryptomator.jfuse.api.FuseOperations
FUSE_READDIR_PLUS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedReadOnlyAdapter(org.cryptomator.jfuse.api.Errno errno, Path root, int maxFileNameLength, FileNameTranscoder fileNameTranscoder, FileStore fileStore, OpenFileFactory openFiles, ReadOnlyDirectoryHandler dirHandler, ReadOnlyFileHandler fileHandler, boolean enableXattr) -
Method Summary
Modifier and TypeMethodDescriptionintprotected intcheckAccess(Path path, Set<AccessMode> requiredAccessModes) protected intcheckAccess(Path path, Set<AccessMode> requiredAccessModes, Set<AccessMode> deniedAccessModes) voidclose()static ReadOnlyAdaptercreate(org.cryptomator.jfuse.api.Errno errno, Path root, int maxFileNameLength, FileNameTranscoder fileNameTranscoder, boolean enableXattr) voiddestroy()org.cryptomator.jfuse.api.Errnoerrno()intprotected intAttempts to get a specific error code that best describes the given exception.intgetxattr(String path, String name, ByteBuffer value) booleanisInUse()Checks if the filesystem is in use (and therefore an unmount attempt should be avoided).intlistxattr(String path, ByteBuffer list) intintintread(String path, ByteBuffer buf, long size, long offset, org.cryptomator.jfuse.api.FileInfo fi) intreaddir(String path, org.cryptomator.jfuse.api.DirFiller filler, long offset, org.cryptomator.jfuse.api.FileInfo fi, int flags) intreadlink(String path, ByteBuffer buf, long size) intintreleasedir(String path, org.cryptomator.jfuse.api.FileInfo fi) protected PathresolvePath(String absolutePath) intSet<org.cryptomator.jfuse.api.FuseOperations.Operation> Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cryptomator.jfuse.api.FuseOperations
chmod, chown, create, fallocate, flock, flush, fsync, fsyncdir, init, ioctl, link, mkdir, mknod, removexattr, rename, rmdir, setxattr, symlink, truncate, unlink, utimens, write
-
Field Details
-
errno
protected final org.cryptomator.jfuse.api.Errno errno -
root
-
fileStore
-
enableXattr
protected final boolean enableXattr -
lockManager
-
openFiles
-
fileNameTranscoder
-
-
Constructor Details
-
ReadOnlyAdapter
protected ReadOnlyAdapter(org.cryptomator.jfuse.api.Errno errno, Path root, int maxFileNameLength, FileNameTranscoder fileNameTranscoder, FileStore fileStore, OpenFileFactory openFiles, ReadOnlyDirectoryHandler dirHandler, ReadOnlyFileHandler fileHandler, boolean enableXattr)
-
-
Method Details
-
create
public static ReadOnlyAdapter create(org.cryptomator.jfuse.api.Errno errno, Path root, int maxFileNameLength, FileNameTranscoder fileNameTranscoder, boolean enableXattr) -
errno
public org.cryptomator.jfuse.api.Errno errno()- Specified by:
errnoin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
supportedOperations
- Specified by:
supportedOperationsin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
resolvePath
-
statfs
- Specified by:
statfsin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
access
- Specified by:
accessin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
checkAccess
-
checkAccess
protected int checkAccess(Path path, Set<AccessMode> requiredAccessModes, Set<AccessMode> deniedAccessModes) -
readlink
- Specified by:
readlinkin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
getattr
public int getattr(String path, org.cryptomator.jfuse.api.Stat stat, org.cryptomator.jfuse.api.FileInfo fi) - Specified by:
getattrin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
getxattr
- Specified by:
getxattrin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
listxattr
- Specified by:
listxattrin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
opendir
- Specified by:
opendirin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
readdir
public int readdir(String path, org.cryptomator.jfuse.api.DirFiller filler, long offset, org.cryptomator.jfuse.api.FileInfo fi, int flags) - Specified by:
readdirin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
releasedir
- Specified by:
releasedirin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
open
- Specified by:
openin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
read
public int read(String path, ByteBuffer buf, long size, long offset, org.cryptomator.jfuse.api.FileInfo fi) - Specified by:
readin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
release
- Specified by:
releasein interfaceorg.cryptomator.jfuse.api.FuseOperations
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.cryptomator.jfuse.api.FuseOperations
-
isInUse
public boolean isInUse()Description copied from interface:FuseNioAdapterChecks if the filesystem is in use (and therefore an unmount attempt should be avoided).Important: This function only checks, like the name suggests, if the filesystem is busy and used. A return value of
falseshould not be considered as an unmount can be safely and successfully executed and thus an unmount may fail.API note: It is the task of the fs developer to decide what "in use" means. For example, "in use" can mean there are open resources or pending operations. Additionally no guarantees about the validity of the result after the call is made, i.e. the result may be immediately outdated.
- Specified by:
isInUsein interfaceFuseNioAdapter- Returns:
- true if the filesystem is in use
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceFuseNioAdapter- Throws:
IOException
-
getErrorCodeForGenericFileSystemException
Attempts to get a specific error code that best describes the given exception. As a side effect this logs the error.- Parameters:
e- An exceptionopDesc- A human-friendly string describing what operation was attempted (for logging purposes)- Returns:
- A specific error code or -EIO.
-