Enum Class CdbFolders

java.lang.Object
java.lang.Enum<CdbFolders>
org.eso.ias.cdb.structuredtext.CdbFolders
All Implemented Interfaces:
Serializable, Comparable<CdbFolders>, Constable

public enum CdbFolders extends Enum<CdbFolders>

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
  • Enum Constant Details

  • Field Details

    • folderName

      public final String folderName
      The name of the folder
  • Method Details

    • values

      public static CdbFolders[] 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

      public static CdbFolders valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • delete

      public boolean delete(Path folderToDelete)
      Delete the subfolder, if it exists.
      Parameters:
      folderToDelete - : The subfolder to delete
      Returns:
      true if the folder has been deleted, false otherwise
    • getFolder

      public Path getFolder(Path cdbParentPath, boolean create) throws IOException
      Get the path of the CDB folder and if it is the case, creates it.
      Parameters:
      cdbParentPath - : The path to the parent of the CDB
      create - : if true and the subfolder does not exist, then create it
      Returns:
      the path to the subfolder.
      Throws:
      IOException - If the folder is not writeable
    • exists

      public boolean exists(Path cdbParentPath)
      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 CDB
      folder - : the CDB folder to create
      create - : if true 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

      public static void createFolders(Path cdbParentPath) throws IOException
      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