[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Commented] (IO-412) AllOrNothingOutputStream
From:       "BELUGA BEHR (JIRA)" <jira () apache ! org>
Date:       2013-11-30 5:46:35
Message-ID: JIRA.12681832.1385702271841.48702.1385790395436 () arcas
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/IO-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13835620#comment-13835620 \
] 

BELUGA BEHR commented on IO-412:
--------------------------------

Apparently I was not the first to suggest this.  Woops:

[IO-316]

> 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
> 
> 
> 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#6144)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic