Skip to content

Commit

Permalink
'#1861: put back previous api
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Sep 21, 2023
1 parent 1adb23e commit d3a5416
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public FileInputStreamFactory(Path dataSource) {
super(dataSource.toUri());
}

public File getFile(String subPath) {
public Path getPath(String subPath) {
Path source = Paths.get(this.dataSource);
try {
return source.resolve(subPath).toFile();
return source.resolve(subPath);

} catch (InvalidPathException e) {
File file = new File(subPath);
Expand All @@ -42,13 +42,13 @@ public File getFile(String subPath) {
throw new RuntimeException(e1);
}
}
return file;
return file.toPath();
}
}

@Override
public SeekableInputStream getSeekableInputStream(String subPath) throws IOException {
File file = getFile(subPath);
File file = getPath(subPath).toFile();
if (file.isFile())
return new SeekableFileInputStream(file);
else
Expand Down
2 changes: 1 addition & 1 deletion iped-utils/src/main/java/iped/utils/IOUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public static boolean hasFile(IItemReader item) {
public static File getFile(IItemReader item) {
if (hasFile(item)) {
FileInputStreamFactory fisf = ((FileInputStreamFactory) item.getInputStreamFactory());
return fisf.getFile(item.getIdInDataSource());
return fisf.getPath(item.getIdInDataSource()).toFile();
}
return null;
}
Expand Down

0 comments on commit d3a5416

Please sign in to comment.