Commit graph

152 commits

Author SHA1 Message Date
Mark Pariente
e007337167 Remove stale comment in EncFSConfigWriter 2012-10-08 23:36:06 -07:00
Mark Pariente
6616b322b7 Volume creation support in EncFSShell 2012-10-08 23:28:41 -07:00
Mark Pariente
b18c762bcb Recursively delete directories in EncFSLocalFileProvider
EncFSLocalFileProvider.delete() was only deleting a directory if it was
completely empty. It is more functional to just recursively delete
everything under a directory if its not empty.
2012-09-16 19:41:23 -07:00
Mark Pariente
6181b6ebdb Forgot to remove debugging logs 2012-08-26 03:22:54 -07:00
Mark Pariente
dd91907833 Implement versioning support 2012-08-26 03:13:25 -07:00
Mark Pariente
ffeb63e733 Fix return types for input/output stream functions 2012-08-26 00:32:44 -07:00
Mark Pariente
08dfe3d7ad Fix return types for EncFSFile.open{Input|Output}Stream
These methods were returning InputStream/OutputStream instead of the
more specific EncFSInputStream and EncFSOutputStream.
2012-08-26 00:08:54 -07:00
Mark Pariente
dbda446205 Fix warning and add attribution in EncFSBase64 2012-08-23 00:06:23 -07:00
Mark Pariente
b8a8f3dc6f Use Filter{Input|Output}Stream in stream classes
* EncFSFileInputStream now extends FilterInputStream
* EncFSFileOutputStream now extends FilterOutputStream
* EncFSInputStream now extends FilterInputStream

EncFSOutputStream was already using FilterOutputStream.
2012-08-22 23:53:19 -07:00
Mark Pariente
e80d4abac3 Catch EncFSException in EncFSShell 2012-08-22 23:31:41 -07:00
Mark Pariente
c645cc1897 Create EncFSException and subclass exceptions to it 2012-08-22 23:23:02 -07:00
Mark Pariente
808eb37c91 Fail to create volume if externalIVChaining=1 2012-08-22 23:13:27 -07:00
Mark Pariente
83cf5d0d2d Fix CRLF usage
Unfortunate to have to do this, but with the new version of git diff
explicitly showing CRLF as ^M this was starting to get annoying. We
shall use Unix newline style in encfs-java going forward.
2012-08-22 23:08:00 -07:00
Mark Pariente
cdcd5923e8 Implement unencrypted filename support (nameio/null)
BoxCryptor uses an unencrypted name algorithm to encrypt file contents
without encrypting filenames. This change implements this algorithm
and adds a unit test. Thanks 1jr for requesting this and providing
test cases.

Also added a volume integration test for this algorithm.
2012-08-14 00:46:32 -07:00
Mark Pariente
dc7d4836f3 Don't treat uniqueIV differently in EncFSFile.copy
uniqueIV just generates a bunch of random bytes in the file header so
we can use fileProvider.copy() which is more efficient for most file
providers rather than doing a full stream read/write copy.
2012-08-03 02:01:10 -07:00
Mark Pariente
3214ebc711 Eclipse formatting (whitespace fixes) 2012-06-25 22:28:17 -07:00
Zdenek Farana
4e84fe6ad8 Polymorphic isEncFSVolume methods for File and EncFSFileProvider 2012-06-25 23:52:39 +02:00
Zdenek Farana
ce6b9c4417 Simple method for checking if the provided path contains EncFS volume by detecting EncFS config file 2012-06-25 23:34:06 +02:00
Mark Pariente
03c1814aa9 Handle partial reads in EncFSInputStream.readBlock()
With network based file providers it is possible for the input stream's
read() function to return before reading a full block. The current code
treated such partial reads incorrectly by using stream decoding to
decode them. Fix is to keep reading until we either read a full block
or we hit the end of the input stream.
2012-06-01 01:23:53 -07:00
Mark Pariente
84b8726b8c Fix whitespace formatting 2012-05-29 19:56:39 -07:00
michael1
869038b179 EncFSShell now supports files / path with spaces, if they are quoted.
Example: cat "this is a test file with quotoes"
2012-05-29 22:15:19 +03:00
Mark Pariente
7a370eb704 Make EncFSFileOutputStream take a length parameter
Unfortunately some network storage systems such as Dropbox require
length of the file before opening an upload request so we need to
plumb file length all throughout the OutputStream creation. It is
optional for EncFSLocalFileProvider, but it is good practice to
supply this parameter whenever possible.
2012-05-24 20:21:31 -07:00
Mark Pariente
412d62e2e9 Remove stale code from EncFSLocalFileProvider
This code was causing double leading slashes in front of directories
and did not have any noticable benefits, tests pass without it.
2012-05-21 02:12:02 -07:00
Mark Pariente
80ffa6a78e Add EncFSProgressListener to monitor operation progress
copyPath() movePath() and deletePath() now take an optional
EncFSProgressListener in order to post progress events. This is useful
for displaying progress of long running operations.
2012-05-19 04:11:38 -07:00
Mark Pariente
18cdf3b477 Fix stream name decoding with chained name IV
Stream name decoding with chained name IV was broken because chained
name IV computation was unconditionally padding each path element
whereas that should only be done for block name I/O algorithm. Fix
uses each path element as is for chained IV computation with stream
name algorithm.

