| | |
| | | * 获取映射 |
| | | */ |
| | | private List<TabMapperEntity> getMappers(String zipPath, File[] files) { |
| | | String temp = pathHelper.getConfig().getTempPath(); |
| | | |
| | | List<TabMapperEntity> list = new ArrayList<>(); |
| | | for (File f : files) { |
| | | String fileName = FileHelper.getFileName(f.getPath()); |
| | | if (fileName.contains(XLS)) { |
| | | list.add(new TabMapperEntity(fileName, "xls", fileName)); |
| | | String path = f.getPath().replace(temp + File.separator, ""); |
| | | list.add(new TabMapperEntity(fileName, "xls", null, path)); |
| | | continue; |
| | | } |
| | | if (fileName.contains(MDB)) { |
| | | String path = f.getPath().replace(temp + File.separator, ""); |
| | | List<String> tabs = MdbHelper.getTabNames(f.getPath()); |
| | | for (String tab : tabs) { |
| | | list.add(new TabMapperEntity(fileName, "mdb", tab, fileName)); |
| | | list.add(new TabMapperEntity(fileName, "mdb", tab, path)); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | List<String> files = new ArrayList<>(); |
| | | getShpFiles(subPath, files); |
| | | |
| | | String root = subPath.substring(0, subPath.lastIndexOf(File.separator) + 1); |
| | | String root = pathHelper.getConfig().getTempPath() + File.separator; |
| | | for (String file : files) { |
| | | String name = FileHelper.getFileName(file); |
| | | String path = file.replace(root, ""); |
| | |
| | | List<String> files = new ArrayList<>(); |
| | | getGdbFiles(subPath, files); |
| | | |
| | | String root = subPath.substring(0, subPath.lastIndexOf(File.separator) + 1); |
| | | String root = pathHelper.getConfig().getTempPath() + File.separator; |
| | | for (String file : files) { |
| | | String path = file.replace(root, ""); |
| | | List<String> tabs = GdbHelper.getTabNames(file); |
| | |
| | | case "shp": |
| | | case "gdb": |
| | | case "mdb": |
| | | String zipPath = FileHelper.getPath(temp + File.separator + mf.getPath()) + "_zip"; |
| | | insertDb(me.getType(), zipPath, mfe, tabs); |
| | | insertDb(me.getType(), temp, mfe, tabs); |
| | | break; |
| | | default: |
| | | break; |