Class ResourceUtil

java.lang.Object
org.eclipse.dirigible.repository.api.ResourceUtil

public final class ResourceUtil
extends Object
Utility class for handling Resource objects.
  • Method Details

    • getResourceExtension

      public static String getResourceExtension​(IResource resource)
      Returns the extension of the resource name if there is such, otherwise returns null. 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

      public static String getResourcePureName​(IResource resource)
      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.