/** * Obtains the value that is overriding the default value. * @param theKey the key whose product value is being requested * @return the value or <code>null</code> if not overridden by the product */ private String getProductValue(String theKey) { String result = null; if ((productProps != null) && !StringUtil.isEmpty(theKey)) { String key = this.pluginId + '.' + theKey; try { result = productProps.getString(key); } catch (MissingResourceException theException) { // not found in product properties } } return result; }
/** * Obtains the value that is overriding the default value. * @param theKey the key whose product value is being requested * @return the value or <code>null</code> if not overridden by the product */ private String getProductValue(String theKey) { String result = null; if ((productProps != null) && !StringUtil.isEmpty(theKey)) { String key = this.pluginId + '.' + theKey; try { result = productProps.getString(key); } catch (MissingResourceException theException) { // not found in product properties } } return result; }
/** * Returns the index within this string of the first occurrence of the * specified substring. The integer returned is the smallest value * <i>k</i> such that: * <blockquote><pre> * this.startsWith(str, <i>k</i>) * </pre></blockquote> * is <code>true</code>. * * @param text any string. * @param str any string. * @return if the str argument occurs as a substring within text, * then the index of the first character of the first * such substring is returned; if it does not occur as a * substring, <code>-1</code> is returned. If the text or * str argument is null or empty then <code>-1</code> is returned. */ public static int indexOfIgnoreCase(final String text, final String str) { if (isEmpty(text)) { return -1; } if (isEmpty(str)) { return -1; } final String lowerText = text.toLowerCase(); final String lowerStr = str.toLowerCase(); return lowerText.indexOf(lowerStr); }
/** * Returns the index within this string of the first occurrence of the * specified substring. The integer returned is the smallest value * <i>k</i> such that: * <blockquote><pre> * this.startsWith(str, <i>k</i>) * </pre></blockquote> * is <code>true</code>. * * @param text any string. * @param str any string. * @return if the str argument occurs as a substring within text, * then the index of the first character of the first * such substring is returned; if it does not occur as a * substring, <code>-1</code> is returned. If the text or * str argument is null or empty then <code>-1</code> is returned. */ public static int indexOfIgnoreCase(final String text, final String str) { if (isEmpty(text)) { return -1; } if (isEmpty(str)) { return -1; } final String lowerText = text.toLowerCase(); final String lowerStr = str.toLowerCase(); return lowerText.indexOf(lowerStr); }
@GET @Produces({MediaType.APPLICATION_JSON, "application/yaml"}) @ApiOperation(value = "The swagger definition in either JSON or YAML", hidden = true) public Response getListing( @Context Application app, @Context ServletConfig sc, @Context FilterConfig fc, @Context HttpHeaders headers, @Context UriInfo uriInfo, @PathParam("type") String type) throws JsonProcessingException { sc = getConfig(sc, fc); if (!StringUtil.isEmpty(type) && type.trim().equalsIgnoreCase("yaml")) { return getListingYamlResponse(app, context, sc, headers, uriInfo); } else { return getListingJsonResponse(app, context, sc, headers, uriInfo); } }
@GET @Produces({MediaType.APPLICATION_JSON, "application/yaml"}) @ApiOperation(value = "The swagger definition in either JSON or YAML", hidden = true) public Response getListing( @Context Application app, @Context ServletConfig sc, @Context FilterConfig fc, @Context HttpHeaders headers, @Context UriInfo uriInfo, @PathParam("type") String type) throws JsonProcessingException { sc = getConfig(sc, fc); if (!StringUtil.isEmpty(type) && type.trim().equalsIgnoreCase("yaml")) { return getListingYamlResponse(app, context, sc, headers, uriInfo); } else { return getListingJsonResponse(app, context, sc, headers, uriInfo); } }