try {
URL resourceUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile() + resource);
System.out.println("Non GB resource, so trying server '" + resourceUrl.toExternalForm() + "'");
InputStream in = resourceUrl.openStream();
try {
resourceBundle = new PropertyResourceBundle(in);
}
finally {
closeStream(in);
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
// If no resource bundle has yet been loaded, look for it in the class loader
if(resourceBundle == null && cl != null) {
System.out.println("Must GB resource, so trying class load");
InputStream in = cl.getResourceAsStream(resource);
try {
resourceBundle = new PropertyResourceBundle(in);
} catch (IOException ioe) {
ioe.printStackTrace();
}
finally {
closeStream(in);