public class IndexNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
created
The created date-time is exposed in JSON as 'index_created' field.
|
java.util.SortedSet<DirectoryNode> |
directories
The directory list is exposed in JSON.
|
static IndexNode |
emptyNode
An empty node, which is not added to JSON output.
|
java.util.SortedSet<FileNode> |
files
The file list is exposed in JSON.
|
java.lang.String |
path
Path (i.e.
|
Constructor and Description |
---|
IndexNode(java.lang.String created,
java.lang.String path,
java.util.SortedSet<FileNode> files,
java.util.SortedSet<DirectoryNode> directories)
An index node is the top-level node in the JSON structure.
|
Modifier and Type | Method and Description |
---|---|
static IndexNode |
fetchIndex(java.io.InputStream is)
Reads JSON from given InputStream.
|
static IndexNode |
fetchIndex(java.lang.String urlString)
Reads JSON from given URL String.
|
static DirectoryNode |
findPathIn(java.lang.String path,
java.util.SortedSet<DirectoryNode> dirs)
Returns the directory nodes with the given path, but no file nodes.
|
static java.lang.String |
makeJsonString(IndexNode indexNode)
Write JSON representation of the given index node to a string.
|
java.util.SortedMap<java.lang.String,FileNode> |
retrieveFilesIn(java.lang.String... remoteDirs)
Return a map of file paths for the given directories.
|
java.lang.String |
toString()
For debugging purposes.
|
static void |
writeIndex(java.nio.file.Path outPath,
IndexNode indexNode)
Write JSON representation of the given index node to the given path.
|
public static final IndexNode emptyNode
public final java.lang.String created
public final java.lang.String path
public final java.util.SortedSet<DirectoryNode> directories
public final java.util.SortedSet<FileNode> files
public IndexNode(java.lang.String created, java.lang.String path, java.util.SortedSet<FileNode> files, java.util.SortedSet<DirectoryNode> directories)
public static IndexNode fetchIndex(java.lang.String urlString) throws java.lang.Exception
java.lang.Exception
public static IndexNode fetchIndex(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public java.util.SortedMap<java.lang.String,FileNode> retrieveFilesIn(java.lang.String... remoteDirs)
public static DirectoryNode findPathIn(java.lang.String path, java.util.SortedSet<DirectoryNode> dirs)
public static void writeIndex(java.nio.file.Path outPath, IndexNode indexNode) throws java.lang.Exception
java.lang.Exception
public static java.lang.String makeJsonString(IndexNode indexNode)
public java.lang.String toString()
toString
in class java.lang.Object