[OmniFaces utilities] The
filterExtension()
method filters away every resource in the given set that has an extension.Method:
See also: ResourcePaths#isExtensionless()
Usage:
import
org.omnifaces.util.ResourcePaths;
...
Set<String>
resources = new HashSet<>();
resources.add("/resources/default/");
resources.add("/resources/default/css/");
resources.add("/resources/default/css/rafa.css");
resources.add("/resources/default/images/");
resources.add("/resources/default/images/rafa.jpg");
resources.add("/resources/default/videos/");
resources.add("/resources/default/videos/rafa.avi");
Set<String> filtered =
ResourcePaths.filterExtension(resources);
Outputs:
/resources/default/
/resources/default/css/
/resources/default/images/
/resources/default/videos/
Niciun comentariu :
Trimiteți un comentariu