@@ -106,21 +106,19 @@ protected void saveData() throws IOException {
106
106
}
107
107
108
108
/**
109
- * Retrieves the path where the plugins jar archives are stored
109
+ * Retrieves the path where the plugin jar archive is stored
110
110
*
111
- * @return the path where the plugins jar archives are stored
111
+ * @return the path where the plugin jar archive is stored
112
112
*/
113
113
public String getPluginPath () {
114
- String path = getManager ().getPathResolver ().resolvePath (getDescriptor (), "/" ).toString ();
115
- if (path .startsWith ("jar:file:" ))
116
- path = path .substring ("jar:file:" .length ());
117
- path = path .substring (0 , path .lastIndexOf ("!" ));
114
+ String path = getClass ().getProtectionDomain ().getCodeSource ().getLocation ().getPath ();
118
115
try {
119
116
// The path may contain URL-encoded sequences
120
117
path = URLDecoder .decode (path , "UTF-8" );
121
118
} catch (UnsupportedEncodingException e ) {
122
119
// Nothing to do
123
120
}
121
+
124
122
return path ;
125
123
}
126
124
@@ -274,7 +272,6 @@ protected void addServlet(String name, String servletClass, String mapping) {
274
272
protected void addServlet (String name , String servletClass , String mapping , Integer loadOnStartup ) {
275
273
File dest = new File (getPluginPath ());
276
274
dest = dest .getParentFile ().getParentFile ();
277
-
278
275
WebConfigurator config = new WebConfigurator (dest .getPath () + "/web.xml" );
279
276
if (loadOnStartup != null )
280
277
config .addServlet (name , servletClass , loadOnStartup );
0 commit comments