String file = url.getFile();
if (file == null) {
file = ""; //$NON-NLS-1$
}
if (limit > start) {
spec = spec.substring(start, limit);
} else {
spec = ""; //$NON-NLS-1$
}
if (spec.indexOf("!/") == -1 && (file.indexOf("!/") == -1)) { //$NON-NLS-1$ //$NON-NLS-2$
throw new NullPointerException(Msg.getString("K01b6")); //$NON-NLS-1$
}
if (file.equals("")) {
file = spec;
} else if (spec.charAt(0) == '/") {
file = file.substring(0, file.indexOf('!") + 1) + spec;
} else {
int idx = file.indexOf('!");
String tmpFile = file.substring(idx + 1, file.lastIndexOf('/") + 1) + spec;
tmpFile = URLUtil.canonicalizePath(tmpFile);
file = file.substring(0, idx + 1) + tmpFile;
}
try {
// check that the embedded url is valid
new URL(file);
} catch (MalformedURLException e) {
throw new NullPointerException(e.toString());
}
setURL(url, "jar", "", -1, null, null, file, null, null); //$NON-NLS-1$//$NON-NLS-2$