mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-18 21:26:02 +00:00
Refactored filesystem api
* Removed Readable- and WritableBytes ** Replaced with Readable-/WritableByteChannel ** Methods now integrated in Readable- and WritableFile ** Replaced positioned read/write by method to set the position
This commit is contained in:
@@ -42,11 +42,17 @@ class NioFile extends NioNode implements File {
|
||||
private class ReadableView implements ReadableFile {
|
||||
|
||||
@Override
|
||||
public void read(ByteBuffer target) throws UncheckedIOException {
|
||||
public int read(ByteBuffer target) throws UncheckedIOException {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuffer target, long position) throws UncheckedIOException {
|
||||
public boolean isOpen() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void position(long position) throws UncheckedIOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,11 +68,17 @@ class NioFile extends NioNode implements File {
|
||||
private class WritableView implements WritableFile {
|
||||
|
||||
@Override
|
||||
public void write(ByteBuffer source) throws UncheckedIOException {
|
||||
public int write(ByteBuffer source) throws UncheckedIOException {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuffer source, int position) throws UncheckedIOException {
|
||||
public boolean isOpen() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void position(long position) throws UncheckedIOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.cryptomator.filesystem.nio;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static org.cryptomator.commons.test.matcher.ContainsMatcher.containsInAnyOrder;
|
||||
import static org.cryptomator.common.test.matcher.ContainsMatcher.containsInAnyOrder;
|
||||
import static org.cryptomator.filesystem.FolderCreateMode.FAIL_IF_PARENT_IS_MISSING;
|
||||
import static org.cryptomator.filesystem.FolderCreateMode.INCLUDING_PARENTS;
|
||||
import static org.cryptomator.filesystem.nio.FilesystemSetupUtils.emptyFilesystem;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package org.cryptomator.filesystem.nio;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
||||
import org.cryptomator.commons.test.matcher.PropertyMatcher;
|
||||
import org.cryptomator.common.test.matcher.PropertyMatcher;
|
||||
import org.cryptomator.filesystem.File;
|
||||
import org.cryptomator.filesystem.Folder;
|
||||
import org.hamcrest.Matcher;
|
||||
|
||||
Reference in New Issue
Block a user