Package org.apache.jackrabbit.util

Examples of org.apache.jackrabbit.util.TransientFileFactory


     */
    private BLOBInTempFile(InputStream in, boolean temp) throws RepositoryException {
        this.temp = temp;
        OutputStream out = null;
        try {
            TransientFileFactory fileFactory = TransientFileFactory.getInstance();
            file = fileFactory.createTransientFile("bin", null, null);
            out = new FileOutputStream(file);
            length = IOUtils.copyLarge(in, out);
        } catch (IOException e) {
            throw new RepositoryException("Error creating temporary file", e);
        } finally {
View Full Code Here


            // base64 encoded binary value;
            // the encodeBlanks flag can be ignored since base64-encoded
            // data cannot contain encoded space characters

            // decode to temp file
            TransientFileFactory fileFactory = TransientFileFactory.getInstance();
            final File tmpFile = fileFactory.createTransientFile("bin", null, null);
            OutputStream out = new BufferedOutputStream(new FileOutputStream(tmpFile));
            try {
                Base64.decode(reader, out);
            } finally {
                out.close();
View Full Code Here

                    out.write(spoolBuffer, 0, read);
                    len += read;
                } else if (len + read > MAX_BUFFER_SIZE) {
                    // threshold for keeping data in memory exceeded;
                    // create temp file and spool buffer contents
                    TransientFileFactory fileFactory = TransientFileFactory.getInstance();
                    spoolFile = fileFactory.createTransientFile("bin", null, null);
                    out = new FileOutputStream(spoolFile);
                    out.write(buffer, 0, len);
                    out.write(spoolBuffer, 0, read);
                    buffer = null;
                    len += read;
View Full Code Here

        synchronized (this) {
            if (!f.exists() || isInPurgeMode()) {
                OutputStream out = null;
                File transFile = null;
                try {
                    TransientFileFactory tff = TransientFileFactory.getInstance();
                    transFile = tff.createTransientFile("s3-", "tmp", tmp);
                    out = new BufferedOutputStream(new FileOutputStream(transFile));
                    length = IOUtils.copyLarge(in, out);
                } finally {
                    IOUtils.closeQuietly(out);
                }
View Full Code Here

            throws IOException {
        if (buffer != null) {
            if (bufferPos + length > MAX_BUFFER_SIZE) {
                // threshold for keeping data in memory exceeded;
                // create temp file and spool buffer contents
                TransientFileFactory fileFactory = TransientFileFactory.getInstance();
                tmpFile = fileFactory.createTransientFile("txt", null, null);
                final FileOutputStream fout = new FileOutputStream(tmpFile);
                writer = new OutputStreamWriter(fout) {
                    public void flush() throws IOException {
                        // flush this writer
                        super.flush();
View Full Code Here

                    // using Reader and temporay file
                    if (InternalValue.USE_DATA_STORE) {
                        Base64ReaderInputStream in = new Base64ReaderInputStream(reader());
                        return InternalValue.createTemporary(in);
                    }
                    TransientFileFactory fileFactory = TransientFileFactory.getInstance();
                    File tmpFile = fileFactory.createTransientFile("bin", null, null);
                    FileOutputStream out = new FileOutputStream(tmpFile);
                    Reader reader = reader();
                    try {
                        Base64.decode(reader, out);
                    } finally {
View Full Code Here

        if (isFolder(filePath)) {
            throw new FileSystemException("path denotes folder: " + filePath);
        }

        try {
            TransientFileFactory fileFactory = TransientFileFactory.getInstance();
            final File tmpFile = fileFactory.createTransientFile("bin", null, null);

            return new FilterOutputStream(new FileOutputStream(tmpFile)) {

                public void close() throws IOException {
                    super.close();
View Full Code Here

        if (isFolder(filePath)) {
            throw new FileSystemException("path denotes folder: " + filePath);
        }

        try {
            TransientFileFactory fileFactory = TransientFileFactory.getInstance();
            final File tmpFile = fileFactory.createTransientFile("bin", null, null);

            // @todo FIXME use java.sql.Blob

            if (isFile(filePath)) {
                // file entry exists, spool contents to temp file first
View Full Code Here

        if (isFolder(filePath)) {
            throw new FileSystemException("path denotes folder: " + filePath);
        }

        try {
            TransientFileFactory fileFactory = TransientFileFactory.getInstance();
            final File tmpFile = fileFactory.createTransientFile("bin", null, null);

            return new FilterOutputStream(new FileOutputStream(tmpFile)) {

                public void close() throws IOException {
                    super.close();
View Full Code Here

        if (isFolder(filePath)) {
            throw new FileSystemException("path denotes folder: " + filePath);
        }

        try {
            TransientFileFactory fileFactory = TransientFileFactory.getInstance();
            final File tmpFile = fileFactory.createTransientFile("bin", null, null);

            // @todo FIXME use java.sql.Blob

            if (isFile(filePath)) {
                // file entry exists, spool contents to temp file first
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.util.TransientFileFactory

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.