StoreableTable(TableProvider tableProvider, File tableRootDir) { if (tableRootDir == null) { throw new IllegalArgumentException("Table root dir is null"); } else if (!tableRootDir.exists()) { throw new IllegalArgumentException("Proposed root dir not exists"); } else if (!tableRootDir.isDirectory()) { throw new IllegalArgumentException("Proposed object is not directory"); } this.tableProvider = tableProvider; this.tableRootDir = tableRootDir; try { columnTypes = SignatureFile.readSignature(tableRootDir); } catch (IOException e) { throw new IllegalStateException("Can't read signature", e); } index(); }
StoreableTable(TableProvider tableProvider, File tableRootDir, List<Class<?>> classes) { if (tableRootDir == null) { throw new IllegalArgumentException("Table root dir is null"); } else if (!tableRootDir.exists()) { throw new IllegalArgumentException("Proposed root dir not exists"); } else if (!tableRootDir.isDirectory()) { throw new IllegalArgumentException("Proposed object is not directory"); } if (classes == null) { throw new IllegalArgumentException("Column type is null"); } this.tableProvider = tableProvider; this.tableRootDir = tableRootDir; columnTypes = classes; try { SignatureFile.createSignature(tableRootDir, columnTypes); } catch (IOException e) { throw new IllegalStateException("Can't write signature", e); } index(); }