Package jcmdline.dto

Examples of jcmdline.dto.PdfFile


      }
     
      //-f
          PdfFileParam fOption = (PdfFileParam) cmdLineHandler.getOption(DocumentInfoParsedCommand.F_ARG);          
          if(fOption.isSet()){
            PdfFile inputFile = fOption.getPdfFile();
            ValidationUtility.assertValidPdfExtension(inputFile.getFile().getName());
              parsedCommandDTO.setInputFile(FileUtility.getPdfFile(inputFile));                 
          }else{
            throw new ParseException(ParseException.ERR_NO_F)
          }
         
View Full Code Here


          }
         
          //-f1
      PdfFileParam f1Option = (PdfFileParam) cmdLineHandler.getOption(MixParsedCommand.F1_ARG);          
          if(f1Option.isSet()){
            PdfFile firstFile = f1Option.getPdfFile();
             //checking extension
              ValidationUtility.assertValidPdfExtension(firstFile.getFile().getName());
              parsedCommandDTO.setFirstInputFile(FileUtility.getPdfFile(firstFile));                               
          }else{
            throw new ParseException(ParseException.ERR_NO_F1)
          }
         
          //-f2
          PdfFileParam f2Option = (PdfFileParam) cmdLineHandler.getOption(MixParsedCommand.F2_ARG);          
          if(f2Option.isSet()){
            PdfFile secondFile = f2Option.getPdfFile();
             //checking extension
              ValidationUtility.assertValidPdfExtension(secondFile.getFile().getName());
               parsedCommandDTO.setSecondInputFile(FileUtility.getPdfFile(secondFile));
          }else{
            throw new ParseException(ParseException.ERR_NO_F2)
          }          
 
View Full Code Here

      if(fOption.isSet() || dOption.isSet()){
        //-f
            if(fOption.isSet()){
          //validate file extensions
              for(Iterator fIterator = fOption.getPdfFiles().iterator(); fIterator.hasNext();){
                PdfFile currentFile = (PdfFile) fIterator.next();
                ValidationUtility.assertValidPdfExtension(currentFile.getFile().getName());             
              }
              parsedCommandDTO.setInputFileList(FileUtility.getPdfFiles(fOption.getPdfFiles()));
            }
            //-d
        if ((dOption.isSet())){
View Full Code Here

      if(lOption.isSet() || fOption.isSet() || dOption.isSet()){
        if(lOption.isSet() ^ fOption.isSet() ^ dOption.isSet()){
          if(fOption.isSet()){
            //validate file extensions
            for(Iterator fIterator = fOption.getPdfFiles().iterator(); fIterator.hasNext();){
              PdfFile currentFile = (PdfFile) fIterator.next();
                  if (!((currentFile.getFile().getName().toLowerCase().endsWith(PDF_EXTENSION)) && (currentFile.getFile().getName().length()>PDF_EXTENSION.length()))){
                    throw new ParseException(ParseException.ERR_IN_NOT_PDF, new String[]{currentFile.getFile().getPath()});
                  }
                }
            parsedCommandDTO.setInputFileList(FileUtility.getPdfFiles(fOption.getPdfFiles()));
          }else if(lOption.isSet()){
            if(lOption.getFile().getPath().toLowerCase().endsWith(CSV_EXTENSION) || lOption.getFile().getPath().toLowerCase().endsWith(XML_EXTENSION)){
View Full Code Here

TOP

Related Classes of jcmdline.dto.PdfFile

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.