Skip to content

Commit

Permalink
fix local file manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Al Niessner authored and Al Niessner committed Jun 4, 2024
1 parent 6152124 commit e346a43
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main/java/gov/nasa/pds/tools/util/ImageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,10 @@ public boolean isJPEG(String jpegBase, URL parentURL) throws Exception {
// File(uri.getPath()).getParent()" which will only get the top level directory.
// It would be a bug if the file is in a sub directory of the top level
// directory.
String parent = parentURL.getFile();

LOG.debug("isJPEG:,parent,jpegBase {},{}", parent, jpegBase);


// try using Paths and URI internal consistency to make this work for #902
// Build the full pathname of the file.
String jpegRef = Paths.get(parent, jpegBase).toString();
LOG.debug("isJPEG:parent,jpegBase,jpegRef [{}],[{}],[{}]", parent, jpegBase, jpegRef);
String jpegRef = Paths.get(parentURL.toURI().resolve(jpegBase)).toString();

File jpegFile = new File(jpegRef);
RandomAccessFile raf = new RandomAccessFile(jpegFile, "r");
Expand Down

0 comments on commit e346a43

Please sign in to comment.