public class FileservicesClient extends MindsphereAPIClient
| Modifier and Type | Class and Description |
|---|---|
static class |
FileservicesClient.ClientBuilder |
MindsphereAPIClient.Builder<T extends MindsphereAPIClient.Builder<T>>credentials, restClientConfig, restTemplate| Modifier | Constructor and Description |
|---|---|
protected |
FileservicesClient(FileservicesClient.ClientBuilder builder) |
| Modifier and Type | Method and Description |
|---|---|
static FileservicesClient.ClientBuilder |
builder() |
FileWriterResponse |
createFile(File file,
String entityId,
String filepath)
write a file
Create a file for the specified entity and path, with the provided content.
|
FileWriterResponse |
createFile(File file,
String entityId,
String filepath,
String description,
String type)
write a file
Create a file for the specified entity and path, with the provided content.
|
boolean |
deleteFile(String entityId,
String filepath)
delete a file
Delete a file for the specified entity and path.
|
FileReaderResponse |
readFile(String entityId,
String filepath)
read a file
Read a file for the specified entity and path
|
FileReaderResponse |
readFile(String entityId,
String filepath,
Integer ifNoneMatch)
read a file
Read a file for the specified entity and path
|
FileSearchResponse |
searchFiles(String entityId)
search files
Search files for the specified entity.
|
FileSearchResponse |
searchFiles(String entityId,
Integer offset,
Integer limit,
Boolean count,
String order,
String filter)
search files
Search files for the specified entity.
|
FileWriterResponse |
updateFile(File file,
String entityId,
String filepath,
Integer ifMatch)
write a file
update a file for the specified entity and path, with the provided content.
|
FileWriterResponse |
updateFile(File file,
String entityId,
String filepath,
String description,
String type,
Integer ifMatch)
write a file
update a file for the specified entity and path, with the provided content.
|
protected FileservicesClient(FileservicesClient.ClientBuilder builder)
public static FileservicesClient.ClientBuilder builder()
public FileWriterResponse createFile(File file, String entityId, String filepath, String description, String type) throws MindsphereException
201 - created
204 - updated
400 - bad request
401 - unauthorized
404 - not found
409 - conflict
0 - Unexpected error
file - File to be writtenentityId - entityId to which file belongsfilepath - path of the directory where file needs to be storeddescription - description of the filetype - type of fileMindsphereException - thrown if an error occurs while attempting to invoke the APIpublic FileWriterResponse createFile(File file, String entityId, String filepath) throws MindsphereException
201 - created
204 - updated
400 - bad request
401 - unauthorized
404 - not found
409 - conflict
0 - Unexpected error
file - File to be writtenentityId - entityId to which file belongsfilepath - path of the directory where file needs to be storedMindsphereException - thrown if an error occurs while attempting to invoke the APIpublic FileWriterResponse updateFile(File file, String entityId, String filepath, String description, String type, Integer ifMatch) throws MindsphereException
201 - created
204 - updated
400 - bad request
401 - unauthorized
404 - not found
409 - conflict
0 - Unexpected error
file - File to be writtenentityId - entityId to which file belongsfilepath - path of the directory where file needs to be storeddescription - description of the filetype - type of fileifMatch - ETag of the latest version for optimistic lockingMindsphereException - thrown if an error occurs while attempting to invoke the APIpublic FileWriterResponse updateFile(File file, String entityId, String filepath, Integer ifMatch) throws MindsphereException
201 - created
204 - updated
400 - bad request
401 - unauthorized
404 - not found
409 - conflict
0 - Unexpected error
file - File to be writtenentityId - entityId to which file belongsfilepath - path of the directory where file needs to be storedifMatch - ETag of the latest version for optimistic lockingMindsphereException - thrown if an error occurs while attempting to invoke the APIpublic FileReaderResponse readFile(String entityId, String filepath) throws MindsphereException
200 - file content
304 - not modfied
401 - unauthorized
404 - not found
0 - unexpected error
entityId - entityId to which file belongsfilepath - path of the directory where file needs to be storedMindsphereException - thrown if an error occurs while attempting to invoke the APIpublic FileSearchResponse searchFiles(String entityId) throws MindsphereException
200 - successful operation
400 - bad request
401 - unauthorized
0 - unexpected error
entityId - entityId to which file belongsMindsphereException - thrown if an error occurs while attempting to invoke the APIpublic FileReaderResponse readFile(String entityId, String filepath, Integer ifNoneMatch) throws MindsphereException
200 - file content
304 - not modfied
401 - unauthorized
404 - not found
0 - unexpected error
entityId - entityId to which file belongsfilepath - path of the directory where file needs to be storedifNoneMatch - ETag of the latest versionMindsphereException - thrown if an error occurs while attempting to invoke the APIpublic FileSearchResponse searchFiles(String entityId, Integer offset, Integer limit, Boolean count, String order, String filter) throws MindsphereException
200 - successful operation
400 - bad request
401 - unauthorized
0 - unexpected error
entityId - entity instance idoffset - number of files to skiplimit - maximum number of files to return (max 200)count - return total number of matching filesorder - sort based on supported fields - see order syntax for more details (name, path, type, size, timestamp, created, updated)filter - filter based on supported fields - see filter syntax for more details (name, path, type, size, timestamp, created, updated)
example: String filter = "name eq 'unitTest'" or String filter = "name%20eq%20'unitTest'"MindsphereException - thrown if an error occurs while attempting to invoke the APIpublic boolean deleteFile(String entityId,
String filepath)
throws MindsphereException
204 - deleted
401 - unauthorized
404 - not found
0 - unexpected error
entityId - entityId to which file belongsfilepath - path of the directory where file needs to be storedMindsphereException - thrown if an error occurs while attempting to invoke the API