}
}
}
String realPath = getRealPath(file);
Path rootDirectory = getRootDirectory();
Path path = rootDirectory.lookup(realPath);
if (path.exists())
return new URL(path.getURL()).openConnection();
int fileIdx;
URLConnection connection = null;
if (file.length() > 1 && (fileIdx = file.indexOf("/", 1)) > -1) {
String context = file.substring(0, file.indexOf("/", 1));
if (context.equals(getContextPath())) {// disable cross-context lookup
file = file.substring(fileIdx, file.length());
realPath = getRealPath(file);
path = rootDirectory.lookup(realPath);
if (path.exists())
connection = new URL(path.getURL()).openConnection();
}
}
if (connection != null)
return connection;