@Override public boolean canRead(ImportData data) throws IOException { File file = getFileFromData(data); return file.canRead() && "gml".equalsIgnoreCase(FilenameUtils.getExtension(file.getName())); }
@Override public FeatureReader read(ImportData data, ImportTask task) throws IOException { File file = getFileFromData(data); // we need to get the feature type, to use for the particular parse through the file // since we put it on the metadata from the list method, we first check if that's still // available SimpleFeatureType ft = (SimpleFeatureType) task.getMetadata().get(FeatureType.class); GMLVersion version = (GMLVersion) task.getMetadata().get(GML_VERSION_KEY); if (version == null) { version = GMLVersion.GML3; } if (ft == null) { FeatureTypeInfo fti = (FeatureTypeInfo) task.getLayer().getResource(); ft = buildFeatureTypeFromInfo(fti); } return new GMLReader(new FileInputStream(file), version.getConfiguration(), ft); }
@Override public List<ImportTask> list(ImportData data, Catalog catalog, ProgressMonitor monitor) throws IOException { File file = getFileFromData(data); SimpleFeatureType featureType = getSchema(file); CatalogFactory factory = catalog.getFactory();