Package org.apache.axiom.attachments.lifecycle.impl

Examples of org.apache.axiom.attachments.lifecycle.impl.FileAccessor


            //threshold = lm.getRuntimeThreshold(threshold);
           
            if (length >= threshold && attachmentDir != null) {
               
                // Get the file accessor
                FileAccessor fileAccessor = lm.create(attachmentDir);
                OutputStream fos = fileAccessor.getOutputStream();
               
                //Copy the bytes into the file
                ByteArrayInputStream is = new ByteArrayInputStream(b, off, length);
                BufferUtils.inputStream2OutputStream(is, fos);
                fos.close();
               
                // Delete this temp file on exit
                lm.deleteOnExit(fileAccessor.getFile());
                lm.deleteOnTimeInterval(DELETE_TIME, fileAccessor.getFile());
               
                // Create the OMText node from the datahandler
                DataHandler dh = fileAccessor.getDataHandler(null);
                omText = factory.createOMText(dh, isOptimize);
            }
        }
        if (omText == null) {
            omText = factory.createOMText(Base64Utils.encode(b, off, length));
View Full Code Here


public class MyLifecycleManager extends LifecycleManagerImpl {
    private final Set/*<File>*/ files = new HashSet();

    public FileAccessor create(String attachmentDir) throws IOException {
        FileAccessor accessor = super.create(attachmentDir);
        files.add(accessor.getFile());
        return accessor;
    }
View Full Code Here

            //threshold = lm.getRuntimeThreshold(threshold);
           
            if (length >= threshold && attachmentDir != null) {
               
                // Get the file accessor
                FileAccessor fileAccessor = lm.create(attachmentDir);
                OutputStream fos = fileAccessor.getOutputStream();
               
                //Copy the bytes into the file
                ByteArrayInputStream is = new ByteArrayInputStream(b, off, length);
                BufferUtils.inputStream2OutputStream(is, fos);
                fos.close();
               
                // Delete this temp file on exit
                lm.deleteOnExit(fileAccessor.getFile());
                lm.deleteOnTimeInterval(DELETE_TIME, fileAccessor.getFile());
               
                // Create the OMText node from the datahandler
                DataHandler dh = fileAccessor.getDataHandler(null);
                omText = factory.createOMText(dh, isOptimize);
            }
        }
        if (omText == null) {
            omText = factory.createOMText(Base64Utils.encode(b, off, length));
View Full Code Here

            //threshold = lm.getRuntimeThreshold(threshold);
           
            if (length >= threshold && attachmentDir != null) {
               
                // Get the file accessor
                FileAccessor fileAccessor = lm.create(attachmentDir);
                OutputStream fos = fileAccessor.getOutputStream();
               
                //Copy the bytes into the file
                ByteArrayInputStream is = new ByteArrayInputStream(b, off, length);
                BufferUtils.inputStream2OutputStream(is, fos);
                fos.close();
               
                // Delete this temp file on exit
                lm.deleteOnExit(fileAccessor.getFile());
                lm.deleteOnTimeInterval(DELETE_TIME, fileAccessor.getFile());
               
                // Create the OMText node from the datahandler
                DataHandler dh = fileAccessor.getDataHandler(null);
                omText = factory.createOMText(dh, isOptimize);
            }
        }
        if (omText == null) {
            omText = factory.createOMText(Base64Utils.encode(b, off, length));
View Full Code Here

            //threshold = lm.getRuntimeThreshold(threshold);
           
            if (length >= threshold && attachmentDir != null) {
               
                // Get the file accessor
                FileAccessor fileAccessor = lm.create(attachmentDir);
                OutputStream fos = fileAccessor.getOutputStream();
               
                //Copy the bytes into the file
                ByteArrayInputStream is = new ByteArrayInputStream(b, off, length);
                BufferUtils.inputStream2OutputStream(is, fos);
                fos.close();
               
                // Delete this temp file on exit
                lm.deleteOnExit(fileAccessor.getFile());
                lm.deleteOnTimeInterval(DELETE_TIME, fileAccessor.getFile());
               
                // Create the OMText node from the datahandler
                DataHandler dh = fileAccessor.getDataHandler(null);
                omText = factory.createOMText(dh, isOptimize);
            }
        }
        if (omText == null) {
            omText = factory.createOMText(Base64.encode(b, off, length));
View Full Code Here

TOP

Related Classes of org.apache.axiom.attachments.lifecycle.impl.FileAccessor

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.