@Override
public boolean processWorkspaceBeforeDeletion(AbstractProject<?,?> project, FilePath workspace, Node node) {
Logger perforceLogger = Logger.getLogger(PerforceSCM.class.getName());
perforceLogger.info(
"Workspace '"+workspace.getRemote()+"' is being deleted; flushing workspace to revision 0.");
TaskListener loglistener = new LogTaskListener(perforceLogger,Level.INFO);
PrintStream log = loglistener.getLogger();
TaskListener listener = new StreamTaskListener(log);
Launcher launcher = node.createLauncher(listener);
try {
Depot depot = getDepot(launcher, workspace, project, null, node);