/** * Set the salt value. Must not be null. * @param salt */ public void setCrumbSalt(String salt) { if (Util.fixEmptyAndTrim(salt) == null) { crumbSalt = "hudson.crumb"; } else { crumbSalt = salt; } }
/** * Subclasses should pass these parameters in using {@link DataBoundConstructor}. */ protected ToolInstaller(String label) { this.label = Util.fixEmptyAndTrim(label); }
/** * Sets the human readable name of the user. * If the input parameter is empty, the user's ID will be set. */ public void setFullName(String name) { if (Util.fixEmptyAndTrim(name) == null) name = id; this.fullName = name; }
@Override protected String parse(String line) { return Util.fixEmptyAndTrim(line); }
@DataBoundConstructor public MavenInstallation(String name, String home, List<? extends ToolProperty<?>> properties) { super(Util.fixEmptyAndTrim(name), Util.fixEmptyAndTrim(home), properties); }
@DataBoundConstructor public ZipExtractionInstaller(String label, String url, String subdir) { super(label); this.url = url; this.subdir = Util.fixEmptyAndTrim(subdir); }
@DataBoundConstructor public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs) { this.tunnel = Util.fixEmptyAndTrim(tunnel); this.vmargs = Util.fixEmptyAndTrim(vmargs); }
@DataBoundConstructor public RemotingWorkDirSettings(boolean disabled, @CheckForNull String workDirPath, @CheckForNull String internalDir, boolean failIfWorkDirIsMissing) { this.disabled = disabled; this.workDirPath = Util.fixEmptyAndTrim(workDirPath); this.failIfWorkDirIsMissing = failIfWorkDirIsMissing; String internalDirName = Util.fixEmptyAndTrim(internalDir); this.internalDir = internalDirName != null ? internalDirName : DEFAULT_INTERNAL_DIR; }
@DataBoundConstructor public ProxyConfiguration(String name, int port, String userName, String password, String noProxyHost, String testUrl) { this.name = Util.fixEmptyAndTrim(name); this.port = port; this.userName = Util.fixEmptyAndTrim(userName); this.secretPassword = Secret.fromString(password); this.noProxyHost = Util.fixEmptyAndTrim(noProxyHost); this.testUrl = Util.fixEmptyAndTrim(testUrl); this.authenticator = newAuthenticator(); }
/** * Makes sure that the given string is not null or empty. */ public static FormValidation validateRequired(String value) { if (Util.fixEmptyAndTrim(value) == null) return error(Messages.FormValidation_ValidateRequired()); return ok(); }
public FormValidation doCheckCustomWorkspace(@QueryParameter String customWorkspace){ if(Util.fixEmptyAndTrim(customWorkspace)==null) return FormValidation.error(Messages.AbstractProject_CustomWorkspaceEmpty()); else return FormValidation.ok(); }
public void setDisplayName(String displayName) throws IOException { this.displayName = Util.fixEmptyAndTrim(displayName); save(); }
public void setShell(String shell) { this.shell = Util.fixEmptyAndTrim(shell); save(); }
@DataBoundConstructor public Maven(String targets,String name, String pom, String properties, String jvmOptions, boolean usePrivateRepository, SettingsProvider settings, GlobalSettingsProvider globalSettings, boolean injectBuildVariables) { this.targets = targets; this.mavenName = name; this.pom = Util.fixEmptyAndTrim(pom); this.properties = Util.fixEmptyAndTrim(properties); this.jvmOptions = Util.fixEmptyAndTrim(jvmOptions); this.usePrivateRepository = usePrivateRepository; this.settings = settings != null ? settings : GlobalMavenConfig.get().getSettingsProvider(); this.globalSettings = globalSettings != null ? globalSettings : GlobalMavenConfig.get().getGlobalSettingsProvider(); this.injectBuildVariables = injectBuildVariables; }
protected void submit(JSONObject json) throws IOException { setDisplayName(Util.fixEmptyAndTrim(json.getString("displayName"))); setDescription(json.getString("description")); }
public FormValidation doCheckName(@QueryParameter String value ) { String name = Util.fixEmptyAndTrim(value); if(name==null) return FormValidation.error(Messages.NodeDescriptor_CheckName_Mandatory()); try { Jenkins.checkGoodName(name); } catch (Failure f) { return FormValidation.error(f.getMessage()); } return FormValidation.ok(); }
/** * 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(); }
@RequirePOST public HttpResponse doDoDisconnect(@QueryParameter String offlineMessage) { if (channel!=null) { //does nothing in case computer is already disconnected checkPermission(DISCONNECT); offlineMessage = Util.fixEmptyAndTrim(offlineMessage); disconnect(new OfflineCause.UserCause(User.current(), offlineMessage)); } return new HttpRedirect("."); }
@RequirePOST public HttpResponse doChangeOfflineCause(@QueryParameter String offlineMessage) throws IOException, ServletException { checkPermission(DISCONNECT); offlineMessage = Util.fixEmptyAndTrim(offlineMessage); setTemporarilyOffline(true, new OfflineCause.UserCause(User.current(), offlineMessage)); return HttpResponses.redirectToDot(); }
@RequirePOST public HttpResponse doToggleOffline(@QueryParameter String offlineMessage) throws IOException, ServletException { if(!temporarilyOffline) { checkPermission(DISCONNECT); offlineMessage = Util.fixEmptyAndTrim(offlineMessage); setTemporarilyOffline(!temporarilyOffline, new OfflineCause.UserCause(User.current(), offlineMessage)); } else { checkPermission(CONNECT); setTemporarilyOffline(!temporarilyOffline,null); } return HttpResponses.redirectToDot(); }