final String file = files.get(0);
if (file.endsWith(".xml")) {
final Object obj = XML.unmarshal(new File(file));
metadata = (obj instanceof Metadata) ? (Metadata) obj : null;
} else {
final NetcdfStore store = new NetcdfStore(new StorageConnector(file));
try {
metadata = store.getMetadata();
} finally {
store.close();
}
}
/*
* Format metadata to the standard output stream.
*/