You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Attempt to retrieve the base URI of a given URI object such as "https://docs.gradle.org/8.10.1/userguide/java_testing.html#sec:test_execution" will return "https://docs.gradle.org/8.10.1/userguide/"
97
-
*
98
-
* @param uri Full uri
99
-
* @return The truncated URI
100
-
*/
101
-
publicstaticURIgetBaseUri(URIuri) {
102
-
103
-
StringBuildersb = newStringBuilder();
104
-
sb.append(uri.getScheme());
105
-
sb.append("://");
106
-
if (uri.getHost() != null) {
107
-
sb.append(uri.getHost());
108
-
}
109
-
// Get path up to the last '/'
110
-
Stringpath = uri.getPath();
111
-
if (path != null && !path.endsWith("/")) {
112
-
intlastSlash = path.lastIndexOf('/');
113
-
if (lastSlash >= 0) {
114
-
path = path.substring(0, lastSlash + 1);
115
-
} else {
116
-
path = "/";
117
-
}
118
-
}
119
-
sb.append(path);
120
-
returnURI.create(sb.toString());
121
-
}
122
96
/**
123
97
* Try to guess the RDFFormat from a file name
124
98
* @param filePath A URL or local path to an RDF file
@@ -182,7 +156,7 @@ public static String getFileExtension(String filename) {
182
156
* @throws URISyntaxException if the string is not a standard URI
0 commit comments