Skip to content

Commit

Permalink
(minor) Bugfix in Path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
vlofgren committed Jul 11, 2023
1 parent 74644d5 commit ac2d703
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ public static Set<String> createFileLinkKeywords(LinkProcessor lp, EdgeDomain do

private static void synthesizeFilenameKeyword(Set<String> fileKeywords, EdgeUrl link) {

Path pFilename = Path.of(link.path.toLowerCase()).getFileName();
int lastSlash = link.path.lastIndexOf('/');
if (lastSlash < 0) return;

if (pFilename == null) return;
String filename = link.path
.substring(lastSlash + 1)
.toLowerCase();

String filename = pFilename.toString();
if (filename.length() > 32
|| filename.endsWith(".xml")
|| filename.endsWith(".jpg")
Expand Down

0 comments on commit ac2d703

Please sign in to comment.