Package edu.ie3.datamodel.io.naming
Class DefaultDirectoryHierarchy
java.lang.Object
edu.ie3.datamodel.io.naming.DefaultDirectoryHierarchy
- All Implemented Interfaces:
FileHierarchy
Default directory hierarchy for input models
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates all mandatory subdirectories of this default directory hierarchyvoid
createDirs
(boolean withOptionals) Creates all subdirectories of this default directory hierarchy.Gives thebaseDirectory
).getSubDirectory
(Class<? extends UniqueEntity> cls, String fileSeparator) Gives the correct sub directory (w.r.t.void
validate()
Checks, if the structure beneathbaseDirectory
is okay.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.ie3.datamodel.io.naming.FileHierarchy
getSubDirectory
-
Field Details
-
FILE_SEPARATOR
Use the unix file separator here.
-
-
Constructor Details
-
DefaultDirectoryHierarchy
-
-
Method Details
-
validate
Checks, if the structure beneathbaseDirectory
is okay.- Throws:
FileException
- if not
-
createDirs
Creates all mandatory subdirectories of this default directory hierarchy- Throws:
IOException
- If the creation of sub directories is not possible
-
createDirs
Creates all subdirectories of this default directory hierarchy. Upon request, also the optional directories are created.- Parameters:
withOptionals
- if true, also optional directories get created.- Throws:
IOException
- If the creation of sub directories is not possible
-
getBaseDirectory
Gives thebaseDirectory
).- Specified by:
getBaseDirectory
in interfaceFileHierarchy
- Returns:
- An Option to the base directory as a string
-
getSubDirectory
Gives the correct sub directory (w.r.t.baseDirectory
) for the provided class.- Specified by:
getSubDirectory
in interfaceFileHierarchy
- Parameters:
cls
- Class to define the sub directory forfileSeparator
- The file separator to use- Returns:
- An Option to the regarding sub directory as a string
-