[OmniFaces utilities] The
getExtension()
method gets the extension of a resource if any. This extension is defined as everything after the last occurrence of a period, including the period itself. E.g. input "index.xhtml" will return ".xhtml'Method:
Usage:
import
org.omnifaces.util.ResourcePaths;
...
// returns: .jpg
String
extension =
ResourcePaths.getExtension("/resources/default/images/rafa.jpg");
// returns: null
String
extension = ResourcePaths.getExtension("/WEB-INF/faces-views/");
Niciun comentariu :
Trimiteți un comentariu