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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String toHtml​(@NotNull java.io.File directory, @URL java.lang.String requestURL, boolean includeParent)
      Convert a given directory to an String containing a full valid HTML page.
      java.lang.String toJson​(@NotNull java.io.File directory, @URL java.lang.String requestURL, boolean includeParent)
      Convert a given directory to an String of JSON.
    • Method Detail

      • toHtml

        java.lang.String toHtml​(@NotNull
                                @NotNull java.io.File directory,
                                @URL
                                @URL java.lang.String requestURL,
                                boolean includeParent)
                         throws java.lang.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:
        java.lang.Exception - for any conversion problem
      • toJson

        java.lang.String toJson​(@NotNull
                                @NotNull java.io.File directory,
                                @URL
                                @URL java.lang.String requestURL,
                                boolean includeParent)
                         throws java.lang.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:
        java.lang.Exception - for any conversion problem