Package io.cui.tools.io
Enum FileTypePrefix
- java.lang.Object
-
- java.lang.Enum<FileTypePrefix>
-
- io.cui.tools.io.FileTypePrefix
-
- All Implemented Interfaces:
Serializable,Comparable<FileTypePrefix>
public enum FileTypePrefix extends Enum<FileTypePrefix>
Utility class to define file type prefixes.- Author:
- Sven Haag
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetPrefix()booleanis(String path)StringremovePrefix(String path)StringtoString()static FileTypePrefixvalueOf(String name)Returns the enum constant of this type with the specified name.static FileTypePrefix[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FILE
public static final FileTypePrefix FILE
"file:"
-
CLASSPATH
public static final FileTypePrefix CLASSPATH
"classpath:"
-
EXTERNAL
public static final FileTypePrefix EXTERNAL
"external:"
-
URL
public static final FileTypePrefix URL
"url:"
-
-
Method Detail
-
values
public static FileTypePrefix[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FileTypePrefix c : FileTypePrefix.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FileTypePrefix valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
is
public boolean is(String path)
- Parameters:
path- to be checked- Returns:
- true if the given path is prefixed with this enum
-
removePrefix
public String removePrefix(String path)
- Parameters:
path- from which the prefix should be removed- Returns:
- path without
getPrefix()
-
toString
public String toString()
- Overrides:
toStringin classEnum<FileTypePrefix>
-
-