From 7977d1a0bd6f0bd5c3495828798fe791c6c9a51a Mon Sep 17 00:00:00 2001 From: Stephan Preibisch Date: Wed, 16 Oct 2024 14:11:14 -0400 Subject: [PATCH] fix isFile( URI uri ), only returns true if it is an absolute path (i.e. with file:/) --- src/main/java/util/URITools.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/util/URITools.java b/src/main/java/util/URITools.java index 7c320f93..d4bebf59 100644 --- a/src/main/java/util/URITools.java +++ b/src/main/java/util/URITools.java @@ -466,7 +466,11 @@ public static boolean isFile( URI uri ) { final String scheme = uri.getScheme(); final boolean hasScheme = scheme != null; - return !hasScheme || FILE_SCHEME.asPredicate().test( scheme ); + + if ( !hasScheme ) + return false; + else + return FILE_SCHEME.asPredicate().test( scheme ); } /**