/** * Execute the task. * @throws BuildException if errors occur. */ @Override public void execute() throws BuildException { if (sources == null) { throw new BuildException( "At least one set of source resources must be specified"); } if (targets == null) { throw new BuildException( "At least one set of target files must be specified"); } //no sources = nothing to compare; no targets = nothing to delete: if (!sources.isEmpty() && !targets.isEmpty() && !uptodate(sources, targets)) { log("Deleting all target files.", Project.MSG_VERBOSE); if (verbose) { for (String t : targets.list()) { log("Deleting " + t); } } Delete delete = new Delete(); delete.bindToOwner(this); delete.add(targets); delete.perform(); } }
private void delete(File outputFile) { if (!format.equals(FRAMES)) return; Delete deleteTask = new Delete(); deleteTask.bindToOwner(task); deleteTask.setFile(outputFile); deleteTask.execute(); }
/** * Delete a directory and all subdirectories */ public static void recursivelyDeleteDir(File customProfileDir) { if (customProfileDir == null || !customProfileDir.exists()) { return; } Delete delete = new Delete(); delete.setProject(new Project()); delete.setDir(customProfileDir); delete.setFailOnError(true); delete.execute(); }
Delete delete = new Delete(); delete.setProject(tempProject); delete.setFile(src); delete.execute(); Move mv =new Move(); mv.setProject(tempProject);
private void removeFolder(String folder, String file) { final File dir = new File(new File(folder), file); Delete delete = new Delete(); delete.setDir(dir); delete.setIncludeEmptyDirs(true); delete.execute(); System.err.println("Deleting " + file); }
/** * This method will remove files from the source directory. * * @param installedDirectory The destination directory to copy to. * @param removePattern The file pattern to match to locate files to copy. */ protected void removeGeneratedFiles(final String installedDirectory, final String removePattern) { Delete deleteTask = (Delete) antProject.createTask("delete"); FileSet fileSet = AntUtils.createFileset(installedDirectory, removePattern, new ArrayList()); log("Removing generated files (pattern: " + removePattern + ")..."); deleteTask.addFileset(fileSet); deleteTask.execute(); }
private void delete(File outputFile) { if (!format.equals(FRAMES)) return; Delete deleteTask = new Delete(); deleteTask.bindToOwner(task); deleteTask.setFile(outputFile); deleteTask.execute(); }
/** * Delete a directory and all subdirectories */ public static void recursivelyDeleteDir(File customProfileDir) { if (customProfileDir == null || !customProfileDir.exists()) { return; } Delete delete = new Delete(); delete.setProject(new Project()); delete.setDir(customProfileDir); delete.setFailOnError(true); delete.execute(); }
Delete mydelete = new Delete(); mydelete.bindToOwner(task); mydelete.setFile(tempFile.getCanonicalFile()); mydelete.execute(); } catch (Exception e) { throw new BuildException(e, task.getLocation());
Delete delete = new Delete(); delete.setProject(getAntProject()); delete.setIncludes(FILE_PATTERN_CERT); delete.setDir(targetChainDir); delete.execute();
Delete mydelete = new Delete(); mydelete.bindToOwner(this); mydelete.setFile(tempFile.getCanonicalFile()); mydelete.execute(); } catch (Exception e) { throw new BuildException(e, getLocation());
Delete delete = new Delete(); delete.setProject(project); delete.setDir(scanDirectory); delete.execute();
Delete mydelete = new Delete(); mydelete.bindToOwner(this); mydelete.setFile(tempFile.getCanonicalFile()); mydelete.execute(); } catch (Exception e) { throw new BuildException(e, getLocation());
Delete mydelete = new Delete(); mydelete.bindToOwner(this); mydelete.setFile(tempFile.getCanonicalFile()); mydelete.execute(); } catch (Exception e) { throw new BuildException(e, getLocation());
task.log("Transform time: " + dt + "ms"); if (format.equals(FRAMES)) { Delete delete = new Delete(); delete.bindToOwner(task); delete.setFile(outputFile); delete.execute();