diff --git a/iped-utils/src/main/java/iped/utils/FileInputStreamFactory.java b/iped-utils/src/main/java/iped/utils/FileInputStreamFactory.java index 7e5b9fe679..e7a26449a6 100644 --- a/iped-utils/src/main/java/iped/utils/FileInputStreamFactory.java +++ b/iped-utils/src/main/java/iped/utils/FileInputStreamFactory.java @@ -57,13 +57,17 @@ public Path getPath(String subPath) { } boolean isDirectory(String path) { - try (DirectoryStream ds = Files.newDirectoryStream(Path.of(path))) { - } catch (NotDirectoryException ioe) { - return false; - } catch (IOException e) { + if (path.endsWith(" ")) { + try (DirectoryStream ds = Files.newDirectoryStream(Path.of(path))) { + } catch (NotDirectoryException ioe) { + return false; + } catch (IOException e) { + return new File(path).isDirectory(); + } + return true; + } else { return new File(path).isDirectory(); } - return true; } @Override