} catch (IOException e) {
log.warn("Could not determine content type from URL; ignoring", e);
}
if (contentType != null) {
if (contentType.toLowerCase().endsWith("/xml")) {
return new DOMConfigurator();
}
}
// Check thr file name
String filename = url.getFile().toLowerCase();
if (filename.endsWith(".xml")) {
return new DOMConfigurator();
} else if (filename.endsWith(".properties")) {
return new PropertyConfigurator();
}
// Check for <?xml in content
if (connection != null) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
try {
String head = reader.readLine();
if (head.startsWith("<?xml")) {
return new DOMConfigurator();
}
} finally {
reader.close();
}
} catch (IOException e) {