Package org.openquark.util

Examples of org.openquark.util.FileChangeOutputStream


        // Handle null source.

        try {

            FileChangeOutputStream outputStream = null;
            try {
                // throws IOException:
                outputStream = new FileChangeOutputStream(targetFile);
                FileSystemResourceHelper.transferData(inputStream, outputStream);

            } finally {
                try {
                    if (outputStream != null) {
                        outputStream.close();
                    }
                } catch (IOException ioe) {
                    // Nothing can really be done at this point, and we don't bother reporting the error.
                }                      
            }
View Full Code Here


        }
       
        try {
            File outputFile = getFile(fileLocator);
           
            FileChangeOutputStream outputStream = null;
            try {
                // throws IOException:
                outputStream = new FileChangeOutputStream(outputFile);
                FileSystemResourceHelper.transferData(source, outputStream);
               
            } finally {
                try {
                    if (outputStream != null) {
                        outputStream.close();
                    }
                } catch (IOException ioe) {
                    // Nothing can really be done at this point, and we don't bother reporting the error.
                }
            }
           
            // If here, an exception was not thrown.
           
            // If the file wasn't written, update the timestamp to provide a visible indication that the file data was processed.
            // Note: don't do this in the try block since this call would have no effect while the output stream is open.
            if (outputStream != null && !outputStream.isDifferent()) {
                getFile(fileLocator).setLastModified(System.currentTimeMillis());
            }
        } finally {
            source.close();
        }
View Full Code Here

TOP

Related Classes of org.openquark.util.FileChangeOutputStream

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.