/** * Performs syntactical check on the remote FS for agents. */ public FormValidation doCheckRemoteFS(@QueryParameter String value) throws IOException, ServletException { if(Util.fixEmptyAndTrim(value)==null) return FormValidation.error(Messages.Slave_Remote_Director_Mandatory()); if(value.startsWith("\\\\") || value.startsWith("/net/")) return FormValidation.warning(Messages.Slave_Network_Mounted_File_System_Warning()); if (Util.isRelativePath(value)) { return FormValidation.warning(Messages.Slave_Remote_Relative_Path_Warning()); } return FormValidation.ok(); }
if (Util.isRelativePath(remoteFS)) { remoteFS = channel.call(new AbsolutePath(remoteFS)); log.println("NOTE: Relative remote path resolved to: "+remoteFS);
@Restricted(NoExternalUse.class) @SuppressWarnings("unused") public FormValidation doCheckPhysicalPathOnDisk(@QueryParameter String value) { if (!isRelativePath(value)) { return FormValidation.error(Messages.formValidation_NotRelativePath()); } return FormValidation.ok(); }
/** * Normalizes the given custom path and returns it. * * @param customPath the workspace path to be used on the disk * @return the normalized custom path * @throws IOException if the {@code customPath} is not a relative path, or if it contains any '$' characters, * meaning that the path was not resolved correctly in the Pipeline script */ @Nonnull private String computeCustomPath(@Nonnull String customPath) throws IOException { if (!isRelativePath(customPath)) { String message = format("The custom path: %s must be a relative path", customPath); throw new AbortException(message); } if (customPath.contains("${")) { String message = format("The custom path: %s contains '${' characters. Did you resolve correctly the parameters with Build DSL?", customPath); throw new AbortException(message); } return new FilePath(new File(customPath)).getRemote(); }
/** * Performs syntactical check on the remote FS for agents. */ public FormValidation doCheckRemoteFS(@QueryParameter String value) throws IOException, ServletException { if(Util.fixEmptyAndTrim(value)==null) return FormValidation.error(Messages.Slave_Remote_Director_Mandatory()); if(value.startsWith("\\\\") || value.startsWith("/net/")) return FormValidation.warning(Messages.Slave_Network_Mounted_File_System_Warning()); if (Util.isRelativePath(value)) { return FormValidation.warning(Messages.Slave_Remote_Relative_Path_Warning()); } return FormValidation.ok(); }
/** * Computes the path to be used on the physical disk. * The computed path has the following pattern: physicalPathOnDisk/$JOB_NAME/$BUILD_NUMBER. * Where $JOB_NAME also includes all the folders, if Folders plugin is in use. * * @param diskId the Disk ID where the physical path on the disk is defined * @param physicalPathOnDisk the physical path on the disk * @return the computed file path on the physical disk * @throws IOException if the {@code physicalPathOnDisk} argument is not a relative path */ @Nonnull private String computeDefaultPathOnDisk(@Nonnull String diskId, @CheckForNull String physicalPathOnDisk) throws IOException { if (physicalPathOnDisk == null) { physicalPathOnDisk = StringUtils.EMPTY; } if (!isRelativePath(physicalPathOnDisk)) { String message = format("Physical path on disk defined for Disk ID '%s', within Disk Pool ID '%s' must be a relative path", diskId, step.getDiskPoolId()); throw new AbortException(message); } File pathOnDisk = Paths.get(physicalPathOnDisk, run.getParent().getFullName(), String.valueOf(run.getNumber())).toFile(); return new FilePath(pathOnDisk).getRemote(); }
Set<String> existingMessages = new HashSet<>(); if (!Util.isRelativePath(value)) { formValidations.add(error(Messages.formValidation_NotRelativePath()));
if (!isRelativePath(template)) { throw new AbortException(format("Workspace template defined for Disk Pool '%s' must be a relative path", step.getDiskPoolId()));
if (Util.isRelativePath(remoteFS)) { remoteFS = channel.call(new AbsolutePath(remoteFS)); log.println("NOTE: Relative remote path resolved to: "+remoteFS);