Class MCRDirectory

Direct Known Subclasses:
MCRFileCollection

public class MCRDirectory extends MCRStoredNode
Represents a directory stored in a file collection, which may contain other files and directories.
Author:
Frank Lützenkirchen
  • Constructor Details

    • MCRDirectory

      protected MCRDirectory(MCRDirectory parent, Path fo, Element data)
      Create MCRDirectory representing an existing, already stored directory.
      Parameters:
      parent - the parent directory of this directory
      fo - the local directory in the store storing this directory
    • MCRDirectory

      protected MCRDirectory(MCRDirectory parent, String name) throws IOException
      Create a new MCRDirectory that does not exist yet
      Parameters:
      parent - the parent directory of this directory
      name - the name of the new subdirectory to create
      Throws:
      IOException
  • Method Details

    • createDir

      public MCRDirectory createDir(String name) throws IOException
      Creates a new subdirectory within this directory
      Parameters:
      name - the name of the new directory
      Throws:
      IOException
    • createFile

      public MCRFile createFile(String name) throws IOException
      Creates a new file within this directory
      Parameters:
      name - the name of the new file
      Throws:
      IOException
    • buildChildNode

      protected MCRStoredNode buildChildNode(Path fo)
      Returns the MCRFile or MCRDirectory that is represented by the given FileObject, which is a direct child of the directory FileObject this MCRDirectory is stored in.
      Specified by:
      buildChildNode in class MCRNode
      Parameters:
      fo - the FileObject representing the child in the underlying filesystem
      Returns:
      an MCRFile or MCRDirectory child