@Test public void testBlankLines() throws IOException { URL resource = TestData.getResource(CSVDataStoreTest.class, "locations.csv"); File tmp = File.createTempFile("example", ""); boolean exists = tmp.exists(); if (exists) { tmp.delete(); } boolean created = tmp.mkdirs(); assertTrue(created); File blankLinefile = new File(tmp, "locations.csv"); Files.copy( resource.openStream(), blankLinefile.toPath(), StandardCopyOption.REPLACE_EXISTING); try (FileWriter writer = new FileWriter(blankLinefile, true)) { writer.append("\n"); } CSVFileState csvFileState = new CSVFileState(blankLinefile); CSVLatLonStrategy csvStrategy = new CSVLatLonStrategy(csvFileState); CSVDataStore dataStore = new CSVDataStore(csvFileState, csvStrategy); SimpleFeatureSource source = dataStore.getFeatureSource(); assertNotNull(source); SimpleFeatureCollection features = source.getFeatures(); assertNotNull(features); assertEquals(9, features.size()); }
@Override public SimpleFeatureSource getFeatureSource() throws IOException { return super.getFeatureSource(getTypeName()); }
CSVDataStore extends ContentDataStore implements FileDataStore { @Override public SimpleFeatureSource getFeatureSource() throws IOException { return super.getFeatureSource(getTypeName()); } }
CSVDataStore extends ContentDataStore implements FileDataStore { @Override public SimpleFeatureSource getFeatureSource() throws IOException { return super.getFeatureSource(getTypeName()); } CSVDataStore(CSVFileState csvFileState, CSVStrategy csvStrategy); }
CSVDataStore extends ContentDataStore implements FileDataStore { @Override public SimpleFeatureSource getFeatureSource() throws IOException { return super.getFeatureSource(getTypeName()); } CSVDataStore(CSVFileState csvFileState, CSVStrategy csvStrategy); Name getTypeName(); @Override SimpleFeatureType getSchema(); @Override void updateSchema(SimpleFeatureType featureType); @Override SimpleFeatureSource getFeatureSource(); @Override FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); CSVStrategy getCSVStrategy(); @Override void createSchema(SimpleFeatureType featureType); }
CSVDataStore extends ContentDataStore implements FileDataStore { @Override public SimpleFeatureSource getFeatureSource() throws IOException { return super.getFeatureSource(getTypeName()); } CSVDataStore(CSVFileState csvFileState, CSVStrategy csvStrategy); Name getTypeName(); @Override SimpleFeatureType getSchema(); @Override void updateSchema(SimpleFeatureType featureType); @Override SimpleFeatureSource getFeatureSource(); @Override FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(
            Filter filter, Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(Transaction transaction); @Override FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriterAppend(
            Transaction transaction); CSVStrategy getCSVStrategy(); @Override void createSchema(SimpleFeatureType featureType);  }