mrpdaemon/encfs-java — pull request #7 by aefo (2012-01-19 19:56:27+00:00)
Title: Merge inital set of enhancements to support manipulating / writing files in the volume

changes to

- Provide methods on EncFSVolume to manipulate / work with the volume. i.e. methods to copy, move & open as an input/output stream files in the volume
- Change the EncFSVolume class to use a "native file source/provider" helper class/interface to allow files to be loaded from different places. The default is obviously the local file system, but I want to be able to read a EncFS volume from a webdav share remotely so I needed to change the EncFSVolume to use this helper & not restrict itself to read the native files directly. Hopefully the change should be clearer when you see the code :-) It should also make unit testing easier as we can test the EncFSVolume without it needing to use the file system
- Refactor EncFSFileInputStream to 1) Extend from InputStream 2) Support reading the data from a supplied InputStream rather than it creating the file input stream
- Created the first cut of EncFSOutputStream
- Fixed a bug in the input stream (that I may have only created locally :-), not 100% sure) where the last byte of the input stream was getting skipped / truncated.
- Updated the tests to check that they can now actually re-write out the files they were previously just reading in. It then checks that the new written out copy is the same as the original input file (subject to unique IV per file if the volume is using that)
- Created an file comparer utility class that you can point to a mounted encfs volume on your PC & the underlying files. It will then recurses through both and check / validate that what it decodes from the encrypted files (both file names & contents) matches what it gets when it reads the same files but through the PC mount of the volume. It also checks that if the files are re-written out then the encrypted contents matches. Basically this just servers as a "super-sized" integration test to verify that it can fully read & process lots of "real world" files rather than just the small samples we added to the project.