Package org.eso.ias.cdb.structuredtext
Enum Class CdbFolders
- All Implemented Interfaces:
Serializable
,Comparable<CdbFolders>
,Constable
The structure of the folders and the names of the files of the CDB are described in the CDB wiki:
+CDB
| ias.json
|+ Supervisor
| <SupID-1>.json
| ...
| <SupID-n>.json
|+ DASU
| <DasuID-1>.json
| ...
| <DasuID-m>.json
|+ TF
| tfs.json
|+ ASCE
| <AsceID-1>.json
| ...
| <AsceID-t>.json
|+ IASIO
| IASIO.json
|+ TEMPLATE
| templates.json
|+ CLIENT
| <ClientId-1>.conf
| ...
| <ClientId-x>.conf
Note that CdbFolders
only deals with the folders of the CDB
but not with the name of the files that ultimately depends on the selected format.
The example shown above is for JSON files.- Author:
- acaproni
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
createFolders
(Path cdbParentPath) Create all the subfolders of the CDB.boolean
Delete the subfolder, if it exists.boolean
Check if the subfolder existsGet the path of the CDB folder and if it is the case, creates it.static Path
getSubfolder
(Path cdbParentPath, CdbFolders folder, boolean create) Get the path of a CDB folder and if it is the case, creates the folder.static CdbFolders
Returns the enum constant of this class with the specified name.static CdbFolders[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ROOT
-
SUPERVISOR
-
DASU
-
ASCE
-
IASIO
-
TF
-
TEMPLATE
-
PLUGIN
-
CLIENT
-
-
Field Details
-
folderName
The name of the folder
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
delete
Delete the subfolder, if it exists.- Parameters:
folderToDelete
- : The subfolder to delete- Returns:
true
if the folder has been deleted,false
otherwise
-
getFolder
Get the path of the CDB folder and if it is the case, creates it.- Parameters:
cdbParentPath
- : The path to the parent of the CDBcreate
- : iftrue
and the subfolder does not exist, then create it- Returns:
- the path to the subfolder.
- Throws:
IOException
- If the folder is not writeable
-
exists
Check if the subfolder exists- Parameters:
cdbParentPath
- The path of the folder- Returns:
true
if the folder exists,false
otherwise.
-
getSubfolder
public static Path getSubfolder(Path cdbParentPath, CdbFolders folder, boolean create) throws IOException Get the path of a CDB folder and if it is the case, creates the folder.- Parameters:
cdbParentPath
- : The path to the parent of the CDBfolder
- : the CDB folder to createcreate
- : iftrue
and the subfolder does not exist, then create it- Returns:
- the path to the subfolder.
- Throws:
IOException
- In case of error getting the path
-
createFolders
Create all the subfolders of the CDB. If a subfolder already exists then nothing is done- Parameters:
cdbParentPath
- : The path to the parent of the CDB- Throws:
IOException
- in case of error creating the folders
-