Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C40BD10553 for ; Sun, 15 Dec 2013 04:16:29 +0000 (UTC) Received: (qmail 74150 invoked by uid 500); 15 Dec 2013 04:16:19 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 73884 invoked by uid 500); 15 Dec 2013 04:16:16 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 73596 invoked by uid 99); 15 Dec 2013 04:16:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Dec 2013 04:16:11 +0000 Date: Sun, 15 Dec 2013 04:16:11 +0000 (UTC) From: "BELUGA BEHR (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IO-412) AllOrNothingOutputStream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IO-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] BELUGA BEHR updated IO-412: --------------------------- Attachment: PartingFileOutputStreamTest.java PartingFileOutputStream.java Here is my next attempt at this and some unit tests > AllOrNothingOutputStream > ------------------------ > > Key: IO-412 > URL: https://issues.apache.org/jira/browse/IO-412 > Project: Commons IO > Issue Type: New Feature > Components: Streams/Writers > Reporter: BELUGA BEHR > Priority: Minor > Attachments: AllOrNothingFileOutputStream.java, PartingFileOutputStream.java, PartingFileOutputStreamTest.java > > > Feel free to include this new FileOutputstream. No unit tests yet. Looking for feedback at this point. > {code} > /** > * This is a wrapper around a FileOutputStream. It enables a stream to be > * written to a hidden file in a directory and only then renamed to the final > * destination if no exceptions occur. This implementation marks the file as > * hidden by pre-appending the file name with a period. If any exceptions occur > * during writing, the hidden file will be deleted once close() is called. This > * class takes advantage of {@link File#renameTo(File)}; therefore, many aspects > * of the behavior of this class are inherently platform-dependent: The rename > * operation might not be able to move a file from one filesystem to another, it > * might not be atomic, and it might not succeed if a file with the destination > * abstract pathname already exists. This class is most useful when the rename > * operation is atomic. It is designed for the case when one process is writing > * to a directory and another process is polling the directory for files to > * read. > */ > {code} -- This message was sent by Atlassian JIRA (v6.1.4#6159)