Builds uppon sfss.lib the Simple FS Storage library.
##Usage
dataRoot (mandatory)
: {String} absolut path to the root directory of the store.disableFileDeletion
: {Boolean} makes sure that no file can be deleted.disableDirectoryDeletion
: {Boolean} makes sure that no directory can be deleted.
Creates a new directory (success Status Code 201):
{
"data": {
"ref": "/sfss/tree/trial",
"action": "created"
},
"status": "success"
}
Returns the directory content - files and subdirectories names as Array (success Status Code 200):
{
"ref": "/sfss/tree/test",
"type": "directoryContent",
"data": [
"first.json",
"second.json",
"sub"
],
"status": "success"
}
Deep deletion of the directory, like rm -rf
(success Status Code 204): no body
Creates or updates a file (success Status Code 201):
{
"ref": "/sfss/data/test/first.json",
"data": {
"fileId": 1
},
"status": "success"
}
Reads all files in the directory (bulk read) (success Status Code 200):
{
"ref": "/sfss/data/test",
"type": "multipleFileContent",
"data": [
{
"fileId": 1
},
{
"fileId": 2
}
],
"status": "success"
}
Reads a file (success Status Code 200):
{
"ref": "/sfss/data/test/first.json",
"type": "fileContent",
"data": {
"fileId": 1
},
"status": "success"
}
Removes a file (success Status Code 204): no body