Interface DirectoryWriter

All Known Implementing Classes:
DefaultDirectoryWriter

public interface DirectoryWriter
Interface for methods to convert a directory to various String representations.
Since:
3.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    toHtml(@NotNull File directory, @URL String requestURL, boolean includeParent)
    Convert a given directory to an String containing a full valid HTML page.
    toJson(@NotNull File directory, @URL String requestURL, boolean includeParent)
    Convert a given directory to an String of JSON.
  • Method Details

    • toHtml

      String toHtml(@NotNull @NotNull File directory, @URL @URL String requestURL, boolean includeParent) throws Exception
      Convert a given directory to an String containing a full valid HTML page.
      Parameters:
      directory - The directory to convert. Not null. Is directory.
      requestURL - The URL of the request that kicked off this process
      includeParent - Whether the conversion should include reference to the parent directory.
      Returns:
      String HTML representation of the directory
      Throws:
      Exception - for any conversion problem
    • toJson

      String toJson(@NotNull @NotNull File directory, @URL @URL String requestURL, boolean includeParent) throws Exception
      Convert a given directory to an String of JSON.
      Parameters:
      directory - The directory to convert. Not null. Is directory.
      requestURL - The URL of the request that kicked off this process
      includeParent - Whether the conversion should include reference to the parent directory.
      Returns:
      String HTML representation of the directory
      Throws:
      Exception - for any conversion problem