Package com.powsybl.afs
Class Folder
- java.lang.Object
-
- com.powsybl.afs.AbstractNodeBase<Folder>
-
- com.powsybl.afs.Node
-
- com.powsybl.afs.Folder
-
- All Implemented Interfaces:
FolderBase<Node,Folder>
public class Folder extends Node implements FolderBase<Node,Folder>
A folder in anAppFileSystem
tree.Folders may have children folders or files, and provides methods to create new children.
- Author:
- Geoffroy Jamgotchian
-
-
Field Summary
Fields Modifier and Type Field Description static String
PSEUDO_CLASS
static int
VERSION
-
Fields inherited from class com.powsybl.afs.Node
fileSystem, folder
-
Fields inherited from class com.powsybl.afs.AbstractNodeBase
codeVersion, info, storage
-
-
Constructor Summary
Constructors Constructor Description Folder(FileCreationContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
archiveChildren(Path dir)
Folder
createFolder(String name)
Creates a subfolder of this folder.Project
createProject(String name)
Creates a newProject
in this folder.void
delete()
<T extends Node>
Optional<T>getChild(Class<T> clazz, String name, String... more)
Gets the child node of class T at path "name/name2/..." relative to this folder, in a typesafe way, or empty if it does not exist.Optional<Node>
getChild(String name, String... more)
Gets the child node at path "name/name2/..." relative to this folder, or empty if it does not exist.List<Node>
getChildren()
Get the children nodes of this folder.Optional<Folder>
getFolder(String name, String... more)
Gets the folder at path "name/name2/..." relative to this folder, or empty if it does not exist.boolean
isWritable()
-
Methods inherited from class com.powsybl.afs.Node
findService, getFileSystem, getParent, getPath, isFolder
-
Methods inherited from class com.powsybl.afs.AbstractNodeBase
archive, archive, archive, archive, archive, getChildInfo, getCodeVersion, getCreationDate, getDescription, getId, getModificationDate, getName, getParentInfo, getVersion, isAheadOfVersion, isAncestorOf, moveTo, rename, setDescription, toString, unarchive, unarchive
-
-
-
-
Field Detail
-
PSEUDO_CLASS
public static final String PSEUDO_CLASS
- See Also:
- Constant Field Values
-
VERSION
public static final int VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Folder
public Folder(FileCreationContext context)
-
-
Method Detail
-
isWritable
public boolean isWritable()
-
getChildren
public List<Node> getChildren()
Get the children nodes of this folder.- Specified by:
getChildren
in interfaceFolderBase<Node,Folder>
-
getChild
public Optional<Node> getChild(String name, String... more)
Gets the child node at path "name/name2/..." relative to this folder, or empty if it does not exist.- Specified by:
getChild
in interfaceFolderBase<Node,Folder>
-
getChild
public <T extends Node> Optional<T> getChild(Class<T> clazz, String name, String... more)
Gets the child node of class T at path "name/name2/..." relative to this folder, in a typesafe way, or empty if it does not exist.- Specified by:
getChild
in interfaceFolderBase<Node,Folder>
-
getFolder
public Optional<Folder> getFolder(String name, String... more)
Gets the folder at path "name/name2/..." relative to this folder, or empty if it does not exist.- Specified by:
getFolder
in interfaceFolderBase<Node,Folder>
-
createFolder
public Folder createFolder(String name)
Creates a subfolder of this folder. If a folder with same name already exists, returns the existing folder.- Specified by:
createFolder
in interfaceFolderBase<Node,Folder>
-
createProject
public Project createProject(String name)
Creates a newProject
in this folder. If a project with same name already exists, returns the existing project.
-
archiveChildren
public void archiveChildren(Path dir)
-
-