| | |
| | | |
| | | List<MetaFileEntity> list = new ArrayList<>(); |
| | | for (MetaFileEntity meta : metas) { |
| | | meta.setEventid(StringHelper.getGuid()); |
| | | meta.setDirid(dir.getId()); |
| | | meta.setDepid(ue.getDepid()); |
| | | meta.setVerid(ver.getId()); |
| | |
| | | continue; |
| | | } |
| | | |
| | | boolean isShp = StaticData.SHP.equals(extName); |
| | | if (isGdb) { |
| | | // |
| | | continue; |
| | | } |
| | | |
| | | MetaFileEntity mf = createMetaFileEntity(meta); |
| | | mf.setName(fileName); |
| | | mf.setExtName(extName); |
| | | mf.setSizes(FileHelper.sizeToMb(f.length())); |
| | | mf.setPath(f.getPath().substring(subPath.length())); |
| | | mf.setGuid(FileHelper.getFileMd5(f.getPath())); |
| | | if (isShp) { |
| | | mf.setTab(fileName); |
| | | // |
| | | } else { |
| | | mf.setGuid(FileHelper.getFileMd5(f.getPath())); |
| | | } |
| | | list.add(mf); |
| | | } |
| | | |
| | | return list; |
| | |
| | | */ |
| | | private MetaFileEntity createMetaFileEntity(MetaFileEntity meta) { |
| | | MetaFileEntity mf = new MetaFileEntity(); |
| | | mf.setEventid(StringHelper.getGuid()); |
| | | mf.setDirid(meta.getDirid()); |
| | | mf.setDepid(meta.getDepid()); |
| | | mf.setVerid(meta.getVerid()); |
| | |
| | | } |
| | | } |
| | | |
| | | private void getGdbFiles(String sourceName, String subPath, List<TabMapperEntity> list) { |
| | | List<String> files = new ArrayList<>(); |
| | | getGdbFiles(subPath, files); |
| | | |
| | | String root = pathHelper.getConfig().getTempPath() + File.separator; |
| | | for (String file : files) { |
| | | String path = file.replace(root, ""); |
| | | List<String> tabs = GdbHelper.getTabNames(file); |
| | | for (String tab : tabs) { |
| | | list.add(new TabMapperEntity(sourceName, "gdb", tab, path)); |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | private void getShpFiles(String shpPath, List<String> list) { |
| | | File file = new File(shpPath); |
| | | |
| | |
| | | |
| | | if (f.getName().toLowerCase().endsWith(".shp")) { |
| | | list.add(f.getPath()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void getGdbFiles(String sourceName, String subPath, List<TabMapperEntity> list) { |
| | | List<String> files = new ArrayList<>(); |
| | | getGdbFiles(subPath, files); |
| | | |
| | | String root = pathHelper.getConfig().getTempPath() + File.separator; |
| | | for (String file : files) { |
| | | String path = file.replace(root, ""); |
| | | List<String> tabs = GdbHelper.getTabNames(file); |
| | | for (String tab : tabs) { |
| | | list.add(new TabMapperEntity(sourceName, "gdb", tab, path)); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | getGdbFiles(f.getPath(), list); |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | /** |
| | | * 是/否为GDB文件 |
| | | */ |
| | | private boolean isGdbFile(File f) { |
| | | if (f.isDirectory() && f.getName().toLowerCase().endsWith(StaticData.GDB)) { |
| | | File[] files = f.listFiles(); |