} else {
configFileLoc = System.getProperty("org.apache.oodt.opendap.config.filePath");
}
if (configFileLoc.isEmpty()){
throw new ProfileException(
"Configuration file not found. Please specify in System property opendap.config.filePath or as URL parameter ConfigUrl");
} else {
try {
this.conf = OpendapConfigReader.read(configFileLoc);
} catch (FileNotFoundException e) {
throw new ProfileException("FileNotFoundException: File not found!");
} catch (MalformedURLException e) {
throw new ProfileException("MalformedURLException: please fix file URL");
}
}
List<Profile> profiles = new Vector<Profile>();
List<DapRoot> roots = this.conf.getRoots();
for (DapRoot root : roots) {
DatasetExtractor d = new DatasetExtractor(xmlQuery, root.getCatalogUrl()
.toExternalForm(), root.getDatasetUrl().toExternalForm());
if (d.getDapUrls() != null) {
for (String opendapUrl : d.getDapUrls()) {
Profile profile = new Profile();
DConnect dConn = null;
try {
dConn = new DConnect(opendapUrl, true);
} catch (FileNotFoundException e) {
LOG.log(Level.WARNING, "Opendap URL not found: [" + opendapUrl
+ "]: Message: " + e.getMessage());
throw new ProfileException("Opendap URL not found: [" + opendapUrl
+ "]: Message: " + e.getMessage());
}
Metadata datasetMet = d.getDatasetMet(opendapUrl);
profile.setResourceAttributes(ProfileUtils.getResourceAttributes(