Class OpenHandleFactory
java.lang.Object
org.cryptomator.frontend.dokany.adapter.OpenHandleFactory
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclose()Closes all currently open files.voidclose(long handle) Closes the channel identified by the given fileHandlebooleanlonglongopenFile(Path path, OpenOption... options) longopenFile(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) Creates an OpenFile with the given path and options & attributes and assigns a fileHandle != 0 to itlongopenRestrictedFile(Path path) Creates an OpenRestrictedFile with the given path and assigns a fileHandle != 0 to it.
-
Constructor Details
-
OpenHandleFactory
public OpenHandleFactory()
-
-
Method Details
-
openDir
- Parameters:
path-- Returns:
- Throws:
IOException
-
openFile
- Parameters:
path- path of the file to openoptions- file open options- Returns:
- file handle used to identify and close open files.
- Throws:
IOException
-
openFile
public long openFile(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException Creates an OpenFile with the given path and options & attributes and assigns a fileHandle != 0 to it- Parameters:
path- path of the file to openoptions- file open optionsattrs- file attributes to set when opening- Returns:
- file handle used to identify and close open files.
- Throws:
IOException
-
openRestrictedFile
Creates an OpenRestrictedFile with the given path and assigns a fileHandle != 0 to it.- Parameters:
path- path of the file to open- Returns:
- file handle used to identify and close open files.
- Throws:
IOException
-
get
-
exists
-
close
Closes the channel identified by the given fileHandle- Parameters:
handle- file handle used to identify- Throws:
ClosedChannelException- If no channel for the given fileHandle has been found.IOException
-
close
Closes all currently open files. Calling this method will not prevent the factory to open new files, i.e. this method can be called multiple times and is not idempotent.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
areNoHandlesOpen
public boolean areNoHandlesOpen()
-