public static FileData createFromFile(File file) throws IOException { if (file.isDirectory()) { return new Directory(file); } if (new VFSWorker().canHandle(file)) { return new Archive(file); } return new SpatialFile(file); } public File getFile() {
public static FileData createFromFile(File file) throws IOException { if (file.isDirectory()) { return new Directory(file); } if (new VFSWorker().canHandle(file)) { return new Archive(file); } return new SpatialFile(file); }
@Test public void testCreateContextFromArchive() throws Exception { File file = file("shape/archsites_epsg_prj.zip"); Archive arch = new Archive(file); ImportContext context = importer.createContext(arch); assertEquals(1, context.getTasks().size()); }