public class DefaultDirectoryWriter extends java.lang.Object implements DirectoryWriter
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultDirectoryWriter.Directory |
protected static class |
DefaultDirectoryWriter.Entry |
Constructor and Description |
---|
DefaultDirectoryWriter() |
Modifier and Type | Method and Description |
---|---|
protected DefaultDirectoryWriter.Directory |
getDirectory(java.io.File directory,
java.lang.String requestUrl,
boolean includeParent) |
java.lang.String |
toHtml(java.io.File directory,
java.lang.String requestURL,
boolean includeParent)
Convert a given directory to an String containing a full valid HTML page.
|
java.lang.String |
toJson(java.io.File directory,
java.lang.String requestURL,
boolean includeParent)
Convert a given directory to an String of JSON.
|
public java.lang.String toHtml(@NotNull java.io.File directory, @URL java.lang.String requestURL, boolean includeParent) throws java.io.IOException
toHtml
in interface DirectoryWriter
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.java.io.IOException
DefaultServlet
public java.lang.String toJson(@NotNull java.io.File directory, @URL java.lang.String requestURL, boolean includeParent) throws java.lang.Exception
toJson
in interface DirectoryWriter
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.java.lang.Exception
- for any conversion problemprotected DefaultDirectoryWriter.Directory getDirectory(java.io.File directory, java.lang.String requestUrl, boolean includeParent)