@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 Form| Modifier and Type | Field and Description |
|---|---|
(package private) static boolean |
TRACEABLE
Controls whether or not instances of this class have a regular stack
trace or an empty stack trace.
|
| Constructor and Description |
|---|
FsControllerException() |
FsControllerException(FsModel model,
String message,
Throwable cause) |
| Modifier 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, toStringstatic final boolean TRACEABLE
de.schlichtherle.truezip.fs.FsControllerException.traceable
is set to true (whereby case is ignored), then instances of this
class will have a regular stack trace, otherwise their stack trace will
be empty.
This should be set to true for debugging purposes only.FsControllerException()
FsControllerException(FsModel model, @CheckForNull String message, @CheckForNull Throwable cause)
public Throwable fillInStackTrace()
Throwable!fillInStackTrace in class ThrowablethisCopyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.