Upplication / Amazon-S3-FileSystem-NIO2

An S3 File System Provider for Java 7
MIT License
122 stars 67 forks source link

Closing output streams twice deletes s3 files #22

Closed johnhartman closed 9 years ago

johnhartman commented 10 years ago

1) Open an output stream. 2) Write some data. 3) Close the stream. s3fs copies the temp file to s3. s3fs deletes the temp file.

4) Close the stream again

Expected Behavior: s3fs does nothing. Calling close() more than once should do nothing. Actual Behavior: s3fs performs an s3 delete operation (because the temp file no longer exists).

Why is this a problem? I am using a 3rd party component. It is closing the stream more than once. I have no control over the 3rd party's software.

In version .0.2.7, please add this line to after S3FileSystemProvider.java:230:

if ( ! seekable.isOpen() ) return;

jarnaiz commented 10 years ago

Hi,

ok, I'll do this later and write a test

thanks!

johnhartman commented 10 years ago

At Monday 01:31 AM 10/20/2014, Javier wrote: ok, I'll do this later and write a test thanks! Wonderful!

johnhartman commented 9 years ago

Thank you Javier!

jarnaiz commented 9 years ago

thanks you for your suggestion :)