public class FilesClient extends MindsphereAPIClient
| Modifier and Type | Class and Description |
|---|---|
static class |
FilesClient.ClientBuilder |
MindsphereAPIClient.Builder<T extends MindsphereAPIClient.Builder<T>>credentials, restClientConfig, restTemplate| Constructor and Description |
|---|
FilesClient(FilesClient.ClientBuilder builder) |
| Modifier and Type | Method and Description |
|---|---|
static FilesClient.ClientBuilder |
builder() |
void |
deleteFile(DeleteFileRequest requestObject)
Delete a file.
|
void |
deleteFile(String ifMatch,
String fileId)
Delete a file.
|
byte[] |
downloadFile(DownloadFileRequest requestObject)
Returns a file by its id
Returns a file by its id
|
byte[] |
downloadFile(String fileId)
Returns a file by its id
Returns a file by its id
|
FileMetadataResource |
getFile(GetFileRequest requestObject)
Returns a file's metadata by its id
Returns a file's metadata by its id
|
FileMetadataResource |
getFile(String fileId,
String ifNoneMatch)
Returns a file's metadata by its id
Returns a file's metadata by its id
|
FileMetadataListResource |
listFiles(Integer page,
Integer size,
String sort,
String filter,
String ifNoneMatch)
Get metadata of uploaded files.
|
FileMetadataListResource |
listFiles(ListFilesRequest requestObject)
Get metadata of uploaded files.
|
FileMetadataResource |
replaceFile(ReplaceFileRequest requestObject)
Update a file
Update a previously uploaded file * Max file size is 5 MB.
|
FileMetadataResource |
replaceFile(String ifMatch,
String fileId,
File file,
String name,
String scope,
String description)
Update a file
Update a previously uploaded file * Max file size is 5 MB.
|
FileMetadataResource |
uploadFile(File file,
String name,
String scope,
String description)
Upload files to be used in Asset Management.
|
FileMetadataResource |
uploadFile(UploadFileRequest requestObject)
Upload files to be used in Asset Management.
|
public FilesClient(FilesClient.ClientBuilder builder)
public static FilesClient.ClientBuilder builder()
public void deleteFile(DeleteFileRequest requestObject) throws MindsphereException
204 - File has been successfully deleted
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
412 - File changed in the background
500 - Server error, for more information see errorcode and message
requestObject - - Object of type DeleteFileRequest {Parameters are If-Match*,fileId*}MindsphereException - if an error occurs while attempting to invoke the APIpublic byte[] downloadFile(DownloadFileRequest requestObject) throws MindsphereException
200 - Returns the file
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
406 - The resource cannot be represented in the format that would be acceptable to the user agent
500 - Server error, for more information see errorcode and message
requestObject - - Object of type DownloadFileRequest {Parameters are fileId*}MindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataResource getFile(GetFileRequest requestObject) throws MindsphereException
200 - Returns the file's metadata
304 - Resource have not been modified
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
500 - Server error, for more information see errorcode and message
requestObject - - Object of type GetFileRequest {Parameters are fileId*,If-None-Match}MindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataListResource listFiles(ListFilesRequest requestObject) throws MindsphereException
200 - Metadata of files visible for the tenant
304 - Resource have not been modified
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
requestObject - - Object of type ListFilesRequest {Parameters are page,size,sort,filter,If-None-Match}MindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataResource replaceFile(ReplaceFileRequest requestObject) throws MindsphereException
200 - File has been successfully updated
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
412 - File is changed in the background
500 - Server error, for more information see errorcode and message
requestObject - - Object of type ReplaceFileRequest {Parameters are If-Match*,fileId*,file*,name*,scope*,description}MindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataResource uploadFile(UploadFileRequest requestObject) throws MindsphereException
201 - File has been successfully uploaded
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
requestObject - - Object of type UploadFileRequest {Parameters are file*,name*,scope,description}MindsphereException - if an error occurs while attempting to invoke the APIpublic void deleteFile(String ifMatch,
String fileId)
throws MindsphereException
204 - File has been successfully deleted
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
412 - File changed in the background
500 - Server error, for more information see errorcode and message
ifMatch - Last known version to facilitate optimistic lockingfileId - Unique identifier of the file.MindsphereException - if an error occurs while attempting to invoke the APIpublic byte[] downloadFile(String fileId)
throws MindsphereException
200 - Returns the file
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
406 - The resource cannot be represented in the format that would be acceptable to the user agent
500 - Server error, for more information see errorcode and message
fileId - Unique identifier of the file.MindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataResource getFile(String fileId, String ifNoneMatch) throws MindsphereException
200 - Returns the file's metadata
304 - Resource have not been modified
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
500 - Server error, for more information see errorcode and message
fileId - Unique identifier of the file.ifNoneMatch - ETag hash of previous request to allow cachingMindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataListResource listFiles(Integer page, Integer size, String sort, String filter, String ifNoneMatch) throws MindsphereException
200 - Metadata of files visible for the tenant
304 - Resource have not been modified
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
page - Specifies the requested page indexsize - Specifies the number of elements in a pagesort - Specifies the ordering of returned elementsfilter - Specifies the additional filtering criteriaifNoneMatch - ETag hash of previous request to allow cachingMindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataResource replaceFile(String ifMatch, String fileId, File file, String name, String scope, String description) throws MindsphereException
200 - File has been successfully updated
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
404 - File not found
412 - File is changed in the background
500 - Server error, for more information see errorcode and message
ifMatch - Last known version to facilitate optimistic lockingfileId - Unique identifier of the file.file - The file to upload. The file size cannot be more than 5 MB.name - The name of the filescope - The scope of the filedescription - The description of the fileMindsphereException - if an error occurs while attempting to invoke the APIpublic FileMetadataResource uploadFile(File file, String name, String scope, String description) throws MindsphereException
201 - File has been successfully uploaded
400 - Invalid request
401 - User is not authenticated
403 - User is not authorized for request
500 - Server error, for more information see errorcode and message
file - The file to upload. The file size cannot be more than 5 MB.name - The name of the filescope - The scope of the filedescription - The description of the fileMindsphereException - if an error occurs while attempting to invoke the API