Interface FileBuilder


@API(since="0.0.1", status=STABLE) public interface FileBuilder
Chainable builder for creating individual files.
Since:
0.0.1
Author:
Ashley Scopes
  • 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

      ManagedDirectory withContents(byte[] contents)
      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.