@Immutable public abstract class FsControllerException extends IOException
File system controllers are typically arranged in a decorator and chain-of-responsibility pattern. Unfortunately, some aspects of file system management make it necessary to use exceptions for non-local flow control in these chains. For example:
If you are only using a file system controller, for example by calling
FsManager.getController(FsMountPoint, FsCompositeDriver)
, then you
don't need to be concerned about file system controller exceptions at all
because they shall never pass to client applications (this would be a bug).
As an implementor of a file system controller however, for example when writing a custom controller for an archive file system driver by extending this class, you need to be aware that you may receive file system controller exceptions whenever you call a method on the decorated file system controller. Unless you have special requirements, you don't need to catch such an exception. Just make sure to always leave your controller in a consistent state, for example by protecting all access to the decorated controller with a try-finally block:
\@Override
public FsEntry getEntry(FsEntryName name) throws IOException {
prepareMyResources();
try {
return delegate.getEntry(); // may throw FsControllerException, too!
} finally {
cleanUpMyResources();
}
}
FsException
and changed super
type from IOException
to RuntimeException
)FsDecoratingController
,
Serialized FormModifier and Type | Method and Description |
---|---|
Throwable |
fillInStackTrace()
Fills in an empty stack trace for optimum performance.
|
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public Throwable fillInStackTrace()
Throwable
!fillInStackTrace
in class Throwable
this
Copyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.