public class FileServiceClient extends MindsphereAPIClient
Modifier and Type | Class and Description |
---|---|
static class |
FileServiceClient.ClientBuilder |
MindsphereAPIClient.Builder<T extends MindsphereAPIClient.Builder<T>>
credentials, restClientConfig, restTemplate
Constructor and Description |
---|
FileServiceClient(FileServiceClient.ClientBuilder builder) |
Modifier and Type | Method and Description |
---|---|
void |
abortMultiPartUpload(PutFileRequest request)
Abort a multi part file upload.
|
static FileServiceClient.ClientBuilder |
builder() |
void |
completeMultiPartUpload(PutFileRequest request)
Complete a multi part file upload.
|
void |
createMultiPartFile(PutFileRequest request)
Create a new multi part file upload.
|
void |
deleteFile(DeleteFileRequest requestObject)
delete a file
Delete a file for the specified entity and path.
|
void |
deleteFile(String entityId,
String filepath)
delete a file
Delete a file for the specified entity and path.
|
byte[] |
getFile(GetFileRequest requestObject)
read a file
Read a file for the specified entity and path
|
byte[] |
getFile(String entityId,
String filepath,
Integer ifNoneMatch)
read a file
Read a file for the specified entity and path
|
byte[] |
getFile(String entityId,
String filepath,
Integer ifNoneMatch,
String range)
read a file
Read a file for the specified entity and path
|
List<Fileslist> |
getFileList(GetFileListRequest requestObject)
list multi part uploads
List multi part uploads
|
List<Fileslist> |
getFileList(String entityId,
String filepath)
list multi part uploads
List multi part uploads
|
void |
initiateMultiPartUpload(PutFileRequest request)
Initiate a multi part file upload.
|
void |
putFile(byte[] file,
String entityId,
String filepath,
Integer part,
String upload,
Integer ifMatch,
String timestamp,
String description,
String type)
write a file
Create or update a file for the specified entity and path, with the provided content.
|
void |
putFile(byte[] file,
String entityId,
String filepath,
Integer ifMatch,
String timestamp,
String description,
String type)
write a file
Create or update a file for the specified entity and path, with the provided content.
|
void |
putFile(PutFileRequest requestObject)
write a file
Create or update a file for the specified entity and path, with the provided content.
|
List<FileResponse> |
searchFiles(SearchFilesRequest requestObject)
search files
Search files for the specified entity.
|
List<FileResponse> |
searchFiles(String entityId,
BigDecimal offset,
Integer limit,
Boolean count,
String order,
String filter)
search files Search files for the specified entity.
|
void |
updateMultiPartFile(PutFileRequest request)
Update an existing multi part file upload.
|
public FileServiceClient(FileServiceClient.ClientBuilder builder)
public static FileServiceClient.ClientBuilder builder()
public void deleteFile(DeleteFileRequest requestObject) throws MindsphereException
204 - deleted
401 - unauthorized
404 - not found
0 - unexpected error
requestObject
- - Object of type DeleteFileRequest {Parameters are entityId*,filepath*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic byte[] getFile(GetFileRequest requestObject) throws MindsphereException
200 - file content
206 - Partial Content of the file
304 - not modfied
401 - unauthorized
404 - not found
416 - Range Not Satisfiable
0 - unexpected error
requestObject
- - Object of type GetFileRequest {Parameters are entityId*,filepath*,If-None-Match,range}MindsphereException
- if an error occurs while attempting to invoke the APIpublic List<Fileslist> getFileList(GetFileListRequest requestObject) throws MindsphereException
200 - multi part list
400 - bad request
401 - unauthorized
404 - not found
0 - unexpected error
requestObject
- - Object of type GetFileListRequest {Parameters are entityId*,filepath*}MindsphereException
- if an error occurs while attempting to invoke the APIpublic void putFile(PutFileRequest requestObject) throws MindsphereException
201 - created
204 - updated
400 - bad request
401 - unauthorized
404 - not found
409 - conflict
0 - Unexpected error
requestObject
- - Object of type PutFileRequest {Parameters are file*,entityId*,filepath*,part,upload,If-Match,timestamp,description,type}MindsphereException
- if an error occurs while attempting to invoke the APIpublic List<FileResponse> searchFiles(SearchFilesRequest requestObject) throws MindsphereException
200 - successful operation
400 - bad request
401 - unauthorized
0 - unexpected error
requestObject
- - Object of type SearchFilesRequest {Parameters are entityId*,offset,limit,count,order,filter}MindsphereException
- if an error occurs while attempting to invoke the APIpublic void deleteFile(String entityId, String filepath) throws MindsphereException
204 - deleted
401 - unauthorized
404 - not found
0 - unexpected error
entityId
- unique identifier of the entityfilepath
- unique identifier of the fileMindsphereException
- if an error occurs while attempting to invoke the APIpublic byte[] getFile(String entityId, String filepath, Integer ifNoneMatch) throws MindsphereException
200 - file content
206 - Partial Content of the file
304 - not modfied
401 - unauthorized
404 - not found
416 - Range Not Satisfiable
0 - unexpected error
entityId
- Id to instance of entityfilepath
- path of the file along with filenameifNoneMatch
- ETag of the latest version (not supported in this release)MindsphereException
- if an error occurs while attempting to invoke the APIpublic byte[] getFile(String entityId, String filepath, Integer ifNoneMatch, String range) throws MindsphereException
200 - file content
206 - Partial Content of the file
304 - not modfied
401 - unauthorized
404 - not found
416 - Range Not Satisfiable
0 - unexpected error
entityId
- Id to instance of entityfilepath
- path of the file along with filenameifNoneMatch
- ETag of the latest version (not supported in this release)range
- Part of a file to return in Bytes, eg bytes=200-600MindsphereException
- if an error occurs while attempting to invoke the APIpublic List<Fileslist> getFileList(String entityId, String filepath) throws MindsphereException
200 - multi part list
400 - bad request
401 - unauthorized
404 - not found
0 - unexpected error
entityId
- Id to instance of entityfilepath
- path of the fileMindsphereException
- if an error occurs while attempting to invoke the APIpublic void putFile(byte[] file, String entityId, String filepath, Integer part, String upload, Integer ifMatch, String timestamp, String description, String type) throws MindsphereException
201 - created
204 - updated
400 - bad request
401 - unauthorized
404 - not found
409 - conflict
0 - Unexpected error
file
- the file attached contententityId
- unique identifier of the entityfilepath
- url path of the file along with filenamepart
- Part number to uploadupload
- Upload status to start, complete, and abort multi-part uploadsifMatch
- ETag of the latest version for optimistic lockingtimestamp
- file timestampdescription
- description of the filetype
- type of the fileMindsphereException
- if an error occurs while attempting to invoke the APIpublic List<FileResponse> searchFiles(String entityId, BigDecimal 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)MindsphereException
- if an error occurs while attempting to invoke the APIpublic void putFile(byte[] file, String entityId, String filepath, Integer ifMatch, String timestamp, String description, String type) throws MindsphereException
201 - created
204 - updated
400 - bad request
401 - unauthorized
404 - not found
409 - conflict
0 - Unexpected error
file
- the file attached contententityId
- unique identifier of the entityfilepath
- url path of the file along with filenameifMatch
- ETag of the latest version for optimistic lockingtimestamp
- file timestampdescription
- description of the filetype
- type of the fileMindsphereException
- if an error occurs while attempting to invoke the APIpublic void initiateMultiPartUpload(PutFileRequest request) throws MindsphereException
request
- PutFileRequest object with entity id and filepath as mandatory parameters.
IfMatch value need to be passed for re-initiation of an existing multi part file upload.MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic void createMultiPartFile(PutFileRequest request) throws MindsphereException
request
- PutFileRequest object with file, part, entity id and filepath as mandatory parameters.MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic void updateMultiPartFile(PutFileRequest request) throws MindsphereException
request
- PutFileRequest object with file, part, ifMatch, entity id and filepath as mandatory parameters.MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic void completeMultiPartUpload(PutFileRequest request) throws MindsphereException
request
- PutFileRequest object with entity id and filepath as mandatory parameters.
IfMatch value needs to be passed if an existing Multi part File Upload is being completed.MindsphereException
- thrown if an error occurs while attempting to invoke the APIpublic void abortMultiPartUpload(PutFileRequest request) throws MindsphereException
request
- PutFileRequest object with entity id and filepath as mandatory parameters.
IfMatch value needs to be passed if an existing Multi part File Upload is being aborted.MindsphereException
- thrown if an error occurs while attempting to invoke the API