@Override protected FilePath tryResolve() { return FilePathUtils.find(slave, path); } @Override public String toString() {
/** Reconstructs the live workspace, if possible. */ public final @CheckForNull FilePath getWorkspace() { return FilePathUtils.find(getNode(), getPath()); }
private @CheckForNull FilePath getWorkspace() throws AbortException { if (ws == null) { ws = FilePathUtils.find(node, remote); if (ws == null) { LOGGER.log(Level.FINE, "Jenkins is not running, no such node {0}, or it is offline", node); return null; } } boolean directory; try (Timeout timeout = Timeout.limit(10, TimeUnit.SECONDS)) { directory = ws.isDirectory(); } catch (Exception x) { // RequestAbortedException, ChannelClosedException, EOFException, wrappers thereof; InterruptedException if it just takes too long. LOGGER.log(Level.FINE, node + " is evidently offline now", x); ws = null; if (!printedCannotContactMessage) { logger().println("Cannot contact " + node + ": " + x); printedCannotContactMessage = true; } return null; } if (!directory) { throw new AbortException("missing workspace " + remote + " on " + node); } return ws; }