Package org.archive.wayback.exception

Examples of org.archive.wayback.exception.BadContentException


    // many clients...)
    int code = resource.getStatusCode();
    // Only return legit status codes -- don't return any minus
    // codes, etc.
    if (code <= HttpServletResponse.SC_CONTINUE) {
      throw new BadContentException("Bad status code " + code);
    }
    httpResponse.setStatus(code);
  }
View Full Code Here


    // many clients...)
    int code = resource.getStatusCode();
    // Only return legit status codes -- don't return any minus
    // codes, etc.
    if (code <= HttpServletResponse.SC_CONTINUE) {
      throw new BadContentException("Bad status code " + code);
    }
    httpResponse.setStatus(code);
  }
View Full Code Here

      Movie movie = getRobustMovie(RobustMovieDecoder.DECODE_RULE_NULLS);

      try {
        movie.decodeFromStream(payloadResource);
      } catch (DataFormatException e1) {
        throw new BadContentException(e1.getLocalizedMessage());
      }
      Movie outMovie = new Movie(movie);

      List<MovieTag> inTags = movie.getObjects();
      ArrayList<MovieTag> outTags = new ArrayList<MovieTag>();
      for (MovieTag tag : inTags) {
        outTags.add(rewriteTag(rw, tag));
      }
      outMovie.setObjects(outTags);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      try {
        outMovie.encodeToStream(baos);
      } catch (DataFormatException e) {
        throw new BadContentException(e.getLocalizedMessage());
      }

      // put the new corrected length:
      headers.put(HttpHeaderOperation.HTTP_LENGTH_HEADER,
          String.valueOf(baos.size()));
View Full Code Here

TOP

Related Classes of org.archive.wayback.exception.BadContentException

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.