/** * Get a List that describes each VOTable column. * * @throws java.io.IOException * @throws VOTableParserException if unable to parse the VOTable. * @return List of ColumnDesc describing the VOTable columns. */ @Override public TableDesc getTableDesc() throws IOException, VOTableParserException { init(); TableDesc tableDesc = TapSchemaUtil.createTableDesc(UploadManager.SCHEMA, tableName, votable); log.debug("table: " + tableDesc); return tableDesc; }
private TableDesc toTableDesc(VOTableDocument doc) { // TODO: reject if the table has any rows? try to insert them if it is small enough? for (VOTableResource vr : doc.getResources()) { VOTableTable vtab = vr.getTable(); if (vtab != null) { TableDesc ret = TapSchemaUtil.createTableDesc("default", "default", vtab); log.debug("create from VOtable: " + ret); return ret; } } throw new IllegalArgumentException("no table description found in VOTable document"); } }