Skip to content

Commit

Permalink
use realpath when creating filedata from components
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Goina committed May 20, 2024
1 parent 0fd60ec commit b57f7f7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.janelia.colormipsearch.model;

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

Expand Down Expand Up @@ -34,7 +35,12 @@ public static FileData fromString(String fn) {
}

public static FileData fromComponents(FileDataType fileDataType, String parent, String name, boolean normalize) {
Path parentFilePath = Paths.get(parent).toAbsolutePath().normalize();
Path parentFilePath;
try {
parentFilePath = Paths.get(parent).toRealPath();
} catch (IOException e) {
parentFilePath = Paths.get(parent).toAbsolutePath().normalize();
}
if (fileDataType == FileDataType.zipEntry) {
FileData fd = new FileData();
fd.setDataType(FileDataType.zipEntry);
Expand Down

0 comments on commit b57f7f7

Please sign in to comment.