Skip to content

Commit

Permalink
dbeaver/pro#4035 Local path detect fix. Unit tests (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider authored Feb 3, 2025
1 parent 2831275 commit 25dbe61
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/org.jkiss.utils/src/org/jkiss/utils/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,14 @@ public static Path getPathFromString(@NotNull String pathOrUri) {


public static boolean isLocalFile(String filePath) {
return !filePath.contains("://") || filePath.startsWith("file:");
// Local paths:
// rel-path
// /abs/path
// \abs\path
// c:/abs/path
// c:\abs\path
int divPos = filePath.indexOf(":/");
return divPos < 0 || divPos == 1 || filePath.startsWith("file:");
}

public static boolean isLocalURI(URI uri) {
Expand Down

0 comments on commit 25dbe61

Please sign in to comment.