|| "text/xml".equalsIgnoreCase(contentType)
|| filename.endsWith(".xml")
|| filename.endsWith(".vot")) {
// VOTable XML file or FITS table
VoTable table = VoTable.createVoTable(url, null, format);
table.setCatalog(new VoCatalog(table));
return makeCatalogComponent(table.getCatalog());
}
if ("text/csv".equalsIgnoreCase(format)) {
// CSV formatted table
StarTable starTable = new CsvStarTable(new URLDataSource(url));
VoTable table = VoTable.createVoTable(starTable, null, Integer.MAX_VALUE);
table.setCatalog(new VoCatalog(table));
return makeCatalogComponent(table.getCatalog());
}
if (filename.toLowerCase().endsWith(".fits") && !"application/xml".equalsIgnoreCase(contentType)) {
// Local FITS table file
try {
// NavigatorFITSTable table = NavigatorFITSTable.getFitsTable(filename);
VoTable table = VoTable.createVoTable(url, null, format);
table.setCatalog(new VoCatalog(table));
return makeCatalogComponent(table.getCatalog());
} catch (Exception e) {
// ignore: might be an image file, which is handled below
}
}