| | |
| | | package com.lf.server.service.all; |
| | | |
| | | import com.lf.server.entity.ctrl.TabMapperEntity; |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.*; |
| | | import org.apache.commons.logging.Log; |
| | |
| | | /** |
| | | * 查询映射 |
| | | */ |
| | | public List<TabMapperEntity> selectMappers(String subPath) { |
| | | String root = pathHelper.getConfig().getTempPath() + File.separator + subPath; |
| | | |
| | | File file = new File(root); |
| | | if (!file.exists() && !file.isDirectory()) { |
| | | return null; |
| | | public List<MetaFileEntity> selectMappers(List<MetaFileEntity> metas, DirEntity dir, String epsgCode) { |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | for (MetaFileEntity meta : metas) { |
| | | // |
| | | } |
| | | |
| | | File[] files = file.listFiles(); |
| | | if (null == files || files.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | File zipFile = new File(root + "_zip"); |
| | | if (!zipFile.exists() || !zipFile.isDirectory()) { |
| | | zipFile.mkdirs(); |
| | | } |
| | | |
| | | return getMappers(zipFile.getPath(), files); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取映射 |
| | | */ |
| | | private List<TabMapperEntity> getMappers(String zipPath, File[] files) { |
| | | /*private List<TabMapperEntity> getMappers(String zipPath, File[] files) { |
| | | String temp = pathHelper.getConfig().getTempPath(); |
| | | |
| | | List<TabMapperEntity> list = new ArrayList<>(); |
| | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取Shp文件 |
| | | */ |
| | | private void getShpFiles(String sourceName, String subPath, List<TabMapperEntity> list) { |
| | | List<String> files = new ArrayList<>(); |
| | | getShpFiles(subPath, files); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取Shp文件 |
| | | */ |
| | | private void getShpFiles(String shpPath, List<String> list) { |
| | | File file = new File(shpPath); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取Gdb文件 |
| | | */ |
| | | private void getGdbFiles(String sourceName, String subPath, List<TabMapperEntity> list) { |
| | | List<String> files = new ArrayList<>(); |
| | | getGdbFiles(subPath, files); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取Gdb文件 |
| | | */ |
| | | private void getGdbFiles(String shpPath, List<String> list) { |
| | | File file = new File(shpPath); |
| | | |
| | |
| | | |
| | | getGdbFiles(f.getPath(), list); |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | private boolean isGdbFile(File f) { |
| | | if (f.getName().toLowerCase().endsWith(GDB)) { |