Class BinariesApiImpl
java.lang.Object
com.cumulocity.sdk.client.inventory.BinariesApiImpl
- All Implemented Interfaces:
BinariesApi
-
Constructor Summary
ConstructorsConstructorDescriptionBinariesApiImpl(RestConnector restConnector, InventoryRepresentation inventoryRepresentation) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteFile(GId containerId) Remove a managed object and its stored file by a given ID.downloadFile(GId id) Download a stored file (managed object) by a given ID.replaceFile(GId containerId, String contentType, InputStream fileStream) Upload and replace the attached file (binary) of a specific managed object by a given ID.uploadFile(ManagedObjectRepresentation container, byte[] bytes) Upload a file (binary) with content-type of "application/octet-stream" (default).uploadFile(ManagedObjectRepresentation container, byte[] bytes, jakarta.ws.rs.core.MediaType mediaType) Upload a file (binary) with custom content-type.uploadFile(ManagedObjectRepresentation container, InputStream inputStream) Upload a file (binary) with content-type of "application/octet-stream" (default).uploadFile(ManagedObjectRepresentation container, InputStream inputStream, jakarta.ws.rs.core.MediaType mediaType) Upload a file (binary) with custom content-type.
-
Constructor Details
-
BinariesApiImpl
public BinariesApiImpl(RestConnector restConnector, InventoryRepresentation inventoryRepresentation)
-
-
Method Details
-
uploadFile
public ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, byte[] bytes) throws SDKException Description copied from interface:BinariesApiUpload a file (binary) with content-type of "application/octet-stream" (default).- Specified by:
uploadFilein interfaceBinariesApi- Parameters:
container- ManagedObjectRepresentation with binary metadatabytes- file (binary) to be uploaded- Returns:
- ManagedObjectRepresentation with binary metadata
- Throws:
SDKException- if upload fails
-
uploadFile
public ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, byte[] bytes, jakarta.ws.rs.core.MediaType mediaType) throws SDKException Description copied from interface:BinariesApiUpload a file (binary) with custom content-type.- Specified by:
uploadFilein interfaceBinariesApi- Parameters:
container- ManagedObjectRepresentation with binary metadatabytes- file (binary) to be uploadedmediaType- content-type of file (binary)- Returns:
- ManagedObjectRepresentation with binary metadata
- Throws:
SDKException- if upload fails
-
uploadFile
public ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, InputStream inputStream) throws SDKException Description copied from interface:BinariesApiUpload a file (binary) with content-type of "application/octet-stream" (default).- Specified by:
uploadFilein interfaceBinariesApi- Parameters:
container- ManagedObjectRepresentation with binary metadatainputStream- file (binary) to be uploaded- Returns:
- ManagedObjectRepresentation with binary metadata
- Throws:
SDKException- if upload fails
-
uploadFile
public ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, InputStream inputStream, jakarta.ws.rs.core.MediaType mediaType) throws SDKException Description copied from interface:BinariesApiUpload a file (binary) with custom content-type.- Specified by:
uploadFilein interfaceBinariesApi- Parameters:
container- ManagedObjectRepresentation with binary metadatainputStream- file (binary) to be uploadedmediaType- content-type of file (binary)- Returns:
- ManagedObjectRepresentation with binary metadata
- Throws:
SDKException- if upload fails
-
replaceFile
public ManagedObjectRepresentation replaceFile(GId containerId, String contentType, InputStream fileStream) throws SDKException Description copied from interface:BinariesApiUpload and replace the attached file (binary) of a specific managed object by a given ID.- Specified by:
replaceFilein interfaceBinariesApi- Parameters:
containerId- ID of managed objectcontentType- content-type of file (binary)fileStream- file (binary) to be uploaded- Returns:
- ManagedObjectRepresentation with binary metadata
- Throws:
SDKException- if upload fails
-
deleteFile
Description copied from interface:BinariesApiRemove a managed object and its stored file by a given ID.- Specified by:
deleteFilein interfaceBinariesApi- Parameters:
containerId- ID of managed object- Throws:
SDKException- if delete fails
-
downloadFile
Description copied from interface:BinariesApiDownload a stored file (managed object) by a given ID.- Specified by:
downloadFilein interfaceBinariesApi- Parameters:
id- ID of managed object- Returns:
- file (binary)
- Throws:
SDKException- if download fails
-