TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.fs
Class FsFederatingController

java.lang.Object
  extended by de.schlichtherle.truezip.fs.FsController<M>
      extended by de.schlichtherle.truezip.fs.FsDecoratingController<FsModel,FsController<?>>
          extended by de.schlichtherle.truezip.fs.FsFederatingController

@ThreadSafe
final class FsFederatingController
extends FsDecoratingController<FsModel,FsController<?>>

Implements a chain of responsibility in order to resolve FsFalsePositiveExceptions thrown by the prospective file system provided to its constructor. Whenever the controller for the prospective file system throws a FsFalsePositiveException, the method call is delegated to the controller for its parent file system in order to resolve the requested operation.

Author:
Christian Schlichtherle

Nested Class Summary
private  class FsFederatingController.Input
           
private  class FsFederatingController.Output
           
 
Field Summary
private  FsPath path
           
 
Fields inherited from class de.schlichtherle.truezip.fs.FsDecoratingController
delegate
 
Constructor Summary
FsFederatingController(FsController<?> controller)
          Constructs a new file system federating controller.
 
Method Summary
 Icon getClosedIcon()
           
 FsEntry getEntry(FsEntryName name)
           
 InputSocket<?> getInputSocket(FsEntryName name, BitField<FsInputOption> options)
          Returns an input socket for reading the contents of the 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.
private  FsPath getPath()
           
 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.
private  FsEntryName resolveParent(FsEntryName name)
           
 void setReadOnly(FsEntryName name)
           
 boolean setTime(FsEntryName name, BitField<Entry.Access> types, long value)
           
 void unlink(FsEntryName name)
           
 
Methods inherited from class de.schlichtherle.truezip.fs.FsDecoratingController
getModel, getParent, sync, toString
 
Methods inherited from class de.schlichtherle.truezip.fs.FsController
equals, hashCode, sync
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

path

private volatile FsPath path
Constructor Detail

FsFederatingController

FsFederatingController(@NonNull
                       FsController<?> controller)
Constructs a new file system federating controller.

Parameters:
controller - the decorated file system controller.
Method Detail

resolveParent

private FsEntryName resolveParent(FsEntryName name)

getPath

private FsPath getPath()

getOpenIcon

public Icon getOpenIcon()
                 throws IOException
Overrides:
getOpenIcon in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

getClosedIcon

public Icon getClosedIcon()
                   throws IOException
Overrides:
getClosedIcon in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

isReadOnly

public boolean isReadOnly()
                   throws IOException
Overrides:
isReadOnly in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

getEntry

public FsEntry getEntry(FsEntryName name)
                 throws IOException
Overrides:
getEntry in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

isReadable

public boolean isReadable(FsEntryName name)
                   throws IOException
Overrides:
isReadable in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

isWritable

public boolean isWritable(FsEntryName name)
                   throws IOException
Overrides:
isWritable in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

setReadOnly

public void setReadOnly(FsEntryName name)
                 throws IOException
Overrides:
setReadOnly in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

setTime

public boolean setTime(FsEntryName name,
                       BitField<Entry.Access> types,
                       long value)
                throws IOException
Overrides:
setTime in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

getInputSocket

public InputSocket<?> getInputSocket(FsEntryName name,
                                     BitField<FsInputOption> options)
Description copied from class: FsController
Returns an input socket for reading the contents of the entry addressed by the given name from the file system.

Overrides:
getInputSocket in class FsDecoratingController<FsModel,FsController<?>>
Parameters:
name - a file system entry name.
Returns:
An InputSocket.

getOutputSocket

public OutputSocket<?> getOutputSocket(FsEntryName name,
                                       BitField<FsOutputOption> options,
                                       Entry template)
Description copied from class: FsController
Returns an output socket for writing the contents of the entry addressed by the given name to the file system. If template is not null, then the output entry shall have as many of its properties copied as reasonable, e.g. the last modification time.

Overrides:
getOutputSocket in class FsDecoratingController<FsModel,FsController<?>>
Parameters:
name - a file system entry name.
template - a nullable template for the properties of the output entry.
Returns:
An OutputSocket.

mknod

public void mknod(@NonNull
                  FsEntryName name,
                  @NonNull
                  Entry.Type type,
                  @NonNull
                  BitField<FsOutputOption> options,
                  @CheckForNull
                  Entry template)
           throws IOException
Description copied from class: FsController
Creates or replaces and finally links a chain of one or more entries for the given entry name into the file system.

Overrides:
mknod in class FsDecoratingController<FsModel,FsController<?>>
Parameters:
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.
Throws:
IOException - for some other I/O related reason, including but not exclusively upon one or more of the following conditions:
  • The file system is read only.
  • name contains characters which are not supported by the file system.
  • The entry already exists and either the option FsOutputOption.EXCLUSIVE is set or the entry is a directory.
  • The entry exists as a different type.
  • A parent entry exists but is not a directory.
  • A parent entry is missing and createParents is false.

unlink

public void unlink(FsEntryName name)
            throws IOException
Overrides:
unlink in class FsDecoratingController<FsModel,FsController<?>>
Throws:
IOException

TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.