@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsConcurrentController extends FsDecoratingConcurrentModelController<FsController<? extends FsConcurrentModel>>
FsConcurrentModel,
FsNotWriteLockedException| Modifier and Type | Class and Description |
|---|---|
private class |
FsConcurrentController.ConcurrentInputStream |
private class |
FsConcurrentController.ConcurrentOutputStream |
private class |
FsConcurrentController.ConcurrentReadOnlyFile |
private class |
FsConcurrentController.ConcurrentSeekableByteChannel |
private static class |
FsConcurrentController.ConcurrentSocketFactory |
private class |
FsConcurrentController.Input |
private class |
FsConcurrentController.Nio2Input |
private class |
FsConcurrentController.Nio2Output |
private class |
FsConcurrentController.Output |
| Modifier and Type | Field and Description |
|---|---|
private static FsConcurrentController.ConcurrentSocketFactory |
CONCURRENT_SOCKET_FACTORY |
private ReentrantReadWriteLock.ReadLock |
readLock |
private ReentrantReadWriteLock.WriteLock |
writeLock |
delegate| Constructor and Description |
|---|
FsConcurrentController(FsController<? extends FsConcurrentModel> controller)
Constructs a new concurrent file system controller.
|
| Modifier and Type | Method and Description |
|---|---|
Icon |
getClosedIcon() |
FsEntry |
getEntry(FsEntryName name)
Returns a file system entry or
null if no file system entry
exists for the given name. |
InputSocket<?> |
getInputSocket(FsEntryName name,
BitField<FsInputOption> options)
Returns an input socket for reading the contents of the file system
entry addressed by the given name from the file system.
|
Icon |
getOpenIcon() |
OutputSocket<?> |
getOutputSocket(FsEntryName name,
BitField<FsOutputOption> options,
Entry template)
Returns an output socket for writing the contents of the entry addressed
by the given name to the file system.
|
boolean |
isReadable(FsEntryName name)
Returns
false if the named file system entry is not readable. |
boolean |
isReadOnly()
Returns
true if and only if the file system is read-only. |
boolean |
isWritable(FsEntryName name)
Returns
false if the named file system entry is not writable. |
void |
mknod(FsEntryName name,
Entry.Type type,
BitField<FsOutputOption> options,
Entry template)
Creates or replaces and finally links a chain of one or more entries
for the given entry
name into the file system. |
protected ReentrantReadWriteLock.ReadLock |
readLock() |
void |
setReadOnly(FsEntryName name) |
boolean |
setTime(FsEntryName name,
BitField<Entry.Access> types,
long value,
BitField<FsOutputOption> options)
Makes an attempt to set the last access time of all types in the given
bit field for the file system entry with the given name.
|
boolean |
setTime(FsEntryName name,
Map<Entry.Access,Long> times,
BitField<FsOutputOption> options)
Makes an attempt to set the last access time of all types in the given
map for the file system entry with the given name.
|
<X extends IOException> |
sync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
Commits all unsynchronized changes to the contents of this file system
to its parent file system,
releases the associated resources (e.g. target archive files) for
access by third parties (e.g. other processes), cleans up any temporary
allocated resources (e.g. temporary files) and purges any cached data.
|
void |
unlink(FsEntryName name,
BitField<FsOutputOption> options)
Removes the named file system entry from the file system.
|
protected ReentrantReadWriteLock.WriteLock |
writeLock() |
assertNotReadLockedByCurrentThread, assertWriteLockedByCurrentThread, isWriteLockedByCurrentThreadgetParent, isExecutable, toStringgetModel, getMountPoint, isTouched, setTouchedequals, hashCode, syncprivate static final FsConcurrentController.ConcurrentSocketFactory CONCURRENT_SOCKET_FACTORY
@CheckForNull private volatile ReentrantReadWriteLock.ReadLock readLock
@CheckForNull private volatile ReentrantReadWriteLock.WriteLock writeLock
public FsConcurrentController(FsController<? extends FsConcurrentModel> controller)
controller - the decorated concurrent file system controller.public Icon getClosedIcon() throws IOException
getClosedIcon in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>IOExceptionpublic FsEntry getEntry(FsEntryName name) throws IOException
FsControllernull if no file system entry
exists for the given name.
Modifying the returned object is either not supported (i.e. throws an
UnsupportedOperationException) or does not show any effect on
the file system.getEntry in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the name of the file system entry.null if no file system entry
exists for the given name.IOException - on any I/O error.public InputSocket<?> getInputSocket(FsEntryName name, BitField<FsInputOption> options)
FsControllergetInputSocket in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.options - the input options.InputSocket.public Icon getOpenIcon() throws IOException
getOpenIcon in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>IOExceptionpublic OutputSocket<?> getOutputSocket(FsEntryName name, BitField<FsOutputOption> options, Entry template)
FsControllertemplate is not null, then the output entry shall
have as many of its properties copied as reasonable, e.g. the last
modification time.getOutputSocket in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - a file system entry name.options - a bit field of output options.template - a nullable template for the properties of the output
entry.OutputSocket.public boolean isReadable(FsEntryName name) throws IOException
FsControllerfalse if the named file system entry is not readable.isReadable in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the name of the file system entry.false if the named file system entry is not readable.IOException - On any I/O error.public boolean isReadOnly()
throws IOException
FsControllertrue if and only if the file system is read-only.isReadOnly in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>true if and only if the file system is read-only.IOException - on any I/O error.public boolean isWritable(FsEntryName name) throws IOException
FsControllerfalse if the named file system entry is not writable.isWritable in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the name of the file system entry.false if the named file system entry is not writable.IOException - On any I/O error.public void mknod(@NonNull FsEntryName name, @NonNull Entry.Type type, @NonNull BitField<FsOutputOption> options, @CheckForNull Entry template) throws IOException
FsControllername into the file system.mknod in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.type - the file system entry type.options - the file system output options.
If FsOutputOption.CREATE_PARENTS is set, any missing
parent directories will be created and linked into the file
system with its last modification time set to the system's
current time.template - if not null, then the file system entry
at the end of the chain shall inherit as much properties from
this entry as possible - with the exception of its name and type.IOException - on any I/O error, including but not limited to these
reasons:
name contains characters which are not
supported by the file system.
FsOutputOption.EXCLUSIVE is set or the entry is a
directory.
createParents is
false.
protected ReentrantReadWriteLock.ReadLock readLock()
readLock in class FsDecoratingConcurrentModelController<FsController<? extends FsConcurrentModel>>public void setReadOnly(FsEntryName name) throws IOException
setReadOnly in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>IOExceptionpublic boolean setTime(FsEntryName name, BitField<Entry.Access> types, long value, BitField<FsOutputOption> options) throws IOException
FsControllerfalse is returned or an IOException is thrown, then
still some of the last access times may have been set.
Whether or not this is an atomic operation is specific to the
implementation.setTime in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.types - the access types.value - the last access time.true if and only if setting the access time for all
types in types succeeded.IOException - on any I/O error.public boolean setTime(FsEntryName name, Map<Entry.Access,Long> times, BitField<FsOutputOption> options) throws IOException
FsControllerfalse is returned or an IOException is thrown, then
still some of the last access times may have been set.
Whether or not this is an atomic operation is specific to the
implementation.setTime in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.times - the access times.true if and only if setting the access time for all
types in times succeeded.IOException - on any I/O error.public <X extends IOException> void sync(@NonNull BitField<FsSyncOption> options, @NonNull ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
FsControllersync in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>X - The type of the IOException to throw at the
discretion of the exception handler.options - a bit field of synchronization options.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.X extends IOExceptionpublic void unlink(FsEntryName name, BitField<FsOutputOption> options) throws IOException
FsControllerunlink in class FsDecoratingController<FsConcurrentModel,FsController<? extends FsConcurrentModel>>name - the file system entry name.options - output options for this operation.IOException - On any I/O error.protected ReentrantReadWriteLock.WriteLock writeLock()
writeLock in class FsDecoratingConcurrentModelController<FsController<? extends FsConcurrentModel>>Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.