Class DefaultDirectoryWriter

java.lang.Object
com.netflix.genie.web.resources.writers.DefaultDirectoryWriter
All Implemented Interfaces:
DirectoryWriter

public class DefaultDirectoryWriter extends Object implements DirectoryWriter
A default directory writer implementation.
Since:
3.0.0
  • Constructor Details

    • DefaultDirectoryWriter

      public DefaultDirectoryWriter()
  • Method Details

    • directoryToHTML

      public static String directoryToHTML(String directoryName, DefaultDirectoryWriter.Directory directory)
      Given the provided information render as an HTML string.
      Parameters:
      directoryName - The name of the directory
      directory - The directory information to serialize
      Returns:
      A string of valid HTML
      See Also:
      • DefaultServlet
    • toHtml

      public String toHtml(@NotNull @NotNull File directory, @URL @URL String requestURL, boolean includeParent) throws IOException
      Convert a given directory to an String containing a full valid HTML page.
      Specified by:
      toHtml in interface DirectoryWriter
      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:
      IOException
      See Also:
      • DefaultServlet
    • toJson

      public String toJson(@NotNull @NotNull File directory, @URL @URL String requestURL, boolean includeParent) throws Exception
      Convert a given directory to an String of JSON.
      Specified by:
      toJson in interface DirectoryWriter
      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
    • getDirectory

      protected DefaultDirectoryWriter.Directory getDirectory(File directory, String requestUrl, boolean includeParent)