Examples of SwordError


Examples of org.swordapp.server.SwordError

    {
        // determine if this is an acceptable file format
        if (!swordConfig.isAcceptableContentType(context, deposit.getMimeType(), dso))
        {
            log.error("Unacceptable content type detected: " + deposit.getMimeType() + " for object " + dso.getID());
            throw new SwordError(UriRegistry.ERROR_CONTENT,
                    "Unacceptable content type in deposit request: " + deposit.getMimeType());
        }

        // determine if this is an acceptable packaging type for the deposit
        // if not, we throw a 415 HTTP error (Unsupported Media Type, ERROR_CONTENT)
        if (!swordConfig.isAcceptedPackaging(deposit.getPackaging(), dso))
        {
            log.error("Unacceptable packaging type detected: " + deposit.getPackaging() + " for object " + dso.getID());
            throw new SwordError(UriRegistry.ERROR_CONTENT,
                    "Unacceptable packaging type in deposit request: " + deposit.getPackaging());
        }
    }
View Full Code Here

Examples of org.swordapp.server.SwordError

      return derivedResources;
    }
    catch (ZipException e)
    {
      throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, "unable to unzip provided package", e);
    }
    catch (IOException e)
    {
      throw new DSpaceSwordException(e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.