public interface FlatsyDatabase
| Modifier and Type | Method and Description |
|---|---|
List<FlatsyObject> |
children(FlatsyObject object)
Gets a list of objects that belong to a specified parent node
In filesystem terms the folder contents
|
void |
create(FlatsyObject object,
InputStream content) |
void |
create(FlatsyObject object,
String content) |
void |
delete(FlatsyObject object)
Delete an object from the system
|
FlatsyObject |
get(String uri) |
void |
move(FlatsyObject object,
String newUri)
Move an object to a new uri
Note that moving a folder will move all subobjects
|
Map<String,String> |
moveMap(FlatsyObject object,
String newUri)
Get the mapping that would move an object and all subfiles to a new uri
|
FlatsyObject |
parent(FlatsyObject object)
Gets the parent node of the object
Note that the parent of root is null
|
String |
retrieve(FlatsyObject object)
Retrieves the string contents for the FlatsyObject database object
Suitable for deserialising objects from JSON
|
<T> Object |
retrieveAs(FlatsyObject object,
Class<T> tClass)
Deserialise the object as a specific class
|
InputStream |
retrieveStream(FlatsyObject object)
Writes the content of the object to an OutputStream.
|
FlatsyObject |
root() |
FlatsyObjectType |
type(String uri)
The FlatsyObjectType of an object
|
void |
update(FlatsyObject object,
FlatsyOperator update)
Update the object using a FlatsyOperator
|
FlatsyObject root()
FlatsyObject get(String uri)
void create(FlatsyObject object, String content)
void create(FlatsyObject object, InputStream content) throws IOException
IOExceptionString retrieve(FlatsyObject object) throws IOException
object - a FlatsyObject with valid URIIOException - if the object cannot be openedInputStream retrieveStream(FlatsyObject object) throws IOException
object - a FlatsyObject with valid URIIOException - if the object cannot be opened<T> Object retrieveAs(FlatsyObject object, Class<T> tClass)
T - genericobject - a Flatsy ObjecttClass - the class to deserialise the object asvoid update(FlatsyObject object, FlatsyOperator update)
object - a FlatsyObject to updateupdate - the Operator to applyvoid delete(FlatsyObject object)
object - the objectList<FlatsyObject> children(FlatsyObject object)
object - giving the base uriFlatsyObject parent(FlatsyObject object)
object - an objectvoid move(FlatsyObject object, String newUri)
object - a flatsy objectnewUri - a new uri to move the object toMap<String,String> moveMap(FlatsyObject object, String newUri)
object - an object that is going to be movednewUri - the uri it will be moved toFlatsyObjectType type(String uri)
uri - the id of the objectCopyright © 2015. All rights reserved.