Interface ManagedDirectory

All Superinterfaces:
DirectoryBuilder, PathRoot

@API(since="0.0.1", status=STABLE) public interface ManagedDirectory extends DirectoryBuilder, PathRoot
Base interface for a managed directory, including the interfaces for creating fluent-style builders.
Since:
0.0.1
Author:
Ashley Scopes
  • Method Details

    • also

      Method that returns the object it is called upon to enable creating fluent-language builders.

      For example:

      
         thisDirectory
             .createFile("foo", "bar", "baz.txt").withContents(...)
             .and().also()
             .createFile("foo", "bar", "bork.txt").withContents(...);
       
      Returns:
      this object.
      See Also:
    • and

      default ManagedDirectory and()
      Method that returns the object it is called upon to enable creating fluent-language builders.

      For example:

      
         thisDirectory
             .createFile("foo", "bar", "baz.txt").withContents(...)
             .and()
             .createFile("foo", "bar", "bork.txt").withContents(...);
       
      Returns:
      this object.
      See Also:
    • close

      void close() throws IOException
      Close the resource.

      This specifically is not provided by implementing Closeable as to prevent IDEs giving false linting errors about not closing resources.

      Users should not need to call this directly if they are using instances produced from a Workspace implementation.

      Throws:
      IOException - if an IO exception occurs.
    • createDirectory

      Create a directory builder for the given path in this RAM file system.

      Examples:

      
         // Using platform-specific separators.
         dir.createDirectory("foo/bar/baz")...;
      
         // Letting JCT infer the correct path separators to use (recommended).
         dir.createDirectory("foo", "bar", "baz")...;
       
      Parameters:
      first - the first part of the path.
      rest - any additional parts of the path.
      Returns:
      the directory builder.
    • createFile

      FileBuilder createFile(String fragment, String... fragments)
      Create a file builder for the given path in this RAM file system.
      
         // Using platform-specific separators.
         dir.createFile("foo/bar/baz.txt")...;
      
         // Letting JCT infer the correct path separators to use (recommended).
         dir.createFile("foo", "bar", "baz.txt")...;
       
      Parameters:
      fragment - the first part of the path.
      fragments - any additional parts of the path.
      Returns:
      the file builder.
    • getName

      Get the identifying name of the temporary file system.
      Returns:
      the identifier string.
    • then

      Method that returns the object it is called upon to enable creating fluent-language builders.

      For example:

      
         thisDirectory
             .createFile("foo", "bar", "baz.txt").withContents(...)
             .and().then()
             .createFile("foo", "bar", "bork.txt").withContents(...);
       
      Returns:
      this object.
      See Also: