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:
java.io.Serializable
- Direct Known Subclasses:
FileNotFolderException
,FileNotFoundException
,FileTypeHasNoContentException
public class FileSystemException extends java.io.IOException
Thrown for file system errors.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
info
Array of complementary info (context).private static java.util.regex.Pattern
PASSWORD_PATTERN
Password patternprivate static long
serialVersionUID
serialVersionUID format is YYYYMMDD for the date of the last binary change.private static java.util.regex.Pattern
URL_PATTERN
URL pattern
-
Constructor Summary
Constructors Constructor Description FileSystemException(java.lang.String code)
Constructs exception with the specified detail message.FileSystemException(java.lang.String code, java.lang.Object info0)
Constructs exception with the specified detail message.FileSystemException(java.lang.String code, java.lang.Object... info)
Constructs exception with the specified detail message.FileSystemException(java.lang.String code, java.lang.Object[] info, java.lang.Throwable throwable)
Deprecated.Use insteadFileSystemException(String, Throwable, Object[])
.FileSystemException(java.lang.String code, java.lang.Object info0, java.lang.Throwable throwable)
Constructs exception with the specified detail message.FileSystemException(java.lang.String code, java.lang.Throwable throwable)
Constructs exception with the specified detail message.FileSystemException(java.lang.String code, java.lang.Throwable throwable, java.lang.Object... info)
Constructs exception with the specified detail message.FileSystemException(java.lang.Throwable throwable)
Constructs wrapper exception.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCode()
Retrieves error code of the exception.java.lang.String[]
getInfo()
Retrieves array of complementary info (context).java.lang.String
getMessage()
Retrieves message from bundle.static <T> T
requireNonNull(T obj, java.lang.String code)
Throws a FileSystemException when the given object is null.static <T> T
requireNonNull(T obj, java.lang.String code, java.lang.Object... info)
Throws a FileSystemException when the given object is null.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
serialVersionUID format is YYYYMMDD for the date of the last binary change.- See Also:
- Constant Field Values
-
URL_PATTERN
private static final java.util.regex.Pattern URL_PATTERN
URL pattern
-
PASSWORD_PATTERN
private static final java.util.regex.Pattern PASSWORD_PATTERN
Password pattern
-
info
private final java.lang.String[] info
Array of complementary info (context).
-
-
Constructor Detail
-
FileSystemException
public FileSystemException(java.lang.String code)
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.
-
FileSystemException
public FileSystemException(java.lang.String code, java.lang.Object info0)
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info0
- one context information.
-
FileSystemException
public FileSystemException(java.lang.String code, java.lang.Object info0, java.lang.Throwable throwable)
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info0
- one context information.throwable
- the cause.
-
FileSystemException
public FileSystemException(java.lang.String code, java.lang.Object... info)
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info
- array of complementary info (context).
-
FileSystemException
public FileSystemException(java.lang.String code, java.lang.Throwable throwable)
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.throwable
- the original cause
-
FileSystemException
@Deprecated public FileSystemException(java.lang.String code, java.lang.Object[] info, java.lang.Throwable throwable)
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).throwable
- the cause.
-
FileSystemException
public FileSystemException(java.lang.String code, java.lang.Throwable throwable, java.lang.Object... info)
Constructs exception with the specified detail message.- Parameters:
code
- the error code of the message.info
- array of complementary info (context).throwable
- the cause.
-
FileSystemException
public FileSystemException(java.lang.Throwable throwable)
Constructs wrapper exception.- Parameters:
throwable
- the root cause to wrap.
-
-
Method Detail
-
requireNonNull
public static <T> T requireNonNull(T obj, java.lang.String code) throws FileSystemException
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
public static <T> T requireNonNull(T obj, java.lang.String code, java.lang.Object... info) throws FileSystemException
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
-
getMessage
public java.lang.String getMessage()
Retrieves message from bundle.- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- The exception message.
-
getCode
public java.lang.String getCode()
Retrieves error code of the exception. Could be used as key for internationalization.- Returns:
- the code.
-
getInfo
public java.lang.String[] getInfo()
Retrieves array of complementary info (context). Could be used as parameter for internationalization.- Returns:
- the context info.
-
-