Chainable builder for creating individual files.
- Since:
- 0.0.1
- Author:
- Ashley Scopes
-
Method Summary
Modifier and TypeMethodDescriptioncopiedFromClassPath(ClassLoader classLoader, String resource) Copy a resource from the given class loader into the file system.copiedFromClassPath(String resource) Copy a resource from the class loader on the current thread into the file system.copiedFromFile(File file) Copy the contents from the given file into the file system.copiedFromFile(Path file) Copy the contents from the given path into the file system.copiedFromUrl(URL url) Copy the contents from the given URL into the file system.fromInputStream(InputStream inputStream) Copy the contents from the given input stream into the file system.Create an empty file with nothing in it.withContents(byte[] contents) Create the file with the given byte contents.withContents(String... lines) Create the file with the given contents.withContents(Charset charset, String... lines) Create the file with the given contents.
-
Method Details
-
withContents
Create the file with the given contents.- Parameters:
lines- the lines to write using the default charset.- Returns:
- the root managed directory for further configuration.
-
withContents
Create the file with the given contents.- Parameters:
charset- the character encoding to use.lines- the lines to write.- Returns:
- the root managed directory for further configuration.
-
withContents
Create the file with the given byte contents.- Parameters:
contents- the bytes to write.- Returns:
- the root managed directory for further configuration.
-
copiedFromClassPath
Copy a resource from the class loader on the current thread into the file system.- Parameters:
resource- the resource to copy.- Returns:
- the root managed directory for further configuration.
-
copiedFromClassPath
Copy a resource from the given class loader into the file system.- Parameters:
classLoader- the class loader to use.resource- the resource to copy.- Returns:
- the root managed directory for further configuration.
-
copiedFromFile
Copy the contents from the given file into the file system.- Parameters:
file- the file to read.- Returns:
- the root managed directory for further configuration.
-
copiedFromFile
Copy the contents from the given path into the file system.- Parameters:
file- the file to read.- Returns:
- the root managed directory for further configuration.
-
copiedFromUrl
Copy the contents from the given URL into the file system.- Parameters:
url- the URL to read.- Returns:
- the root managed directory for further configuration.
-
thatIsEmpty
Create an empty file with nothing in it.- Returns:
- the root managed directory for further configuration.
-
fromInputStream
Copy the contents from the given input stream into the file system.The input stream will be closed when reading completes.
- Parameters:
inputStream- the input stream to read.- Returns:
- the root managed directory for further configuration.
-