Skip to content

Commit 5856eca

Browse files
#484 Use getPath instead of toPath to avoid java nio
1 parent 7b9a500 commit 5856eca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/net/lingala/zip4j/util/FileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public static String getRelativeFileName(File fileToAdd, ZipParameters zipParame
222222
String rootPath = new File(fileToAdd.getParentFile().getCanonicalFile().getPath() + File.separator + fileToAdd.getCanonicalFile().getName()).getPath();
223223
tmpFileName = rootPath.substring(rootFolderFileRef.length());
224224
} else {
225-
if (!fileToAdd.getCanonicalFile().toPath().startsWith(rootFolderFileRef)) {
225+
if (!fileToAdd.getCanonicalFile().getPath().startsWith(rootFolderFileRef)) {
226226
tmpFileName = fileToAdd.getCanonicalFile().getParentFile().getName() + FILE_SEPARATOR + fileToAdd.getCanonicalFile().getName();
227227
} else {
228228
tmpFileName = fileCanonicalPath.substring(rootFolderFileRef.length());

0 commit comments

Comments
 (0)