private String getRequiredProperty(Properties properties, String key) { String value = properties.getProperty(key); if (StringUtils.isNullOrEmpty(value)) { throw new IllegalArgumentException( "Restlet Cloud configuration file error. The property '" + key + "' is required"); } return value; }
/** * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale) */ public String convertToPresentation(String value, Class<? extends String> targetType, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { return StringUtils.nullToEmpty(value); }
/** * Returns an list of trimmed token splitted with the split character ",". * * @param stringToSplit * The String to split. * @return List of tokens. */ public static List<String> splitAndTrim(String stringToSplit) { return splitAndTrim(stringToSplit, ","); }
/** * Writes a header line. * * @param header * The header to write. * @param os * The output stream. * @throws IOException */ public static void writeHeaderLine(Header header, OutputStream os) throws IOException { os.write(StringUtils.getAsciiBytes(header.getName())); os.write(':'); os.write(' '); if (header.getValue() != null) { os.write(StringUtils.getLatin1Bytes(header.getValue())); } os.write(13); // CR os.write(10); // LF }
if (!StringUtils.isNullOrEmpty(apiOperation.nickname())) { operation.setName(apiOperation.nickname()); if (!StringUtils.isNullOrEmpty(apiOperation.value())) { operation.setDescription(apiOperation.value()); if (!StringUtils.isNullOrEmpty(apiOperation.httpMethod())) { operation.setMethod(apiOperation.httpMethod()); if (!StringUtils.isNullOrEmpty(apiOperation.consumes())) { operation.setConsumes(StringUtils.splitAndTrim(apiOperation .consumes())); if (!StringUtils.isNullOrEmpty(apiOperation.produces())) { operation.setProduces(StringUtils.splitAndTrim(apiOperation .produces()));
/** * Generates a name for a resource computed from its path. The name is * composed of all alphanumeric characters in camel case.<br/> * Ex: /contacts/{contactId} => ContactsContactId * * @param uri * The URI of the Resource * @return The Resource's name computed from the path. */ public static String processResourceName(String uri) { StringBuilder sb = new StringBuilder(); String[] split = uri.replaceAll("\\{", "").replaceAll("\\}", "") .split("/"); for (String str : split) { sb.append(StringUtils.firstUpper(str)); } return sb.toString(); }
CONNECT_TIMEOUT); socket.getOutputStream().write( StringUtils.getAsciiBytes(request));
if (!StringUtils.isNullOrEmpty(apiOperation.nickname())) { operation.setName(apiOperation.nickname()); if (!StringUtils.isNullOrEmpty(apiOperation.value())) { operation.setDescription(apiOperation.value()); if (!StringUtils.isNullOrEmpty(apiOperation.httpMethod())) { operation.setMethod(apiOperation.httpMethod()); if (!StringUtils.isNullOrEmpty(apiOperation.consumes())) { operation.setConsumes(StringUtils.splitAndTrim(apiOperation .consumes())); if (!StringUtils.isNullOrEmpty(apiOperation.produces())) { operation.setProduces(StringUtils.splitAndTrim(apiOperation .produces()));
/** * Generates a name for a resource computed from its path. The name is * composed of all alphanumeric characters in camel case.<br/> * Ex: /contacts/{contactId} => ContactsContactId * * @param uri * The URI of the Resource * @return The Resource's name computed from the path. */ public static String processResourceName(String uri) { StringBuilder sb = new StringBuilder(); String[] split = uri.replaceAll("\\{", "").replaceAll("\\}", "") .split("/"); for (String str : split) { sb.append(StringUtils.firstUpper(str)); } return sb.toString(); }
headStream.write(StringUtils.getAsciiBytes(version)); headStream.write(' '); headStream.write(StringUtils.getAsciiBytes(Integer .toString(getStatusCode()))); headStream.write(' '); headStream.write(StringUtils.getLatin1Bytes(getReasonPhrase())); } else { headStream.write(StringUtils .getAsciiBytes(("Status " + getStatusCode())));
private String getRequiredProperty(Properties properties, String key) { String value = properties.getProperty(key); if (StringUtils.isNullOrEmpty(value)) { throw new IllegalArgumentException( "Restlet Cloud configuration file error. The property '" + key + "' is required"); } return value; }
if (!StringUtils.isNullOrEmpty(apiOperation.nickname())) { operation.setName(apiOperation.nickname()); if (!StringUtils.isNullOrEmpty(apiOperation.value())) { operation.setDescription(apiOperation.value()); if (!StringUtils.isNullOrEmpty(apiOperation.httpMethod())) { operation.setMethod(apiOperation.httpMethod()); if (!StringUtils.isNullOrEmpty(apiOperation.consumes())) { operation.setConsumes(StringUtils.splitAndTrim(apiOperation .consumes())); if (!StringUtils.isNullOrEmpty(apiOperation.produces())) { operation.setProduces(StringUtils.splitAndTrim(apiOperation .produces()));
/** * Generates a name for a resource computed from its path. The name is * composed of all alphanumeric characters in camel case.<br/> * Ex: /contacts/{contactId} => ContactsContactId * * @param uri * The URI of the Resource * @return The Resource's name computed from the path. */ public static String processResourceName(String uri) { StringBuilder sb = new StringBuilder(); String[] split = uri.replaceAll("\\{", "").replaceAll("\\}", "") .split("/"); for (String str : split) { sb.append(StringUtils.firstUpper(str)); } return sb.toString(); }
contract.setDescription(StringUtils.nullToEmpty(application .getDescription())); if (application.toString().equals(application.getName())) {
private String getRequiredProperty(Properties properties, String key) { String value = properties.getProperty(key); if (StringUtils.isNullOrEmpty(value)) { throw new IllegalArgumentException( "Restlet Cloud configuration file error. The property '" + key + "' is required"); } return value; }
if (!StringUtils.isNullOrEmpty(apiOperation.nickname())) { operation.setName(apiOperation.nickname()); if (!StringUtils.isNullOrEmpty(apiOperation.value())) { operation.setDescription(apiOperation.value()); if (!StringUtils.isNullOrEmpty(apiOperation.httpMethod())) { operation.setMethod(apiOperation.httpMethod()); if (!StringUtils.isNullOrEmpty(apiOperation.consumes())) { operation.setConsumes(StringUtils.splitAndTrim(apiOperation .consumes())); if (!StringUtils.isNullOrEmpty(apiOperation.produces())) { operation.setProduces(StringUtils.splitAndTrim(apiOperation .produces()));
/** * Generates a name for a resource computed from its path. The name is * composed of all alphanumeric characters in camel case.<br/> * Ex: /contacts/{contactId} => ContactsContactId * * @param uri * The URI of the Resource * @return The Resource's name computed from the path. */ public static String processResourceName(String uri) { StringBuilder sb = new StringBuilder(); String[] split = uri.replaceAll("\\{", "").replaceAll("\\}", "") .split("/"); for (String str : split) { sb.append(StringUtils.firstUpper(str)); } return sb.toString(); }
contract.setDescription(StringUtils.nullToEmpty(application .getDescription())); if (application.toString().equals(application.getName())) {
private String getRequiredProperty(Properties properties, String key) { String value = properties.getProperty(key); if (StringUtils.isNullOrEmpty(value)) { throw new IllegalArgumentException( "APISpark configuration file error. The property '" + key + "' is required"); } return value; }
if (!StringUtils.isNullOrEmpty(apiOperation.nickname())) { operation.setName(apiOperation.nickname()); if (!StringUtils.isNullOrEmpty(apiOperation.value())) { operation.setDescription(apiOperation.value()); if (!StringUtils.isNullOrEmpty(apiOperation.httpMethod())) { operation.setMethod(apiOperation.httpMethod()); if (!StringUtils.isNullOrEmpty(apiOperation.consumes())) { operation.setConsumes(StringUtils.splitAndTrim(apiOperation .consumes())); if (!StringUtils.isNullOrEmpty(apiOperation.produces())) { operation.setProduces(StringUtils.splitAndTrim(apiOperation .produces()));