@ThreadSafe public abstract class FsDecoratingController extends FsAbstractController
FsController.Factory<Context>
Modifier and Type | Field and Description |
---|---|
protected FsController |
controller
The decorated file system controller.
|
Modifier | Constructor and Description |
---|---|
protected |
FsDecoratingController(FsController controller) |
Modifier and Type | Method and Description |
---|---|
void |
checkAccess(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name,
net.java.truecommons.shed.BitField<net.java.truecommons.cio.Entry.Access> types)
Checks if the file system node for the given
name exists when
constrained by the given access options and permits the given
access types . |
FsController |
getParent()
Returns the controller for the parent file system or
null if
and only if this file system is not federated, i.e. |
net.java.truecommons.cio.InputSocket<? extends net.java.truecommons.cio.Entry> |
input(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name)
Returns an input socket for reading the contents of the file system
node addressed by the given name from the file system.
|
void |
make(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name,
net.java.truecommons.cio.Entry.Type type,
net.java.truecommons.cio.Entry template)
Creates or replaces and finally links a chain of one or more entries
for the given node
name into the file system. |
FsNode |
node(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name)
Returns the file system node for the given
name or null
if it doesn't exist. |
net.java.truecommons.cio.OutputSocket<? extends net.java.truecommons.cio.Entry> |
output(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name,
net.java.truecommons.cio.Entry template)
Returns an output socket for writing the contents of the node addressed
by the given name to the file system.
|
void |
setReadOnly(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name)
Sets the named file system node as read-only.
|
boolean |
setTime(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name,
net.java.truecommons.shed.BitField<net.java.truecommons.cio.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 node with the given name.
|
boolean |
setTime(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name,
Map<net.java.truecommons.cio.Entry.Access,Long> times)
Makes an attempt to set the last access time of all types in the given
map for the file system node with the given name.
|
void |
sync(net.java.truecommons.shed.BitField<FsSyncOption> options)
Commits all unsynchronized changes to the contents of this file system
to its parent file system,
releases the associated resources (e.g.
|
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
void |
unlink(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsNodeName name)
Removes the named file system node from the file system.
|
getModel, getMountPoint, isMounted, setMounted
protected final FsController controller
protected FsDecoratingController(FsController controller)
public void checkAccess(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name, net.java.truecommons.shed.BitField<net.java.truecommons.cio.Entry.Access> types) throws IOException
FsController
name
exists when
constrained by the given access options
and permits the given
access types
.options
- the options for accessing the file system node.name
- the name of the file system node.types
- the types of the desired access.IOException
- on any I/O error.public FsController getParent()
FsController
null
if
and only if this file system is not federated, i.e. not a member of
another file system.
Multiple invocations must return the same object.public net.java.truecommons.cio.InputSocket<? extends net.java.truecommons.cio.Entry> input(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name)
FsController
options
- the options for accessing the file system node.name
- the name of the file system node.InputSocket
.public void make(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name, net.java.truecommons.cio.Entry.Type type, @CheckForNull net.java.truecommons.cio.Entry template) throws IOException
FsController
name
into the file system.options
- the options for accessing the file system node.
If FsAccessOption.CREATE_PARENTS
is set, any missing
parent directories shall get created with an undefined last
modification time.name
- the name of the file system node.type
- the file system node type.template
- if not null
, then the file system node
at the end of the chain shall inherit as much properties from
this node 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.
FsAccessOption.EXCLUSIVE
is set or the node is a
directory.
createParents
is
false
.
@CheckForNull public FsNode node(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name) throws IOException
FsController
name
or null
if it doesn't exist.
Modifying the returned node does not show any effect on the file system
and should result in an UnsupportedOperationException
.options
- the options for accessing the file system node.name
- the name of the file system node.null
if no file system node
exists for the given name.IOException
- on any I/O error.public net.java.truecommons.cio.OutputSocket<? extends net.java.truecommons.cio.Entry> output(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name, @CheckForNull net.java.truecommons.cio.Entry template)
FsController
options
- the options for accessing the file system node.
If FsAccessOption.CREATE_PARENTS
is set, any missing
parent directories shall get created with an undefined last
modification time.name
- the name of the file system node.template
- if not null
, then the file system node
at the end of the chain shall inherit as much properties from
this node as possible - with the exception of its name and type.OutputSocket
.public void setReadOnly(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name) throws IOException
FsController
options
- the options for accessing the file system node.name
- the name of the file system node.IOException
- on any I/O error or if this operation is not
supported.public boolean setTime(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name, net.java.truecommons.shed.BitField<net.java.truecommons.cio.Entry.Access> types, long value) throws IOException
FsController
false
is returned or an IOException
is thrown, then
still some of the last access times may have been set.options
- the options for accessing the file system node.name
- the name of the file system node.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(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name, Map<net.java.truecommons.cio.Entry.Access,Long> times) throws IOException
FsController
false
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 interface FsController
setTime
in class FsAbstractController
options
- the options for accessing the file system node.name
- the name of the file system node.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 void sync(net.java.truecommons.shed.BitField<FsSyncOption> options) throws FsSyncException
FsController
An implementation may ignore calls to this method if its stateless.
options
- the options for synchronizing the file system.FsSyncWarningException
- if only warning conditions
apply.
This implies that the respective parent file system has been
synchronized with constraints, e.g. if an unclosed archive entry
stream gets forcibly closed.FsSyncException
- if any error conditions apply.public String toString()
FsAbstractController
toString
in class FsAbstractController
public void unlink(net.java.truecommons.shed.BitField<FsAccessOption> options, FsNodeName name) throws IOException
FsController
options
- the options for accessing the file system node.name
- the name of the file system node.IOException
- on any I/O error.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.