コード例 #1
0
 /*     */ private void createThumb() /*     */ throws ConnectorException /*     */ {
   /* 204 */ this.thumbFile = new File(this.fullCurrentPath, this.fileName);
   /*     */ try {
     /* 206 */ if (!(this.thumbFile.exists())) {
       /* 207 */ File orginFile =
           new File(
               ((ResourceType) this.configuration.getTypes().get(this.type)).getPath()
                   + this.currentFolder,
               this.fileName);
       /*     */
       /* 210 */ if (!(orginFile.exists())) {
         /* 211 */ throw new ConnectorException(117);
         /*     */ }
       /*     */ try
       /*     */ {
         /* 215 */ ImageUtils.createThumb(orginFile, this.thumbFile, this.configuration);
         /*     */ } catch (Exception e) {
         /* 217 */ this.thumbFile.delete();
         /* 218 */ throw new ConnectorException(104, e);
         /*     */ }
       /*     */ }
     /*     */ }
   /*     */ catch (SecurityException e)
   /*     */ {
     /* 224 */ throw new ConnectorException(104, e);
     /*     */ }
   /*     */ }
コード例 #2
0
 /**
  * if thumbs are enabled and thumb file doesn't exists then creates a thumb file.
  *
  * @throws ConnectorException when error occurs.
  */
 private void createThumb() throws ConnectorException {
   this.thumbFile = new File(fullCurrentPath, this.fileName);
   try {
     if (!thumbFile.exists()) {
       File orginFile =
           new File(
               configuration.getTypes().get(this.type).getPath() + this.currentFolder,
               this.fileName);
       if (!orginFile.exists()) {
         throw new ConnectorException(Constants.Errors.CKFINDER_CONNECTOR_ERROR_FILE_NOT_FOUND);
       }
       try {
         ImageUtils.createThumb(orginFile, thumbFile, configuration);
       } catch (Exception e) {
         thumbFile.delete();
         throw new ConnectorException(Constants.Errors.CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED, e);
       }
     }
   } catch (SecurityException e) {
     throw new ConnectorException(Constants.Errors.CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED, e);
   }
 }