public class AssetFileClient extends MindsphereAPIClient
Modifier and Type | Class and Description |
---|---|
static class |
AssetFileClient.ClientBuilder |
MindsphereAPIClient.Builder<T extends MindsphereAPIClient.Builder<T>>
credentials, restClientConfig, restTemplate
Modifier | Constructor and Description |
---|---|
protected |
AssetFileClient(AssetFileClient.ClientBuilder builder) |
Modifier and Type | Method and Description |
---|---|
static AssetFileClient.ClientBuilder |
builder() |
AssetFiles |
getAssetFiles()
Get metadata of uploaded files.
|
AssetFiles |
getAssetFiles(Integer page,
Integer size)
Get metadata of uploaded files.
|
AssetFiles |
getAssetFiles(Integer page,
Integer size,
String sort,
String filter,
String ifNoneMatch)
Get metadata of uploaded files.
|
AssetFiles |
getAssetFiles(String sort,
String filter)
Get metadata of uploaded files.
|
String |
getFileContentById(String fileId)
Returns a file by its id
|
FileMetadataResource |
getFileMetadataById(String fileId)
Returns a file's metadata by its id
|
FileMetadataResource |
getFileMetadataById(String fileId,
String ifNoneMatch)
Returns a file's metadata by its id
|
FileMetadataResource |
uploadAssetFiles(File file,
String name)
Upload files to be used in Asset Management.
|
FileMetadataResource |
uploadAssetFiles(File file,
String name,
String description)
Upload files to be used in Asset Management.
|
protected AssetFileClient(AssetFileClient.ClientBuilder builder)
public static AssetFileClient.ClientBuilder builder()
public FileMetadataResource uploadAssetFiles(File file, String name, 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 filedescription
- The description of the fileMindsphereException
- if an error occurs while attempting to invoke the APIpublic FileMetadataResource uploadAssetFiles(File file, String name) 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 fileMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetFiles getAssetFiles(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 criteria, e.g. "{\"name\":\"file_name\"}" or as an encoded string, "%7B%22name%22:%22file_name%22%7D"ifNoneMatch
- ETag hash of previous request to allow cachingMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetFiles getAssetFiles() 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
MindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetFiles getAssetFiles(Integer page, Integer size) 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 pageMindsphereException
- if an error occurs while attempting to invoke the APIpublic AssetFiles getAssetFiles(String sort, String filter) 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
sort
- Specifies the ordering of returned elementsfilter
- Specifies the additional filtering criteria, e.g. "{\"name\":\"file_name\"}" or as an encoded string, "%7B%22name%22:%22file_name%22%7D"MindsphereException
- if an error occurs while attempting to invoke the APIpublic String getFileContentById(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 getFileMetadataById(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 FileMetadataResource getFileMetadataById(String fileId) 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.MindsphereException
- if an error occurs while attempting to invoke the API