public String getStatusCommandStdOutSearchToken() { if (StringUtils.isNullOrEmpty(statusCommandInfo.stdoutSearchToken)) { return null; } else { return statusCommandInfo.stdoutSearchToken; } }
public String getStopCommandStdOutSearchToken() { if (StringUtils.isNullOrEmpty(stopCommandInfo.stdoutSearchToken)) { return null; } else { return stopCommandInfo.stdoutSearchToken; } }
public String getJavaExecutableToken() { String javaExeToken = ""; if (!StringUtils.isNullOrEmpty(javaExecutable)) { javaExeToken = " -java_exec \"" + javaExecutable + "\""; } return javaExeToken; }
public ShellCommand( String alias, String command ) { if (!StringUtils.isNullOrEmpty(alias)) { this.alias = alias; } this.command = command; }
public String getPortToken() { String portToken = ""; if (!StringUtils.isNullOrEmpty(port)) { portToken = " -port " + port; } return portToken; }
public String getStatusCommand() { if (StringUtils.isNullOrEmpty(statusCommandInfo.command)) { return null; } else { return statusCommandInfo.command; } }
public String getStartCommandStdOutSearchToken() { if (StringUtils.isNullOrEmpty(startCommandInfo.stdoutSearchToken)) { return null; } else { return startCommandInfo.stdoutSearchToken; } }
public String getStatusCommandUrl() { if (StringUtils.isNullOrEmpty(statusCommandInfo.url)) { return null; } else { return statusCommandInfo.url; } }
private void setProxyIfAvailable() { if (!StringUtils.isNullOrEmpty(AtsSystemProperties.SYSTEM_HTTP_PROXY_HOST) && !StringUtils.isNullOrEmpty(AtsSystemProperties.SYSTEM_HTTP_PROXY_PORT)) { webDriver.setProxy(AtsSystemProperties.SYSTEM_HTTP_PROXY_HOST, Integer.parseInt(AtsSystemProperties.SYSTEM_HTTP_PROXY_PORT)); } }
public String getMapSection() { if (sectionNode != null) { String mapSec = sectionNode.getAttributes().getNamedItem(ATT_ELEMENT_NAME).getNodeValue(); if (!StringUtils.isNullOrEmpty(mapSec)) { return mapSec; } } log.error("No map section is set, no attribute of the current section can be get!"); return null; }
/** * Checks if request header with the given key/name has already been added * @param name the header key/name * @return true if header with that key/name was already added, false otherwise */ private boolean hasHeader( String name ) { if (StringUtils.isNullOrEmpty(name)) { throw new RestException("Error while adding request header. Header name/key is null or empty."); } return requestHeaders.containsKey(name); }
/** * @return files extensions for files treated as Text files */ public String getTextFileExtensions() { String extensions = getOptionalProperty(FILE_SNAPSHOT_TEXT_FILE_EXTENSIONS); if (StringUtils.isNullOrEmpty(extensions)) { return ""; } else { return extensions; } }
private String parseDirectoryAlias( String directoryAlias ) { if (StringUtils.isNullOrEmpty(directoryAlias)) { throw new FileSystemSnapshotException("Invalid directory alias '" + directoryAlias + "'"); } return directoryAlias.trim(); }
/** * @return files extensions for files treated as Properties files */ public String getPropertiesFileExtensions() { String extensions = getOptionalProperty(FILE_SNAPSHOT_PROPERTIES_FILE_EXTENSIONS); if (StringUtils.isNullOrEmpty(extensions)) { return ""; } else { return extensions; } }
private void setFirefoxProxyIfAvailable( DesiredCapabilities capabilities ) { if (!StringUtils.isNullOrEmpty(AtsSystemProperties.SYSTEM_HTTP_PROXY_HOST) && !StringUtils.isNullOrEmpty(AtsSystemProperties.SYSTEM_HTTP_PROXY_PORT)) { capabilities.setCapability(CapabilityType.PROXY, new Proxy().setHttpProxy(AtsSystemProperties.SYSTEM_HTTP_PROXY_HOST + ':' + AtsSystemProperties.SYSTEM_HTTP_PROXY_PORT)); } }
private String parseFilePath( String filePath ) { if (StringUtils.isNullOrEmpty(filePath)) { throw new FileSystemSnapshotException("Invalid file path '" + filePath + "'"); } return IoUtils.normalizeUnixFile(filePath.trim()); }
private String getName( FullReadingBean reading, String jvmPort ) { String jvmName = reading.getName().substring( 6 ); String jvmAlias = reading.getParameter( SystemMonitorDefinitions.PARAMETER_NAME__PROCESS_ALIAS ); if( !StringUtils.isNullOrEmpty( jvmAlias ) ) { jvmName = " [JVM] " + jvmAlias; } else { jvmName = " [JVM] p" + jvmPort + ": " + jvmName; } return jvmName; }
/** * @param keyPath the key path * @return JSON Text which is part of the initial JSON text */ @PublicAtsApi public JsonText get( String keyPath ) { if (StringUtils.isNullOrEmpty(keyPath)) { throw new JsonException("Invalid json path '" + keyPath + "'"); } return getInternalJson(new ArrayList<>(Arrays.asList(keyPath.split(PATH_DELIMETER)))); }
public void setMapSection( String mapSection ) { if (StringUtils.isNullOrEmpty(mapSection)) { throw new ElementsMapException("Error loading elements map section. Provided null/empty map section argument"); } // load the section sectionNode = getSectionNode(mapSection); checkForDuplicatedMapIds(); }
@Override public void skipTextLine( String rootDirectoryAlias, String relativeFilePath, String line, String matchType ) { if (StringUtils.isNullOrEmpty(line)) { throw new FileSystemSnapshotException("The matching string could not be null or empty."); } rootDirectoryAlias = parseDirectoryAlias(rootDirectoryAlias); relativeFilePath = makePathRelative(parseFilePath(relativeFilePath)); DirectorySnapshot dirSnapshot = getDirectorySnapshot(rootDirectoryAlias); dirSnapshot.addSkipTextLineMatcher(rootDirectoryAlias, relativeFilePath, line, MATCH_TYPE.valueOf(matchType)); }