public class OpenHandleFactory
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
OpenHandleFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes all currently open files.
|
void |
close(long handle)
Closes the channel identified by the given fileHandle
|
OpenHandle |
get(java.lang.Long fileHandle) |
long |
openDir(java.nio.file.Path path) |
long |
openFile(java.nio.file.Path path,
java.nio.file.OpenOption... options) |
long |
openFile(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs)
Creates an Openfile with the given path and options & attributes and assigns a fileHandle != 0 to it
|
public long openDir(java.nio.file.Path path)
path - public long openFile(java.nio.file.Path path,
java.nio.file.OpenOption... options)
throws java.io.IOException
path - path of the file to openoptions - file open optionsjava.io.IOExceptionpublic long openFile(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs)
throws java.io.IOException
path - path of the file to openoptions - file open optionsattrs - file attributes to set when openingjava.io.IOExceptionpublic OpenHandle get(java.lang.Long fileHandle)
public void close(long handle)
throws java.nio.channels.ClosedChannelException,
java.io.IOException
handle - file handle used to identifyjava.nio.channels.ClosedChannelException - If no channel for the given fileHandle has been found.java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2018. All rights reserved.