BlockAlignedFileSystem no longer instantiable from other projects

This commit is contained in:
Markus Kreusch
2016-03-02 22:56:55 +01:00
parent 807fdae3b9
commit 7fba38d78a
10 changed files with 49 additions and 42 deletions

View File

@@ -1,25 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 Sebastian Stenzel and others.
* This file is licensed under the terms of the MIT license.
* See the LICENSE.txt file for more info.
*
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
import org.cryptomator.filesystem.Folder;
import org.cryptomator.filesystem.delegating.DelegatingFileSystem;
class BlockAlignedFileSystem extends BlockAlignedFolder implements DelegatingFileSystem {
public BlockAlignedFileSystem(Folder delegate, int blockSize) {
super(null, delegate, blockSize);
}
@Override
public Folder getDelegate() {
return delegate;
}
}

View File

@@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
package org.cryptomator.filesystem.crypto;
import java.io.UncheckedIOException;

View File

@@ -1,11 +1,16 @@
/*******************************************************************************
* Copyright (c) 2015 Sebastian Stenzel and others.
* Copyright (c) 2015, 2016 Sebastian Stenzel and others.
* This file is licensed under the terms of the MIT license.
* See the LICENSE.txt file for more info.
*
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.crypto;
import org.cryptomator.filesystem.Folder;
import org.cryptomator.filesystem.delegating.DelegatingFileSystem;
/**
* Provides a decoration layer for the {@link org.cryptomator.filesystem Filesystem API}, which guarantees, that all read/write attempts to underlying files always begin at a block start position.
* Block start positions are integer multiples of a block size + a fixed block shift.
@@ -15,16 +20,42 @@
*
* <table>
* <thead>
* <tr><th>Requested Read</th><th>Physical Read</th></tr>
* <tr>
* <th>Requested Read</th>
* <th>Physical Read</th>
* </tr>
* </thead>
* <tbody>
* <tr><td>0</td><td>0</td></td>
* <tr><td>5</td><td>0</td></td>
* <tr><td>9</td><td>0</td></td>
* <tr><td>10</td><td>10</td></td>
* <tr><td>11</td><td>10</td></td>
* <tr><td>35</td><td>30</td></td>
* <tr>
* <td>0</td>
* <td>0</td></td>
* <tr>
* <td>5</td>
* <td>0</td></td>
* <tr>
* <td>9</td>
* <td>0</td></td>
* <tr>
* <td>10</td>
* <td>10</td></td>
* <tr>
* <td>11</td>
* <td>10</td></td>
* <tr>
* <td>35</td>
* <td>30</td></td>
* </tbody>
* </table>
*/
package org.cryptomator.filesystem.blockaligned;
class BlockAlignedFileSystem extends BlockAlignedFolder implements DelegatingFileSystem {
public BlockAlignedFileSystem(Folder delegate, int blockSize) {
super(null, delegate, blockSize);
}
@Override
public Folder getDelegate() {
return delegate;
}
}

View File

@@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
package org.cryptomator.filesystem.crypto;
import static org.cryptomator.crypto.engine.impl.Constants.PAYLOAD_SIZE;

View File

@@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
package org.cryptomator.filesystem.crypto;
import org.cryptomator.filesystem.File;
import org.cryptomator.filesystem.Folder;

View File

@@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
package org.cryptomator.filesystem.crypto;
import java.io.UncheckedIOException;
import java.nio.ByteBuffer;

View File

@@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
package org.cryptomator.filesystem.crypto;
import java.io.UncheckedIOException;
import java.nio.ByteBuffer;

View File

@@ -19,7 +19,6 @@ import org.cryptomator.crypto.engine.Cryptor;
import org.cryptomator.crypto.engine.InvalidPassphraseException;
import org.cryptomator.filesystem.FileSystem;
import org.cryptomator.filesystem.Folder;
import org.cryptomator.filesystem.blockaligned.BlockAlignedFileSystemFactory;
@Singleton
public class CryptoFileSystemFactory {

View File

@@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
package org.cryptomator.filesystem.crypto;
import java.nio.ByteBuffer;
@@ -15,6 +15,7 @@ import org.cryptomator.filesystem.File;
import org.cryptomator.filesystem.FileSystem;
import org.cryptomator.filesystem.ReadableFile;
import org.cryptomator.filesystem.WritableFile;
import org.cryptomator.filesystem.crypto.BlockAlignedReadableFile;
import org.cryptomator.filesystem.inmem.InMemoryFileSystem;
import org.junit.Assert;
import org.junit.Test;

View File

@@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.filesystem.blockaligned;
package org.cryptomator.filesystem.crypto;
import java.nio.ByteBuffer;
@@ -14,6 +14,7 @@ import org.cryptomator.filesystem.File;
import org.cryptomator.filesystem.FileSystem;
import org.cryptomator.filesystem.ReadableFile;
import org.cryptomator.filesystem.WritableFile;
import org.cryptomator.filesystem.crypto.BlockAlignedWritableFile;
import org.cryptomator.filesystem.inmem.InMemoryFileSystem;
import org.junit.Assert;
import org.junit.Test;