Package org.apache.commons.vfs2
Class FileSystemException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.apache.commons.vfs2.FileSystemException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FileNotFolderException
,FileNotFoundException
,FileTypeHasNoContentException
Thrown for file system errors.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFileSystemException
(String code) Constructs exception with the specified detail message.FileSystemException
(String code, Object info) Constructs exception with the specified detail message.FileSystemException
(String code, Object... info) Constructs exception with the specified detail message.FileSystemException
(String code, Object[] info, Throwable cause) Deprecated.FileSystemException
(String code, Object info, Throwable cause) Constructs exception with the specified detail message and cause.FileSystemException
(String code, Throwable cause) Constructs exception with the specified detail message.FileSystemException
(String code, Throwable cause, Object... info) Constructs exception with the specified detail message.FileSystemException
(Throwable cause) Constructs wrapper exception. -
Method Summary
Modifier and TypeMethodDescriptiongetCode()
Retrieves error code of the exception.String[]
getInfo()
Retrieves array of complementary info (context).Retrieves message from bundle.static <T> T
requireNonNull
(T obj, String code) Throws a FileSystemException when the given object is null.static <T> T
requireNonNull
(T obj, String code, Object... info) Throws a FileSystemException when the given object is null.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FileSystemException
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.
-
FileSystemException
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info
- one context information.
-
FileSystemException
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info
- array of complementary info (context).
-
FileSystemException
Constructs exception with the specified detail message and cause.- Parameters:
code
- the error code of the message.info
- one context information.cause
- the cause.
-
FileSystemException
Deprecated.Use insteadFileSystemException(String, Throwable, Object[])
. Will be removed in 3.0.Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info
- array of complementary info (context).cause
- the cause.
-
FileSystemException
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.cause
- the original cause
-
FileSystemException
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info
- array of complementary info (context).cause
- the cause.
-
FileSystemException
Constructs wrapper exception.- Parameters:
cause
- the root cause to wrap.
-
-
Method Details
-
requireNonNull
Throws a FileSystemException when the given object is null.- Type Parameters:
T
- the type of the reference- Parameters:
obj
- the object reference to check for null.code
- message used whenFileSystemException
is thrown- Returns:
obj
if notnull
- Throws:
FileSystemException
- ifobj
isnull
- Since:
- 2.3
-
requireNonNull
Throws a FileSystemException when the given object is null.- Type Parameters:
T
- the type of the reference- Parameters:
obj
- the object reference to check for null.code
- message used whenFileSystemException
is throwninfo
- one context information.- Returns:
obj
if notnull
- Throws:
FileSystemException
- ifobj
isnull
- Since:
- 2.3
-
getCode
Retrieves error code of the exception. Could be used as key for internationalization.- Returns:
- the code.
-
getInfo
Retrieves array of complementary info (context). Could be used as parameter for internationalization.- Returns:
- the context info.
-
getMessage
Retrieves message from bundle.- Overrides:
getMessage
in classThrowable
- Returns:
- The exception message.
-
FileSystemException(String, Throwable, Object[])
.