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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteFile(GId containerId)
Remove a managed object and its stored file by a given ID.InputStream
downloadFile(GId id)
Download a stored file (managed object) by a given ID.ManagedObjectRepresentation
replaceFile(GId containerId, String contentType, InputStream fileStream)
Upload and replace the attached file (binary) of a specific managed object by a given ID.ManagedObjectRepresentation
uploadFile(ManagedObjectRepresentation container, byte[] bytes)
Upload a file (binary) with content-type of "application/octet-stream" (default).ManagedObjectRepresentation
uploadFile(ManagedObjectRepresentation container, byte[] bytes, javax.ws.rs.core.MediaType mediaType)
Upload a file (binary) with custom content-type.ManagedObjectRepresentation
uploadFile(ManagedObjectRepresentation container, InputStream inputStream)
Upload a file (binary) with content-type of "application/octet-stream" (default).ManagedObjectRepresentation
uploadFile(ManagedObjectRepresentation container, InputStream inputStream, javax.ws.rs.core.MediaType mediaType)
Upload a file (binary) with custom content-type.
-
-
-
Method Detail
-
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, javax.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, javax.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
InputStream downloadFile(GId id) throws SDKException
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
void deleteFile(GId containerId) throws SDKException
Remove a managed object and its stored file by a given ID.- Parameters:
containerId
- ID of managed object- Throws:
SDKException
- if delete fails
-
-