listener.getLogger().println("Deleting " + ws + " on " + node.getDisplayName()); try { ws.deleteRecursive(); WorkspaceList.tempDir(ws).deleteRecursive(); } catch (IOException x) { Functions.printStackTrace(x, listener.error("Failed to delete " + ws + " on " + node.getDisplayName()));
/** * Wipes out the workspace. */ @RequirePOST public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException { checkPermission(Functions.isWipeOutPermissionEnabled() ? WIPEOUT : BUILD); R b = getSomeBuildWithWorkspace(); FilePath ws = b!=null ? b.getWorkspace() : null; if (ws!=null && getScm().processWorkspaceBeforeDeletion(this, ws, b.getBuiltOn())) { ws.deleteRecursive(); for (WorkspaceListener wl : WorkspaceListener.all()) { wl.afterDelete(this); } return new HttpRedirect("."); } else { // If we get here, that means the SCM blocked the workspace deletion. return new ForwardToView(this,"wipeOutWorkspaceBlocked.jelly"); } }
private void deleteContentsRecursive(File file) throws IOException { File[] files = file.listFiles(); if(files==null) return; // the directory didn't exist in the first place for (File child : files) deleteRecursive(child); }
public void run() { for (File dir : tbr) try { new FilePath(dir).deleteRecursive(); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } }.start();
public void run() { for (File dir : tbr) { try { new FilePath(dir).deleteRecursive(); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } } }.start();
public void run() { for (File dir : tbr) try { new FilePath(dir).deleteRecursive(); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } }.start();
private void delete(FilePath dir) throws InterruptedException { try { listener.getLogger().println("Deleting "+dir); dir.deleteRecursive(); } catch (IOException e) { e.printStackTrace(listener.error("Failed to delete "+dir)); } }
private void delete(FilePath dir) throws InterruptedException { try { listener.getLogger().println("Deleting " + dir); dir.deleteRecursive(); } catch (IOException e) { e.printStackTrace(listener.error("Failed to delete " + dir)); } }
private void delete(FilePath dir) throws InterruptedException { try { listener.getLogger().println("Deleting "+dir); dir.deleteRecursive(); } catch (IOException e) { e.printStackTrace(listener.error("Failed to delete "+dir)); } }
public void run() { for (File dir : tbr) try { new FilePath(dir).deleteRecursive(); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } }.start();
public void run() { for (File dir : tbr) try { new FilePath(dir).deleteRecursive(); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } }.start();
private void delete(FilePath dir) throws InterruptedException { try { listener.getLogger().println("Deleting "+dir); dir.deleteRecursive(); } catch (IOException e) { e.printStackTrace(listener.error("Failed to delete "+dir)); } }
@Override protected Void run() throws Exception { getContext().get(FilePath.class).deleteRecursive(); return null; }
@Override public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, BuildListener listener, File changeLogFile) throws IOException, InterruptedException { if (workspace.exists()) { listener.getLogger().println("Deleting existing workspace " + workspace.getRemote()); workspace.deleteRecursive(); } listener.getLogger().println("Staging "+zip); workspace.unzipFrom(zip.openStream()); return true; } }
@Override public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, BuildListener listener, File changeLogFile) throws IOException, InterruptedException { if (workspace.exists()) { listener.getLogger().println("Deleting existing workspace " + workspace.getRemote()); workspace.deleteRecursive(); } listener.getLogger().println("Staging " + zip); workspace.unzipFrom(zip.openStream()); return true; } }
@Override public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, BuildListener listener, File changeLogFile) throws IOException, InterruptedException { if (workspace.exists()) { listener.getLogger().println("Deleting existing workspace " + workspace.getRemote()); workspace.deleteRecursive(); } listener.getLogger().println("Staging "+zip); workspace.unzipFrom(zip.openStream()); return true; } }
public boolean cleanWorkspace() throws IOException, InterruptedException { checkPermission(BUILD); R b = getSomeBuildWithWorkspace(); FilePath ws = b != null ? b.getWorkspace() : null; if (ws != null && getScm().processWorkspaceBeforeDeletion(this, ws, b.getBuiltOn())) { ws.deleteRecursive(); return true; } else { // If we get here, that means the SCM blocked the workspace deletion. return false; } }
public boolean cleanWorkspace() throws IOException, InterruptedException { checkPermission(BUILD); R b = getSomeBuildWithWorkspace(); FilePath ws = b != null ? b.getWorkspace() : null; if (ws != null && getScm().processWorkspaceBeforeDeletion(this, ws, b.getBuiltOn())) { ws.deleteRecursive(); return true; } else { // If we get here, that means the SCM blocked the workspace deletion. return false; } }
public boolean cleanWorkspace() throws IOException, InterruptedException{ checkPermission(BUILD); R b = getSomeBuildWithWorkspace(); FilePath ws = b != null ? b.getWorkspace() : null; if (ws != null && getScm().processWorkspaceBeforeDeletion(this, ws, b.getBuiltOn())) { ws.deleteRecursive(); return true; } else{ // If we get here, that means the SCM blocked the workspace deletion. return false; } }
public boolean cleanWorkspace() throws IOException, InterruptedException{ checkPermission(BUILD); R b = getSomeBuildWithWorkspace(); FilePath ws = b != null ? b.getWorkspace() : null; if (ws != null && getScm().processWorkspaceBeforeDeletion(this, ws, b.getBuiltOn())) { ws.deleteRecursive(); return true; } else{ // If we get here, that means the SCM blocked the workspace deletion. return false; } }