|
@@ -45,6 +45,7 @@ public class URLBuilder {
|
45
|
45
|
@Deprecated
|
46
|
46
|
@Getter
|
47
|
47
|
@Setter
|
|
48
|
+ @SuppressWarnings("PMD.UnusedPrivateField")
|
48
|
49
|
private static URLBuilder instance;
|
49
|
50
|
|
50
|
51
|
/** Provider to retrieve a plugin manager instance when needed. */
|
|
@@ -93,7 +94,7 @@ public class URLBuilder {
|
93
|
94
|
*/
|
94
|
95
|
public URL getUrlForJarFile(final String jarFile, final String path) {
|
95
|
96
|
try {
|
96
|
|
- String url = "jar:" + buildURL(jarFile) + "!/" + path;
|
|
97
|
+ String url = "jar:" + getUrl(jarFile) + "!/" + path;
|
97
|
98
|
if (url.startsWith("jar:file://")) {
|
98
|
99
|
url = "jar:file:/" + url.substring(11);
|
99
|
100
|
}
|
|
@@ -140,27 +141,6 @@ public class URLBuilder {
|
140
|
141
|
.getMetaData().getPluginUrl().getPath(), path);
|
141
|
142
|
}
|
142
|
143
|
|
143
|
|
- /**
|
144
|
|
- * Constructs an URL corresponding to the described resource.
|
145
|
|
- *
|
146
|
|
- * @param spec The resource location. May take the form of: <ul>
|
147
|
|
- * <li>dmdirc://com/dmdirc/etc/
|
148
|
|
- * <li>jar://path/to/jarfile:path/inside/jarfile
|
149
|
|
- * <li>zip://path/to/zipfile:path/inside/zipfile
|
150
|
|
- * <li>theme://theme_name:file/inside/theme
|
151
|
|
- * <li>plugin://plugin_name:file/inside/plugin
|
152
|
|
- * <li>http://server/path
|
153
|
|
- * <li>https://server/path
|
154
|
|
- * <li>[file://]/path/on/filesystem</ul>
|
155
|
|
- *
|
156
|
|
- * @return An URL corresponding to the specified resource, or null on failure
|
157
|
|
- * @deprecated Use non-static methods
|
158
|
|
- */
|
159
|
|
- @Deprecated
|
160
|
|
- public static URL buildURL(final String spec) {
|
161
|
|
- return instance.getUrl(spec);
|
162
|
|
- }
|
163
|
|
-
|
164
|
144
|
/**
|
165
|
145
|
* Constructs an URL corresponding to the described resource.
|
166
|
146
|
*
|