[ 
https://issues.apache.org/jira/browse/IO-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

BELUGA BEHR updated IO-412:
---------------------------

    Attachment:     (was: PartingFileOutputStream.java)

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

Reply via email to