| | |
| | | @Service |
| | | public class BaseUploadService { |
| | | @Autowired |
| | | private DirService dirService; |
| | | protected DirService dirService; |
| | | |
| | | @Autowired |
| | | private PathHelper pathHelper; |
| | | protected PathHelper pathHelper; |
| | | |
| | | public final Log log = LogFactory.getLog(getClass()); |
| | | |
| | |
| | | |
| | | String fileName = FileHelper.getFileName(f.getPath()); |
| | | String extName = FileHelper.getExtension(fileName); |
| | | if (!StaticData.ALL_EXTENSION.contains(extName)) { |
| | | if (!StaticData.ALL_EXTENSION.contains(extName) || fileName.startsWith("~")) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | if (isShp) { |
| | | List<String> shpFiles = getShpFiles(f.getPath()); |
| | | mf.setTab(fileName); |
| | | mf.setTab(fileName.replace(StaticData.SHP, "")); |
| | | mf.setSizes(getFilesSize(shpFiles)); |
| | | mf.setGuid(getFilesMd5(shpFiles)); |
| | | } else { |
| | |
| | | if (0 != dir.getPid() || null == dirs || dirs.isEmpty()) { |
| | | return dir.getId(); |
| | | } |
| | | if ("/".equals(File.separator)) { |
| | | if (StaticData.SLASH.equals(File.separator)) { |
| | | filePath = filePath.replace("/", "\\"); |
| | | } |
| | | |
| | |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(shpPath); |
| | | |
| | | for (int i = 1, c = StaticData.SHP_EXTENSION.size(); i < c; i++) { |
| | | String path = shpPath.replace(".shp", StaticData.SHP_EXTENSION.get(i)); |
| | | for (int i = 0, c = StaticData.SHP_EXT.size(); i < c; i++) { |
| | | String path = shpPath.replace(".shp", StaticData.SHP_EXT.get(i)); |
| | | |
| | | File f = new File(path); |
| | | if (f.exists() && !f.isDirectory()) { |