aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/test/java/org/apache/drill/exec/store/CachedSingleFileSystem.java
diff options
context:
space:
mode:
Diffstat (limited to 'exec/java-exec/src/test/java/org/apache/drill/exec/store/CachedSingleFileSystem.java')
-rw-r--r--exec/java-exec/src/test/java/org/apache/drill/exec/store/CachedSingleFileSystem.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/CachedSingleFileSystem.java b/exec/java-exec/src/test/java/org/apache/drill/exec/store/CachedSingleFileSystem.java
index 6bd7e4de7..3db92564d 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/CachedSingleFileSystem.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/CachedSingleFileSystem.java
@@ -41,16 +41,16 @@ import org.apache.hadoop.util.Progressable;
public class CachedSingleFileSystem extends FileSystem {
private ByteBuf file;
- private String path;
+ private Path path;
- public CachedSingleFileSystem(String path) throws IOException {
+ public CachedSingleFileSystem(Path path) throws IOException {
this.path = path;
- File f = new File(path);
+ File f = new File(path.toUri().getPath());
long length = f.length();
if (length > Integer.MAX_VALUE) {
throw new UnsupportedOperationException("Cached file system only supports files of less than 2GB.");
}
- try (InputStream is = new BufferedInputStream(new FileInputStream(path))) {
+ try (InputStream is = new BufferedInputStream(new FileInputStream(path.toUri().getPath()))) {
byte[] buffer = new byte[64*1024];
this.file = UnpooledByteBufAllocator.DEFAULT.directBuffer((int) length);
int read;