Interface BinariesApi
- All Known Implementing Classes:
BinariesApiImpl
public interface BinariesApi
API to perform operations to store, retrieve and delete binaries. One binary can store only one file.
Together with the binary, a managed object is created which acts as a metadata information for the binary.
-
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.
-
Method Details
-
uploadFile
ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, byte[] bytes) throws SDKException Upload a file (binary) with content-type of "application/octet-stream" (default).- Parameters:
container- ManagedObjectRepresentation with binary metadatabytes- file (binary) to be uploaded- Returns:
- ManagedObjectRepresentation with binary metadata
- Throws:
SDKException- if upload fails
-
uploadFile
ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, byte[] bytes, jakarta.ws.rs.core.MediaType mediaType) throws SDKException Upload a file (binary) with custom content-type.- 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
ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, InputStream inputStream) throws SDKException Upload a file (binary) with content-type of "application/octet-stream" (default).- Parameters:
container- ManagedObjectRepresentation with binary metadatainputStream- file (binary) to be uploaded- Returns:
- ManagedObjectRepresentation with binary metadata
- Throws:
SDKException- if upload fails
-
uploadFile
ManagedObjectRepresentation uploadFile(ManagedObjectRepresentation container, InputStream inputStream, jakarta.ws.rs.core.MediaType mediaType) throws SDKException Upload a file (binary) with custom content-type.- 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
ManagedObjectRepresentation replaceFile(GId containerId, String contentType, InputStream fileStream) throws SDKException Upload and replace the attached file (binary) of a specific managed object by a given ID.- 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
-
downloadFile
Download a stored file (managed object) by a given ID.- Parameters:
id- ID of managed object- Returns:
- file (binary)
- Throws:
SDKException- if download fails
-
deleteFile
Remove a managed object and its stored file by a given ID.- Parameters:
containerId- ID of managed object- Throws:
SDKException- if delete fails
-