Package org.pdfsam.console.business.dto

Examples of org.pdfsam.console.business.dto.PdfFile


     *
     * @param pdfFile
     * @return a PdfFile
     */
    public static PdfFile getPdfFile(jcmdline.dto.PdfFile pdfFile) {
        return new PdfFile(pdfFile.getFile(), pdfFile.getPassword());
    }
View Full Code Here


     * @return a PdfFile[]
     */
    public static PdfFile[] getPdfFiles(jcmdline.dto.PdfFile[] pdfFiles) {
        ArrayList retVal = new ArrayList();
        for (int i = 0; i < pdfFiles.length; i++) {
            retVal.add(new PdfFile(pdfFiles[i].getFile(), pdfFiles[i].getPassword()));
        }
        return (PdfFile[]) retVal.toArray(new PdfFile[pdfFiles.length]);
    }
View Full Code Here

            // read file
            while ((temp = bufferReader.readLine()) != null) {
                String[] tmpContent = temp.split(",");
                for (int i = 0; i < tmpContent.length; i++) {
                    if (tmpContent[i].trim().length() > 0) {
                        retVal.add(new PdfFile(tmpContent[i], null));
                    }
                }
            }
            bufferReader.close();
        } catch (IOException e) {
View Full Code Here

     *            file parent path or null
     * @return a PdfFile object given a file node
     * @throws Exception
     */
    private PdfFile getPdfFileFromNode(Node pdfNode, String parentPath) throws Exception {
        PdfFile retVal = null;
        String pwd = null;
        String fileName = null;
        // get filename
        Node fileNode = pdfNode.selectSingleNode("@value");
        if (fileNode != null) {
            fileName = fileNode.getText().trim();
        } else {
            throw new ConcatException(ConcatException.ERR_READING_CSV_OR_XML, new String[] { "Empty file name." });
        }
        // get pwd value
        Node pwdNode = pdfNode.selectSingleNode("@password");
        if (pwdNode != null) {
            pwd = pwdNode.getText();
        }
        if (parentPath != null && parentPath.length() > 0) {
            retVal = new PdfFile(new File(parentPath, fileName), pwd);
        } else {
            retVal = new PdfFile(fileName, pwd);
        }
        return retVal;
    }
View Full Code Here

        if (directory != null && directory.isDirectory()) {
            File[] fileList = directory.listFiles(new PdfFilter());
            Arrays.sort(fileList, new FilenameComparator());
            ArrayList list = new ArrayList();
            for (int i = 0; i < fileList.length; i++) {
                list.add(new PdfFile(fileList[i], null));
            }
            if (list.size() <= 0) {
                LOG.warn("No pdf documents found in " + directory);
            }
            retVal = (PdfFile[]) list.toArray(new PdfFile[list.size()]);
View Full Code Here

TOP

Related Classes of org.pdfsam.console.business.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.