protected String getOperationName(Message message) { String rest = getRest(message); String opName = StringUtils.getFirstNotEmpty(rest, "/"); if (opName.indexOf("?") != -1) { opName = opName.split("\\?")[0]; } return opName; } }
protected String getOperationName(Message message) { String rest = getRest(message); String opName = StringUtils.getFirstNotEmpty(rest, "/"); if (opName.indexOf("?") != -1) { opName = opName.split("\\?")[0]; } return opName; } }
public static String formatVersionNumber(String target) { List<String> found = StringUtils.getFound(target, "\\d+\\.\\d+\\.?\\d*"); if (isEmpty(found)) { return target; } return getFirstNotEmpty(found); }
public static String formatVersionNumber(String target) { List<String> found = StringUtils.getFound(target, "\\d+\\.\\d+\\.?\\d*"); if (isEmpty(found)) { return target; } return getFirstNotEmpty(found); }
public static String formatVersionNumber(String target) { List<String> found = StringUtils.getFound(target, "\\d+\\.\\d+\\.?\\d*"); if (isEmpty(found)) { return target; } return getFirstNotEmpty(found); }
/** * {@inheritDoc} */ @Override public void handleMessage(Message message) throws Fault { String method = (String)message.get(Message.HTTP_REQUEST_METHOD); if (method.equals(HTTP_POST)) { return; } String path = (String)message.get(Message.PATH_INFO); String basePath = (String)message.get(Message.BASE_PATH); if (basePath == null) { basePath = SLASH_STR; } String rest = StringUtils.diff(path, basePath); String opName = StringUtils.getFirstNotEmpty(rest, SLASH_STR); if (opName.indexOf(QUESTION_MARK_STR) != -1) { opName = opName.split(QUESTION_MARK_REGEXP_STR)[0]; } // Funny, we have to check for a 'null' String :) if ((opName == null) || opName.equals(NULL_STR)) { String pathInfo = (String)message.get(Message.PATH_INFO); pathInfo = pathInfo.split(NULL_STR)[0]; if (!pathInfo.endsWith(SLASH_STR)) { pathInfo = pathInfo.concat(SLASH_STR); } throw new Fault(ExtensionMessages.MESSAGES.noSuchOperationGet(method, pathInfo)); } } }
/** * {@inheritDoc} */ @Override public void handleMessage(Message message) throws Fault { String method = (String)message.get(Message.HTTP_REQUEST_METHOD); if (method.equals(HTTP_POST)) { return; } String path = (String)message.get(Message.PATH_INFO); String basePath = (String)message.get(Message.BASE_PATH); if (basePath == null) { basePath = SLASH_STR; } String rest = StringUtils.diff(path, basePath); String opName = StringUtils.getFirstNotEmpty(rest, SLASH_STR); if (opName.indexOf(QUESTION_MARK_STR) != -1) { opName = opName.split(QUESTION_MARK_REGEXP_STR)[0]; } // Funny, we have to check for a 'null' String :) if ((opName == null) || opName.equals(NULL_STR)) { String pathInfo = (String)message.get(Message.PATH_INFO); pathInfo = pathInfo.split(NULL_STR)[0]; if (!pathInfo.endsWith(SLASH_STR)) { pathInfo = pathInfo.concat(SLASH_STR); } throw new Fault(ExtensionMessages.MESSAGES.noSuchOperationGet(method, pathInfo)); } } }