Class Util


  • public class Util
    extends Object
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • qNameEquals

        public static boolean qNameEquals​(QName at,
                                          QName name)
        Test whether two QNames are equal to each other. This is a bug fix for java-rdfa library. "xhtml:about" and "about" should be considered as RDFa, while java-rdfa recognizes only the later one.
        Parameters:
        at - , the QName of an Attribute
        name - , the QName to be compared
        Returns:
      • getRDFBaseUri

        public static String getRDFBaseUri​(String pkgBaseUri,
                                           String internalPath)
        Get the RDF base uri of the given internalPath. Note that there would be a SLASH at the end of the RDF base uri
        Parameters:
        pkgBaseUri - , the base uri of the package
        internalPath - , the internalPath relative to the root document
        Returns:
      • isSubPathOf

        public static boolean isSubPathOf​(String subPath,
                                          String superPath)
        To test whether the subPath is a sut path of superPath
        Parameters:
        subPath - , an internal path in the ODF package
        superPath - , an internal path in the ODF package
        Returns:
      • toExternalForm

        public static String toExternalForm​(URI u)
        To fix the 3 slashes bug for File URI: For example: file:/C:/work/test.txt -> file:///C:/work/test.txt
        Parameters:
        u - - the File URI
        Returns:
        the String of the URI