Search in sources :

Example 1 with ReceptionResponse

use of com.opentext.ia.sdk.dto.ReceptionResponse in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class InfoArchiveRestClient method ingest.

@Override
public String ingest(InputStream sip) throws IOException {
    ReceptionResponse response = restClient.post(resourceCache.getAipResourceUri(), ReceptionResponse.class, new TextPart("format", "sip_zip"), new BinaryPart("sip", sip, "IASIP.zip"));
    String ingestUri = response.getUri(LINK_INGEST);
    // There was a backwards incompatible change between 4.2 and 4.3 from PUT to POST
    if (resourceCache.isVersionOrEarlier("4.2")) {
        return restClient.put(ingestUri, IngestionResponse.class).getAipId();
    }
    return restClient.post(ingestUri, IngestionResponse.class).getAipId();
}
Also used : ReceptionResponse(com.opentext.ia.sdk.dto.ReceptionResponse) BinaryPart(com.opentext.ia.sdk.support.http.BinaryPart) TextPart(com.opentext.ia.sdk.support.http.TextPart) IngestionResponse(com.opentext.ia.sdk.dto.IngestionResponse)

Aggregations

IngestionResponse (com.opentext.ia.sdk.dto.IngestionResponse)1 ReceptionResponse (com.opentext.ia.sdk.dto.ReceptionResponse)1 BinaryPart (com.opentext.ia.sdk.support.http.BinaryPart)1 TextPart (com.opentext.ia.sdk.support.http.TextPart)1