Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
*/
public default String getRequestPath() {
String contextPath = this.getHttpRequest().getContextPath();
String requestPath = this.getHttpRequest().getRequestURI();
if (requestPath.startsWith(contextPath)) {
requestPath = requestPath.substring(contextPath.length());
}
return requestPath.replaceAll("[/]{2,}", "/");
}
/**
* Performs the given action for each entry in this map until all entries
* have been processed or the action throws an exception. Unless
* otherwise specified by the implementing class, actions are performed in
* the order of entry set iteration (if an iteration order is specified.)
* Exceptions thrown by the action are relayed to the caller.
*
* @param action The action to be performed for each entry
* @throws NullPointerException if the specified action is null
* @since 1.8
*/
public default void forEach(BiConsumer action) {
Objects.requireNonNull(action);
for (String key : keySet()) {
Object optionValue = get(key);
action.accept(key, optionValue);
}
}
/**
* If the specified key is not already associated with a value (or is mapped
* to {@code null}) associates it with the given value and returns
* {@code null}, else returns the current value.
*
* @param key key with which the specified value is to be associated
* @param value value to be associated with the specified key
* @throws UnsupportedOperationException if the {@code put} operation is not supported by this map
* @since 1.8
*/
public default void putIfAbsent(String key, Object value) {
if (get(key) == null) {
put(key, value);
}
}
/**
* Returns the value to which the specified key is mapped, or
* {@code defaultValue} if this map contains no mapping for the key.
*
* The default implementation makes no guarantees about synchronization
* or atomicity properties of this method. Any implementation providing
* atomicity guarantees must override this method and document its
* concurrency properties.
*
* @param key the key whose associated value is to be returned
* @param defaultValue the default mapping of the key
* @return the value to which the specified key is mapped, or {@code defaultValue} if this map contains no mapping for the key
* @since 1.8
*/
public default Object getOrDefault(String key, Object defaultValue) {
Object v = null;
return ((v = get(key)) != null) ? v : defaultValue;
}
/**
* Returns the value to which the specified key is mapped, or
* {@code defaultValue} if this map contains no mapping for the key.
*
* The default implementation makes no guarantees about synchronization
* or atomicity properties of this method. Any implementation providing
* atomicity guarantees must override this method and document its
* concurrency properties.
*
* @param key the key whose associated value is to be returned
* @param defaultValue the default mapping of the key
* @return the value to which the specified key is mapped, or {@code defaultValue} if this map contains no mapping for the key
* @since 1.8
*/
public default V getOrMap(String key, Function