Also added an integration test case containing a volume created with
encfs 1.7.4 that uses stream name algorithm and chained name IV
with a directory and a test file in that directory to exercise the
path that fails without this commit.
2012-04-29 01:49:34 -07:00
Mark Pariente
afea85bf68 Implement EncFSFileProvider.getRootPath() 2012-04-28 01:49:21 -07:00
Mark Pariente
c50de9fdd3 Implement separator interface for EncFSFileProvider 2012-04-28 01:39:33 -07:00
Mark Pariente
59b860cf92 Rename EncFSVolume constants to shorter versions 2012-04-27 23:31:21 -07:00
Mark Pariente
9a6cfa4ec4 Use combinePath() and ENCFS_VOLUME_PATH_SEPARATOR 2012-04-27 23:24:24 -07:00
Mark Pariente
e21c9b8538 Add EncFSFile.combinePath() methods to combine paths 2012-04-27 22:41:51 -07:00
Mark Pariente
8c56794273 copyPath() and movePath() prevents overwriting existing files 2012-04-26 00:20:51 -07:00
Mark Pariente
f9308bff4b EncFSVolume.copyOrMovePath() fails for srcPath == dstPath 2012-04-25 23:47:15 -07:00
Mark Pariente
3b5510aab8 Fix '/' path handling in EncFSShell.getPath() 2012-04-25 23:42:09 -07:00
Mark Pariente
afa7b1e884 EncFSShell allows moving files/dirs into an existing dir 2012-04-25 23:42:09 -07:00
Mark Pariente
f9a97aafe5 EncFSVolume.movePath() allows moving into existing dirs
Previous implementation didn't work if dstPath was an existing
directory, fix the implementation to move srcPath under dstPath
if dstPath exists and is a directory.
2012-04-25 23:42:09 -07:00
Mark Pariente
5fa007932e Avoid duplicate leading "//" in EncFSShell copy 2012-04-25 23:42:09 -07:00
Mark Pariente
9d38e6188f EncFSVolume.copyOrMovePath() fix for dir copies
When copying a directory recursively we should manually
perform the recursion since EncFSFileProvider.copy()
interface doesn't allow recursive copies.

Also, we should update dstPath with the newly created
directory to copy/move stuff from srcPath into it.
2012-04-25 23:41:58 -07:00
Mark Pariente
dba45202f8 Don't produce // as parentPath in EncFSLocalFileProvider 2012-03-07 23:31:32 -08:00
Mark Pariente
ff3a20305f Turn on allowHoles in the default EncFSConfig 2012-03-07 01:15:11 -08:00
Mark Pariente
f12f98a2a1 Make EncFSVolume.recursiveDelete private 2012-03-07 00:47:17 -08:00
Mark Pariente
00636eaaa1 EncFSVolume.deletePath() can remove non-empty dirs
Implemented recursive directory deletion support controlled by a
boolean option in EncFSVolume.deletePath(). Extended the EncFSShell
'rm' command to make use of this functionality and added a test
case to EncFSVolumeTest to exercise recursive deletion of a
non-empty directory path.
2012-03-07 00:42:27 -08:00
Mark Pariente
6e814aba75 Implement cp command for EncFSShell 2012-03-04 02:00:35 -08:00
Mark Pariente
d38dd6015d Improve recursive copy support
Make EncFSVolume.copyPath() more robust by making it able to
recursively copy directories even with the ChainedNameIV config
option.
2012-03-04 01:59:52 -08:00
Mark Pariente
e92b409abd Add missing continue in 'mv' error path 2012-03-04 00:06:38 -08:00
Mark Pariente
f46201577d Fix style 2012-03-04 00:06:26 -08:00
Mark Pariente
87ca7a109f Fix EncFSVolume.movePath() for ChainedNameIV
There was a bug in EncFSVolume.movePath() that caused recursive moves
in the case of ChainedNameIV configurations to fail. Also improved
rollback handling in the case of an error during the recursive move
by trying to delete the newly created directories.

Added a FileNotFoundException to EncFSLocalFileProvider.move()
implementation as well.
2012-03-03 23:54:29 -08:00
Mark Pariente
8b49d66127 Absolute/relative path handling in EncFSShell
This commit cleans up EncFSShell path handling to allow absolute paths
as well as relative paths with multiple path elements. For example:

/ > ls
testdir1/
/ > ls testdir1/testdir2
testdir-with-really-really-long-name/
testfile2.txt
/ > cd testdir1/testdir3/testdir4
/testdir1/testdir3/testdir4 > cat /testdir1/testfile.txt
file contents!
file contents!
...

All existing commands were improved to use the new path handling
capabilities. Cleaned up error messages in the process as well.
2012-03-03 18:50:09 -08:00
Mark Pariente
216a33901a Throw exception from EncFSLocalFileProvider.mkdir()
Made EncFSLocalFileProvider.mkdir() throw a FileNotFoundException
if one or more path elements aren't found. Also modified
EncFSVolume.makeDir to filter this exception to print the
unencrypted path in the exception message.
2012-03-03 17:33:30 -08:00
Mark Pariente
e1027c3b87 Implement EncFSUtil.copyWholeStream()
Noticed we're doing full InputStream->OutputStream copies quite a bit
around the code, so this commit adds a utility function for that and
calls it from everywhere.
2012-02-29 23:59:49 -08:00
Mark Pariente
024b19dc2e Show '/' at the end of directory names 2012-02-29 23:02:34 -08:00