Package org.terracotta.utilities.test.io
Enum WindowsSpecialFolder
- All Implemented Interfaces:
Serializable,Comparable<WindowsSpecialFolder>,java.lang.constant.Constable
Provides the value for Windows Special Folder identifiers.
The values represented by this enumeration are determined when first referenced
by calling PowerShell to obtain the path assigned to the special folder
identifier.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classA derived on first reference value holder.static classThrown when the folder assigned to a Windows Special Folder identifier cannot be determined.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionProvides thePathcorresponding to theCommonApplicationDataspecial folder.Provides thePathcorresponding to theSystemspecial folder. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WindowsSpecialFolder.LazyProperty<Path>private static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Gets thePathassigned to the identified special folder.private static PathgetSpecialFolder(String specialFolderId, boolean create) Gets thePathto the identified Windows Special Folder.static WindowsSpecialFolderReturns the enum constant of this type with the specified name.static WindowsSpecialFolder[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
COMMON_APPLICATION_DATA
Provides thePathcorresponding to theCommonApplicationDataspecial folder. A get via this constant will attempt to create the folder if it does not already exist. -
SYSTEM
Provides thePathcorresponding to theSystemspecial folder.
-
-
Field Details
-
accessor
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
WindowsSpecialFolder
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
get
Gets thePathassigned to the identified special folder.- Returns:
- the special folder
Path - Throws:
IOException- if an error is raised while attempting to determine thePathfor the special folder
-
getSpecialFolder
Gets thePathto the identified Windows Special Folder.- Parameters:
specialFolderId- the special folder identifiercreate- iftrue, attempts to create the folder if it does not exist- Returns:
- the path to the special folder; an empty path is returned if the folder does not exist
- Throws:
IOException- if the special folder value cannot be determined
-