-
Notifications
You must be signed in to change notification settings - Fork 3
/
URIUtils.diff
31 lines (30 loc) · 1.02 KB
/
URIUtils.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Index: util/URIUtils.java
===================================================================
--- util/URIUtils.java (revision 420)
+++ util/URIUtils.java (working copy)
@@ -82,14 +82,18 @@
URI cwd = null;
try {
- String path = encode(dir);
- if (!path.endsWith("/")) {
- path += "/";
- }
- if (!path.startsWith("/")) {
- path = "/" + path;
- }
- cwd = new URI("file:" + path);
+ if (dir.startsWith("http://")) { // Skip this stuff if passed in an http:// URI
+ cwd = new URI(dir);
+ } else {
+ String path = encode(dir);
+ if (!path.endsWith("/")) {
+ path += "/";
+ }
+ if (!path.startsWith("/")) {
+ path = "/" + path;
+ }
+ cwd = new URI("file:" + path);
+ }
} catch (URISyntaxException use) {
throw new XProcException(use);
}