public static boolean isNotBlank(String s) { return !isBlank(s); }
private String getManagedServerNameFromPathAttribute(String nodePath) { for (StringTokenizer tokenizer = new StringTokenizer(nodePath, PATH_DELIM); tokenizer.hasMoreTokens();) { String token = tokenizer.nextToken(); if (token.startsWith(SERVER_PREFIX)) { String managedServerName = token.substring(SERVER_PREFIX.length()); if (StringUtil.isBlank(managedServerName)) { throw new RuntimeException("Blank managed server name in path [" + nodePath + "]"); } return managedServerName; } } throw new RuntimeException("Could not determine managed server name from path [" + nodePath + "]"); } }
private void validateAttributes() throws BuildException { if (isBlank(table)) { throw new BuildException(MSG.getMsg(SCHEMA_SPEC_TASK_MISSING_ATTRIB, "DropForeignKeys", "table")); } if (isBlank(column)) { throw new BuildException(MSG.getMsg(SCHEMA_SPEC_TASK_MISSING_ATTRIB, "DropForeignKeys", "column")); } }
/** * Uploads the file specified by its absolute <code>filename</code>. * * @param filename absolute path of the file to upload * @return a temporary content handle * @see org.rhq.enterprise.server.content.ContentManagerRemote#createTemporaryContentHandle() * @see ContentManagerRemote#uploadContentFragment(String, byte[], int, int) * @throws IllegalArgumentException if <code>filename</code> is empty, if the file does not exist or if it is a * directory */ public String upload(String filename) { if (StringUtil.isBlank(filename)) { throw new IllegalArgumentException("Empty path"); } return upload(new File(filename)); }
content = request.getContent(); runtimeName = request.getParams().get("runtimeName"); if (StringUtil.isBlank(runtimeName)) { runtimeName = filename;
if (matchingHistory != null) { String userSuppliedResourceName = matchingHistory.getCreatedResourceName(); if (!isBlank(userSuppliedResourceName) && !userSuppliedResourceName.equals(resource.getName())) { resource.setName(userSuppliedResourceName);
private BundleHandoverResponse handleDeployment(BundleHandoverRequest handoverRequest) { String serverGroup = handoverRequest.getParams().get("serverGroup"); if (isBlank(serverGroup)) { return BundleHandoverResponse.failure(MISSING_PARAMETER, "serverGroup parameter is missing");