Package org.purl.sword.base

Examples of org.purl.sword.base.SWORDErrorException


      // we are dealing with a default media-link, indicating that something
      // is wrong

      // FIXME: what do we actually do about this situation?
      // throwing an error for the time being
      throw new SWORDErrorException(DSpaceSWORDErrorCodes.MEDIA_UNAVAILABLE, "The media link you requested is not available");
    }

    // extract the thing that we are trying to get a media entry on
    DSpaceObject dso = urlManager.extractDSpaceObject(url);

    // now, the media entry should always be to an actual file, so we only care that this is a bitstream
    if (!(dso instanceof Bitstream))
    {
      throw new SWORDErrorException(DSpaceSWORDErrorCodes.BAD_URL, "The url you provided does not resolve to an appropriate object");
    }

    // now construct the atom entry for the bitstream
    DSpaceATOMEntry dsatom = new BitstreamEntryGenerator(swordService);
    SWORDEntry entry = dsatom.getSWORDEntry(dso);
View Full Code Here


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

    // 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.isSupportedMediaType(deposit.getPackaging(), this.collection))
    {
      log.error("Unacceptable packaging type detected: " + deposit.getPackaging() + "for collection" + collection.getID());
      throw new SWORDErrorException(ErrorCodes.ERROR_CONTENT,
          "Unacceptable packaging type in deposit request: " + deposit.getPackaging());
    }

    // Obtain the relevant ingester from the factory
    SWORDIngester si = SWORDIngesterFactory.getInstance(context, deposit, collection);
View Full Code Here

TOP

Related Classes of org.purl.sword.base.SWORDErrorException

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.