Class Utility


  • public class Utility
    extends Object
    Utility class.
    • Constructor Detail

      • Utility

        public Utility()
    • Method Detail

      • toWellFormedURI

        public static String toWellFormedURI​(String s)
        Convert a string to a URI.
        Parameters:
        s - The string to convert.
        Returns:
        A well-formed URI.
      • getDateTime

        public static String getDateTime()
        Get the current date time.
        Returns:
        A date time.
      • toXML

        public static String toXML​(ExtrinsicObject extrinsic)
                            throws JAXBException
        Convert the ExtrinsicObject into an XML.
        Parameters:
        extrinsic - The ExtrinsicObject.
        Returns:
        The XML representation of the given ExtrinsicObject.
        Throws:
        JAXBException - If there was an error marshalling the given object.
      • toXML

        public static String toXML​(Association association)
                            throws JAXBException
        Convert the Association into an XML.
        Parameters:
        association - The Association.
        Returns:
        The XML representation of the given Association.
        Throws:
        JAXBException - If there was an error marshalling the given association.
      • resolveEnvVars

        public static String resolveEnvVars​(String string)
        Returns given string with environment variable references expanded. e.g. $HOME or ${HOME}.
        Parameters:
        string - The string to expand.
        Returns:
        The expanded string or the original string if no environment variables were expanded.
      • resolveEnvVars

        public static List<String> resolveEnvVars​(List<String> strings)
        Returns list of strings with environment variable references expanded. e.g. $HOME or ${HOME}
        Parameters:
        strings - A list of strings to expand.
        Returns:
        A list of expanded strings or the original strings if no environment variables were expanded.