Package com.log4ic.entity

Examples of com.log4ic.entity.IDocAttachment


        }
        return 0;
    }

    public static File getDocFileFromSource(int id) throws Exception {
        IDocAttachment attachment = getAttachmentService().getDocAttachmentById(id);

        if (attachment == null) {
            throw new Exception("Document is not exists!");
        }

        File docFile = new File(OUTPUT_PATH + id + File.separator + id + "." + attachment.getFileType());

        if (docFile.exists() && docFile.isFile()) {
            return docFile;
        } else if (!docFile.getParentFile().exists()) {
            docFile.getParentFile().mkdirs();
        }

        if (!docFile.exists()) {
            docFile.createNewFile();
        }


        InputStream in = attachment.getContentStream();

        OutputStream out = new FileOutputStream(docFile);

        byte[] buffer = new byte[1024];
        int position = 0;
View Full Code Here

TOP

Related Classes of com.log4ic.entity.IDocAttachment

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.