Examples of ByteSourceInputStream


Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

      String contentType = resp.getHeader("Content-Type");
      if (contentType == null || contentType.toLowerCase().startsWith("image/")) {
        // Unspecified or unknown image mime type.
        try {
          ImageFormat imageFormat = Sanselan
          .guessFormat(new ByteSourceInputStream(resp.getResponse(),
              request.getUri().getPath()));
          if (imageFormat == ImageFormat.IMAGE_FORMAT_UNKNOWN) {
            logger.log(Level.INFO, "Unable to sanitize unknown image type "
                + request.getUri().toString());
            return true;
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

        return response;
      }

      // Content header checking is fast so this is fine to do for every response.
      ImageFormat imageFormat = Sanselan
          .guessFormat(new ByteSourceInputStream(response.getResponse(), uri.getPath()));

      if (imageFormat == ImageFormat.IMAGE_FORMAT_UNKNOWN) {
        return enforceUnreadableImageRestrictions(uri, response);
      }
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

      String contentType = resp.getHeader("Content-Type");
      if (contentType == null || contentType.toLowerCase().startsWith("image/")) {
        // Unspecified or unknown image mime type.
        try {
          ImageFormat imageFormat = Sanselan
          .guessFormat(new ByteSourceInputStream(resp.getResponse(),
              request.getUri().getPath()));
          if (imageFormat == ImageFormat.IMAGE_FORMAT_UNKNOWN) {
            logger.log(Level.INFO, "Unable to sanitize unknown image type "
                + request.getUri().toString());
            return true;
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

        return response;
      }

      // Content header checking is fast so this is fine to do for every response.
      ImageFormat imageFormat = Sanselan
          .guessFormat(new ByteSourceInputStream(response.getResponse(), uri.getPath()));

      if (imageFormat == ImageFormat.IMAGE_FORMAT_UNKNOWN) {
        return enforceUnreadableImageRestrictions(uri, response);
      }
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

   * @return An instance of ICC_Profile or null if the image contains no ICC
   *         profile..
   */
  public static ICC_Profile getICCProfile(InputStream is, String filename,
      Map params) throws ImageReadException, IOException {
    return getICCProfile(new ByteSourceInputStream(is, filename), params);
  }
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

   * @return An instance of ImageInfo.
   * @see ImageInfo
   */
  public static ImageInfo getImageInfo(InputStream is, String filename)
      throws ImageReadException, IOException {
    return getImageInfo(new ByteSourceInputStream(is, filename), null);
  }
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

   * @return An instance of ImageInfo.
   * @see ImageInfo
   */
  public static ImageInfo getImageInfo(InputStream is, String filename,
      Map params) throws ImageReadException, IOException {
    return getImageInfo(new ByteSourceInputStream(is, filename), params);
  }
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

   *            Map of optional parameters, defined in SanselanConstants.
   * @return The width and height of the image.
   */
  public static Dimension getImageSize(InputStream is, String filename,
      Map params) throws ImageReadException, IOException {
    return getImageSize(new ByteSourceInputStream(is, filename), params);
  }
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

   * @return An instance of IImageMetadata.
   * @see IImageMetadata
   */
  public static IImageMetadata getMetadata(InputStream is, String filename,
      Map params) throws ImageReadException, IOException {
    return getMetadata(new ByteSourceInputStream(is, filename), params);
  }
View Full Code Here

Examples of org.apache.sanselan.common.byteSources.ByteSourceInputStream

   *            Filename associated with image data (optional).
   * @return A vector of BufferedImages.
   */
  public static ArrayList getAllBufferedImages(InputStream is, String filename)
      throws ImageReadException, IOException {
    return getAllBufferedImages(new ByteSourceInputStream(is, filename));
  }
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.