Class DefaultDirectoryWriter
java.lang.Object
com.netflix.genie.web.resources.writers.DefaultDirectoryWriter
- All Implemented Interfaces:
DirectoryWriter
A default directory writer implementation.
- Since:
- 3.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
DTO for representing a directory contents.static class
DTO for representing information about an entry within a job directory. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
directoryToHTML
(String directoryName, DefaultDirectoryWriter.Directory directory) Given the provided information render as an HTML string.protected DefaultDirectoryWriter.Directory
getDirectory
(File directory, String requestUrl, boolean includeParent) Convert a given directory to an String containing a full valid HTML page.Convert a given directory to an String of JSON.
-
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 directorydirectory
- 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 interfaceDirectoryWriter
- Parameters:
directory
- The directory to convert. Not null. Is directory.requestURL
- The URL of the request that kicked off this processincludeParent
- 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 interfaceDirectoryWriter
- Parameters:
directory
- The directory to convert. Not null. Is directory.requestURL
- The URL of the request that kicked off this processincludeParent
- 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)
-