return null;
}
list = ((Element)list.item(0)).getElementsByTagName("version");
Version[] available = new Version[list.getLength()];
for (int i = 0; i < available.length; i++) {
available[i] = new Version(getText(list.item(i)));
}
List availableList = Arrays.asList(available);
if(availableList.contains(query.getVersion())){
available = new Version[]{query.getVersion()};
} else {
Arrays.sort(available);
}
for(int i=available.length-1; i>=0; i--) {
Version version = available[i];
URL metadataURL = new URL(url.toString().trim().endsWith("/") ? url : new URL(url.toString().trim()+"/"), base+"/"+version+"/maven-metadata.xml");
InputStream metadataStream = connect(metadataURL, username, password, monitor);
if (metadataStream == null) {
metadataURL = new URL(url.toString().trim().endsWith("/") ? url : new URL(url.toString().trim()+"/"), base+"/"+version+"/maven-metadata-local.xml");