// Now, we'll try to access the resource within a JAR. We'll still make sure that the JAR actually exists as an
// accessible file.
RegexUtil jarFile = new RegexUtil("(file:.+/([^/]+\\.jar))/");
Match[] matches = jarFile.getMatches(newPath);
if (matches.length > 0) {
Match lastMatch = matches[matches.length - 1];
String jarFilePath = lastMatch.getGroups()[0];
if (IOUtil.exists().file(jarFilePath)) {
String jarFileName = lastMatch.getGroups()[1];
newPath = "jar:" + newPath.replaceAll(jarFileName + "/", jarFileName + "!/");
try {
return new URL(newPath);