Class ResourceUtil
java.lang.Object
org.eclipse.dirigible.repository.api.ResourceUtil
public final class ResourceUtil extends Object
Utility class for handling Resource objects.
-
Method Summary
Modifier and Type Method Description static StringgetResourceExtension(IResource resource)Returns the extension of the resource name if there is such, otherwise returnsnull.static StringgetResourcePureName(IResource resource)Returns the name of a resource without the extension.
-
Method Details
-
getResourceExtension
Returns the extension of the resource name if there is such, otherwise returnsnull. If there is a dot but there is no extension, then this method returns the empty string.For example:
- request.xml yields "xml"
- page.html yields "html"
- sample. yields
"" - sample yields
null
- Parameters:
resource- resource who's name extension will be returned.- Returns:
- the extension of a resource name
-
getResourcePureName
Returns the name of a resource without the extension.For example:
- request.xml yields "request"
- page.html yields "page"
- sample. yields
"sample" - sample yields
"sample"
- Parameters:
resource- resource who's pure name will be returned.- Returns:
- the name of a resource without the extension at the end.
-