public final class ResourcePaths extends Object
Modifier and Type | Method and Description |
---|---|
static Set<String> |
filterExtension(Set<String> resources)
Filters away every resource in the given set that has an extension.
|
static String |
getExtension(String resource)
Gets the extension of a resource if any.
|
static boolean |
isDirectory(String resourcePath)
Checks if the given resource path obtained from
ServletContext.getResourcePaths(String) represents a
directory. |
static boolean |
isExtensionless(String viewId) |
static String |
stripExtension(String resource)
Strips the extension from a resource if any.
|
static String |
stripPrefixPath(String prefix,
String resource)
Strips the given prefix path from the given resource path if any.
|
static String |
stripTrailingSlash(String resource)
Strips the trailing slash(es) from the given resource path if any.
|
public static boolean isDirectory(String resourcePath)
ServletContext.getResourcePaths(String)
represents a
directory.resourcePath
- the resource path to checkpublic static String stripPrefixPath(String prefix, String resource)
prefix
- The prefix to be stripped.resource
- The resource to strip the prefix from.public static String stripTrailingSlash(String resource)
resource
- The resource to strip the trailing slash from.public static String stripExtension(String resource)
resource
- The resource to strip the extension from.public static String getExtension(String resource)
resource
- The resource to get the extension from.public static boolean isExtensionless(String viewId)
Copyright © 2012–2017 OmniFaces. All rights reserved.