| | |
| | | |
| | | public static final int OP_DELETE = 3; |
| | | |
| | | private final String STR_DOT = "."; |
| | | |
| | | public String deleteFiles(String relPath, List<String> fileNames, String base) { |
| | | String result = null; |
| | | try { |
| | | //logger.fine(fileNames.toString()); |
| | | if (!relPath.startsWith(Const.STR_DOT)) { |
| | | if (!relPath.startsWith(STR_DOT)) { |
| | | File targetDir = new File(base, relPath); // getTargetDir(relPath); |
| | | //logger.fine("targetDir: " + targetDir); |
| | | for (String fileName : fileNames) { |
| | | File targetFile = new File(targetDir, fileName); |
| | | //logger.fine(targetFile.getAbsolutePath()); |
| | | if (targetFile.isDirectory()) { |
| | | CopyMoveVisitor bearbeiter = new CopyMoveVisitor(); |
| | | FileOpsVisitor bearbeiter = new FileOpsVisitor(); |
| | | bearbeiter.setOperation(OP_DELETE); |
| | | Files.walkFileTree(targetFile.toPath(), bearbeiter); |
| | | } else { |
| | |
| | | |
| | | private void deleteImgFiles(File targetDir, File targetFile) throws IOException { |
| | | String fnameext = targetFile.getName(); |
| | | int dotpos = fnameext.lastIndexOf(Const.STR_DOT); |
| | | int dotpos = fnameext.lastIndexOf(STR_DOT); |
| | | String fname = fnameext.substring(0, dotpos); |
| | | String ext = fnameext.substring(dotpos); |
| | | //logger.fine("fname: " + fname + ", ext: " + ext); |