Package com.baasbox.exception

Examples of com.baasbox.exception.InvalidSizePatternException


    public static byte[] getResizedPicture(String id, int sizeId) throws InvalidSizePatternException, SqlInjectionException, DocumentIsNotAnImageException, DocumentIsNotAFileException, DocumentNotFoundException, IOException, FileTooBigException{
      String sizePattern = "";
      try{
        sizePattern=ImagesConfiguration.IMAGE_ALLOWED_AUTOMATIC_RESIZE_FORMATS.getValueAsString().split(" ")[sizeId];
      }catch (IndexOutOfBoundsException e){
        throw new InvalidSizePatternException("The specified id is out of range.");
      }
      return getResizedPicture (id,sizePattern);
    }
View Full Code Here


          imgDim.heightInPixel=true;       
        }   
        return imgDim;
      }
    }catch (Throwable e){
      throw new InvalidSizePatternException(sizePattern + " is not valid ", e);
    }
    throw new InvalidSizePatternException(sizePattern + " is not valid: missing the '-' character between the width and the height");
  }
View Full Code Here

          output = FileService.getResizedPicture(id, sizeId);
          String[] fileName=((String)doc.field("fileName")).split("\\.");
          filename=fileName[0] + "_" + sizeId + "." + (fileName.length>1?fileName[1]:"");
        }else if (!resizeIsEmpty){
          if (!ImagesConfiguration.IMAGE_ALLOWED_AUTOMATIC_RESIZE_FORMATS.getValueAsString().contains(resize) && !UserService.userCanByPassRestrictedAccess(DbHelper.currentUsername()))
            throw new InvalidSizePatternException("The requested resize format is not allowed");
          ImageDimensions imgDim = StorageUtils.convertPatternToDimensions(resize);
          output = FileService.getResizedPicture(id, imgDim);
          String[] fileName=((String)doc.field("fileName")).split("\\.");
          filename=fileName[0] + "_" + resize + "." + (fileName.length>1?fileName[1]:"");
        }else{
View Full Code Here

    String sizePattern = width + "-" + height;
    return getResizedPicture (fileAssetName,sizePattern);
  }
 
  public static byte[] getResizedPictureInPerc (String fileAssetName, String sizeInPerc) throws SqlInjectionException, IOException, DocumentIsNotAnImageException, DocumentIsNotAFileException, InvalidSizePatternException, OperationDisabledException{
    if (!sizeInPerc.endsWith("%")) throw new InvalidSizePatternException();
    return getResizedPicture (fileAssetName,sizeInPerc);
  }
View Full Code Here

  public static byte[] getResizedPicture (String fileAssetName, int sizeId) throws SqlInjectionException, IOException, InvalidSizePatternException, DocumentIsNotAnImageException, DocumentIsNotAFileException, OperationDisabledException{
    String sizePattern = "";
    try{
      sizePattern=ImagesConfiguration.IMAGE_ALLOWED_AUTOMATIC_RESIZE_FORMATS.getValueAsString().split(" ")[sizeId];
    }catch (IndexOutOfBoundsException e){
      throw new InvalidSizePatternException("The specified id is out of range.");
    }
    return getResizedPicture (fileAssetName,sizePattern);
  }
View Full Code Here

    return getResizedPicture (fileAssetName,sizePattern);
  }
 
  public static byte[] getResizedPicture (String fileAssetName, String sizePattern) throws SqlInjectionException, IOException, InvalidSizePatternException, DocumentIsNotAnImageException, DocumentIsNotAFileException{
    if (!ImagesConfiguration.IMAGE_ALLOWED_AUTOMATIC_RESIZE_FORMATS.getValueAsString().contains(sizePattern))
      throw new InvalidSizePatternException("The requested resize format is not allowed");
    ImageDimensions dimensions = StorageUtils.convertPatternToDimensions(sizePattern);
    return getResizedPicture (fileAssetName,dimensions);
  }
View Full Code Here

TOP

Related Classes of com.baasbox.exception.InvalidSizePatternException

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.