M - The type of the file system model.C - The type of the decorated file system controller.@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public abstract class FsDecoratingController<M extends FsModel,C extends FsController<? extends M>> extends FsController<M>
| Modifier and Type | Field and Description |
|---|---|
protected C |
delegate
The decorated file system controller.
|
private M |
model |
| Modifier | Constructor and Description |
|---|---|
protected |
FsDecoratingController(C controller)
Constructs a new decorating 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.
|
M |
getModel()
Returns the file system model.
|
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.
|
FsController<?> |
getParent()
Returns the controller for the parent file system or
null if
and only if this file system is not federated, i.e. not a member of
another file system. |
boolean |
isReadable(FsEntryName name) |
boolean |
isReadOnly() |
boolean |
isWritable(FsEntryName name) |
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. |
void |
setReadOnly(FsEntryName name) |
boolean |
setTime(FsEntryName name,
BitField<Entry.Access> types,
long value)
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.
|
<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.
|
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
void |
unlink(FsEntryName name) |
equals, hashCode, syncprotected final C extends FsController<? extends M> delegate
protected FsDecoratingController(C controller)
controller - the decorated file system controller.public final M getModel()
FsControllergetModel in class FsController<M extends FsModel>public FsController<?> getParent()
FsControllernull if
and only if this file system is not federated, i.e. not a member of
another file system.getParent in class FsController<M extends FsModel>public Icon getOpenIcon() throws IOException
getOpenIcon in class FsController<M extends FsModel>IOExceptionpublic Icon getClosedIcon() throws IOException
getClosedIcon in class FsController<M extends FsModel>IOExceptionpublic boolean isReadOnly()
throws IOException
isReadOnly in class FsController<M extends FsModel>IOExceptionpublic FsEntry getEntry(FsEntryName name) throws IOException
FsControllernull if no file system entry
exists for the given name.
Modifying the returned object graph is either not supported (i.e. throws
an UnsupportedOperationException) or does not show any
effect on the file system.getEntry in class FsController<M extends FsModel>name - the name of the file system entry to look up.null if no file system entry
exists for the given name.IOException - on any I/O error.public boolean isReadable(FsEntryName name) throws IOException
isReadable in class FsController<M extends FsModel>IOExceptionpublic boolean isWritable(FsEntryName name) throws IOException
isWritable in class FsController<M extends FsModel>IOExceptionpublic void setReadOnly(FsEntryName name) throws IOException
setReadOnly in class FsController<M extends FsModel>IOExceptionpublic boolean setTime(FsEntryName name, BitField<Entry.Access> types, long value) throws IOException
FsControllerfalse is returned or an IOException is thrown, then
still some of the last access times may have been set.
In other words, this is not an atomic operation if multiple access types
are given.
To make this operation atomic, set the last access time for a single
type only.setTime in class FsController<M extends FsModel>name - the file system entry name.types - the access typesvalue - 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 InputSocket<?> getInputSocket(FsEntryName name, BitField<FsInputOption> options)
FsControllergetInputSocket in class FsController<M extends FsModel>name - the file system entry name.options - the input options.InputSocket.public 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 FsController<M extends FsModel>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 void mknod(FsEntryName name, Entry.Type type, BitField<FsOutputOption> options, Entry template) throws IOException
FsControllername into the file system.mknod in class FsController<M extends FsModel>name - the file system entry name.type - the file system entry type.options - the file system output options.
If CREATE_PARENTS is set, any missing parent directories
will be created and linked into this 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.
public void unlink(FsEntryName name) throws IOException
unlink in class FsController<M extends FsModel>IOExceptionpublic <X extends IOException> void sync(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
FsControllersync in class FsController<M extends FsModel>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 String toString()
toString in class FsController<M extends FsModel>Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.