Package org.purl.sword.client

Examples of org.purl.sword.client.Status


    public ServiceDocument getServiceDocument() throws HttpException, SWORDClientException
    {
        log.info("Getting Sword Service Document from " + serviceDocUrl);
        ServiceDocument sd = client.getServiceDocument(serviceDocUrl, onBehalfOf);

        Status status = client.getStatus();

        if (status.getCode() == 200)
        {
            log.info("Sword Service Document successfully retrieved from " + serviceDocUrl);
            return sd;
        }
        else
View Full Code Here


     */
    public String sendMessage() throws SWORDClientException, HttpException
    {
        message.setFilepath(filename);
        DepositResponse resp = client.postFile(message);
        Status status = client.getStatus();

    if ((status.getCode() == 201) || (status.getCode() == 202))
        {
      SWORDEntry se = resp.getEntry();
            return se.getId();
        }
        else
        {
            String error = status.getCode() + " " + status.getMessage() + " - " + resp.getEntry().getSummary().getContent();
      log.info("Error depositing Sword package : " + error);
            throw new HttpException(error);
        }

    }
View Full Code Here

TOP

Related Classes of org.purl.sword.client.Status

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.