Package com.flagstone.transform

Examples of com.flagstone.transform.Movie


      // the date to associate with the embedded, rewritten URLs:
      String datespec = result.getCaptureTimestamp();
      SWFUrlRewriter rw = new SWFUrlRewriter(uriConverter, url, datespec);

      // OK, try to read the input movie:
      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:
View Full Code Here


      throw new BetterRequestException(UrlOperations.computeIdentityUrl(wbRequest));
    }
  }

  private Movie getRobustMovie(int decodeRule) {
    Movie movie = new Movie();

    DecoderRegistry registry = DecoderRegistry.getDefault();
    RobustMovieDecoder decoder = new RobustMovieDecoder();
    decoder.setDelegate(registry.getMovieDecoder());
    decoder.setDecodeRule(decodeRule);
    registry.setMovieDecoder(decoder);
    movie.setRegistry(registry);

    return movie;
  }
View Full Code Here

TOP

Related Classes of com.flagstone.transform.Movie

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.