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 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 metadata
        bytes - 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 metadata
        bytes - file (binary) to be uploaded
        mediaType - content-type of file (binary)
        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 metadata
        inputStream - file (binary) to be uploaded
        mediaType - 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 object
        contentType - 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