if (lastModified != 0 && sourceTimestamp == lastModified) return false; // already up to date this.deleteContents(); } else { this.mkdirs();
/** * {@inheritDoc} */ @Override public void beforeCheckout(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener) throws IOException, InterruptedException, GitException { listener.getLogger().println("Wiping out workspace first."); git.getWorkTree().deleteContents(); }
/** * Performs cleaning workspace before checkout. * * @param moduleLocation ModuleLocation. * @param launcher Launcher. * @param dir workspace directory. * @param listener Listener. * @param buildDate date of the build than will be used for checkout operation with -D flag * @return true if checkout successful and false otherwise, * * @throws IOException if i/o errors. * @throws InterruptedException if interrupted. */ boolean cleanCheckout(ModuleLocation moduleLocation, Launcher launcher, FilePath dir, TaskListener listener, Date buildDate) throws InterruptedException, IOException { FilePath path = flatten ? dir.getParent() : dir; if (StringUtils.isNotEmpty(moduleLocation.getLocalDir())) { path = path.child(moduleLocation.getLocalDir()); } try { path.deleteContents(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Cannot perform cleaning."); return false; } catch (InterruptedException e) { LOGGER.log(Level.WARNING, "Operation was interrupted"); return false; } return checkout(moduleLocation, launcher, dir, listener, buildDate); }
if (lastModified != 0 && sourceTimestamp == lastModified) return false; // already up to date this.deleteContents(); } else { this.mkdirs();
if (! workspaces.exists(workspaceName)) { if ((!useUpdate || workspaceNamesToDelete.size() > 0) && localFolderPath.exists()) { localFolderPath.deleteContents();
if(timestamp.exists() && sourceTimestamp ==timestamp.lastModified()) return false; // already up to date this.deleteContents(); } else { this.mkdirs();
if(timestamp.exists() && sourceTimestamp ==timestamp.lastModified()) return false; // already up to date this.deleteContents(); } else { this.mkdirs();
if(timestamp.exists() && sourceTimestamp ==timestamp.lastModified()) return false; // already up to date this.deleteContents(); } else { this.mkdirs();
return false; // already up to date this.deleteContents(); } else { this.mkdirs();
return false; // already up to date expected.deleteContents(); } else { expected.mkdirs();
if (timestamp.exists() && sourceTimestamp == timestamp.lastModified()) return install; // already up to date install.deleteContents();
if (timestamp.exists() && sourceTimestamp == timestamp.lastModified()) return install; // already up to date install.deleteContents();
listener.getLogger().println("Wiping out workspace first."); try { ws.deleteContents(); } catch (InterruptedException e) {
listener.getLogger().println("Wiping out workspace first."); try { ws.deleteContents(); } catch (InterruptedException e) {
private boolean checkout(Launcher launcher, FilePath dir, TaskListener listener, Date dt) throws IOException, InterruptedException { dir.deleteContents(); ArgumentListBuilder cmd = new ArgumentListBuilder(); cmd.add(getDescriptor().getCvsExeOrDefault(), noQuiet ? null : (debug ? "-t" : "-Q"), compression(), "-d", cvsroot, "co", "-P"); if (branch != null) { cmd.add("-r", branch); } if (flatten) { cmd.add("-d", dir.getName()); } configureDate(cmd, dt); cmd.add(getAllModulesNormalized()); if (!run(launcher, cmd, listener, flatten ? dir.getParent() : dir)) { return false; } // clean up the sticky tag if (flatten) { dir.act(new StickyDateCleanUpTask()); } else { for (String module : getAllModulesNormalized()) { dir.child(module).act(new StickyDateCleanUpTask()); } } return true; }