问题描述
Java使用Geotools对shp文件进行读取,读取完成之后.shp、.dbf、.shx文件总是被占用,无法删除。
读取shp的代码块:
try {
ShapefileDataStore shapefileDataStore = new ShapefileDataStore(shpfile.toURI().toURL());
//设置编码,防止中文乱码
Charset charset = getShapeFileCharsetName(shapePath);
// Charset charset = Charset.forName("GBK");
shapefileDataStore.setCharset(charset);
String typeName = shapefileDataStore.getTypeNames()</