public abstract class AbstractFileIOChannel extends Object implements FileIOChannel
FileIOChannel.Enumerator, FileIOChannel.ID| Modifier and Type | Field and Description |
|---|---|
protected FileChannel |
fileChannel
A file channel for NIO access to the file.
|
protected FileIOChannel.ID |
id
The ID of the underlying channel.
|
protected static org.slf4j.Logger |
LOG
Logger object for channel and its subclasses
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFileIOChannel(FileIOChannel.ID channelID,
boolean writeEnabled)
Creates a new channel to the path indicated by the given ID.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes the channel.
|
void |
closeAndDelete()
Closes the channel and deletes the underlying file.
|
void |
deleteChannel()
Deletes the file underlying this I/O channel.
|
FileIOChannel.ID |
getChannelID()
Gets the channel ID of this channel.
|
abstract boolean |
isClosed()
Checks whether the channel has been closed.
|
protected static final org.slf4j.Logger LOG
protected final FileIOChannel.ID id
protected final FileChannel fileChannel
protected AbstractFileIOChannel(FileIOChannel.ID channelID, boolean writeEnabled) throws IOException
channelID - The id describing the path of the file that the channel accessed.writeEnabled - Flag describing whether the channel should be opened in read/write mode, rather
than in read-only mode.IOException - Thrown, if the channel could no be opened.public final FileIOChannel.ID getChannelID()
getChannelID in interface FileIOChannelpublic abstract boolean isClosed()
FileIOChannelisClosed in interface FileIOChannelpublic abstract void close()
throws IOException
FileIOChannelclose in interface FileIOChannelIOException - Thrown, if an error occurred while waiting for pending requests.public void deleteChannel()
FileIOChanneldeleteChannel in interface FileIOChannelpublic void closeAndDelete()
throws IOException
FileIOChannelcloseAndDelete in interface FileIOChannelIOException - Thrown, if an error occurred while waiting for pending requests.Copyright © 2015 The Apache Software Foundation. All rights reserved.