Package com.baasbox.exception

Examples of com.baasbox.exception.DocumentIsNotAnImageException


      } catch (InvalidModelException e1) {
        throw new DocumentIsNotAFileException("The id " + id + " is not a file");
      }
      if (file==null) throw new DocumentNotFoundException();
      //is the file an image?
      if (!StorageUtils.docIsAnImage(file)) throw new DocumentIsNotAnImageException("The file " + id + " is not an image");
      //are the dimensions allowed?
      //the check is delegated to the caller
      String sizePattern= dimensions.toString();
      try{
        FileDao dao=FileDao.getInstance();
View Full Code Here


  private static byte[] getResizedPicture(String fileAssetName, ImageDimensions dimensions) throws SqlInjectionException, DocumentIsNotAnImageException, DocumentIsNotAFileException, IOException, InvalidSizePatternException {
    //load the document
    FileAssetDao dao = FileAssetDao.getInstance();
    ODocument asset=dao.getByName(fileAssetName);
    if (asset==null) return null;
    if (!StorageUtils.docIsAnImage(asset)) throw new DocumentIsNotAnImageException();
   
    //check if the image has been previously resized
    String sizePattern= dimensions.toString();
    try{
      byte[] resizedImage = dao.getStoredResizedPicture( asset,  sizePattern);
View Full Code Here

TOP

Related Classes of com.baasbox.exception.DocumentIsNotAnImageException

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.