MCPcopy Create free account
hub / github.com/BaseXdb/basex / toPath

Method toPath

basex-core/src/main/java/org/basex/io/IOFile.java:98–106  ·  view source on GitHub ↗

Converts the specified URI to a file path. @param uri URI to be converted @return file path

(final String uri)

Source from the content-addressed store, hash-verified

96 * @return file path
97 */
98 static String toPath(final String uri) {
99 try {
100 return new URL(uri).toURI().getPath();
101 } catch(final Exception ex) {
102 Util.debug(ex);
103 // workaround for URIs with invalid characters
104 return uri.replaceAll("^" + FILEPREF + '*', "/").replaceFirst("^/([A-Za-z]:)", "$1");
105 }
106 }
107
108 /**
109 * Returns the file reference.

Callers 7

touchMethod · 0.95
readMethod · 0.95
writeMethod · 0.95
deleteMethod · 0.95
copyToMethod · 0.95
normalizeMethod · 0.95
getMethod · 0.95

Calls 3

debugMethod · 0.95
replaceFirstMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected