private WorkspaceListLeasePickle(WorkspaceList.Lease lease) { slave = FilePathUtils.getNodeNameOrNull(lease.path); path = lease.path.getRemote(); }
/** * Same as {@link #getNodeNameOrNull} but throws a diagnostic exception in case of failure. * @param f a file, possible remote * @return a node name ({@code ""} for master), if known * @throws IllegalStateException if the association to a node is unknown */ public static @Nonnull String getNodeName(@Nonnull FilePath f) throws IllegalStateException { String name = getNodeNameOrNull(f); if (name != null) { return name; } else { throw new IllegalStateException("no known slave for " + f + " among " + Listener.getChannelNames()); } }