- 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 Summary
Modifier and TypeMethodDescriptiondefault ManagedDirectoryalso()Method that returns the object it is called upon to enable creating fluent-language builders.default ManagedDirectoryand()Method that returns the object it is called upon to enable creating fluent-language builders.voidclose()Close the resource.createDirectory(String first, String... rest) Create a directory builder for the given path in this RAM file system.createFile(String fragment, String... fragments) Create a file builder for the given path in this RAM file system.getName()Get the identifying name of the temporary file system.default ManagedDirectorythen()Method that returns the object it is called upon to enable creating fluent-language builders.Methods inherited from interface io.github.ascopes.jct.workspaces.DirectoryBuilder
copyContentsFrom, copyContentsFrom, copyContentsFrom, thatIsEmpty
-
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(...); -
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(...); -
close
Close the resource.This specifically is not provided by implementing
Closeableas 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
Workspaceimplementation.- 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
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(...);
-