Class PackageParserUtils


  • public class PackageParserUtils
    extends java.lang.Object
    Misc utilities to help extracting elements and attributes out of a repository XML document.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getProperty​(java.util.Properties props, java.lang.String propKey, java.lang.String defaultValue)
      Utility method that returns a property from a Properties object.
      static com.android.repository.Revision getRevisionProperty​(java.util.Properties props, java.lang.String propKey)
      Utility method to parse the PkgProps.PKG_REVISION property as a revision (major.minor.micro.preview).
      static java.util.List<java.nio.file.Path> parseSkinFolder​(java.nio.file.Path skinRootFolder)
      Parses the skin folder and builds the skin list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PackageParserUtils

        public PackageParserUtils()
    • Method Detail

      • getRevisionProperty

        @Nullable
        public static com.android.repository.Revision getRevisionProperty​(@Nullable
                                                                          java.util.Properties props,
                                                                          @NonNull
                                                                          java.lang.String propKey)
        Utility method to parse the PkgProps.PKG_REVISION property as a revision (major.minor.micro.preview).
        Parameters:
        props - The properties to parse.
        propKey - The name of the property. Must not be null.
        Returns:
        A Revision or null if there is no such property or it couldn't be parsed.
      • getProperty

        @Nullable
        public static java.lang.String getProperty​(@Nullable
                                                   java.util.Properties props,
                                                   @NonNull
                                                   java.lang.String propKey,
                                                   @Nullable
                                                   java.lang.String defaultValue)
        Utility method that returns a property from a Properties object. Returns the default value if props is null or if the property is not defined.
        Parameters:
        props - The Properties to search into. If null, the default value is returned.
        propKey - The name of the property. Must not be null.
        defaultValue - The default value to return if props is null or if the key is not found. Can be null.
        Returns:
        The string value of the given key in the properties, or null if the key isn't found or if props is null.
      • parseSkinFolder

        @NonNull
        public static java.util.List<java.nio.file.Path> parseSkinFolder​(@NonNull
                                                                         java.nio.file.Path skinRootFolder)
        Parses the skin folder and builds the skin list.
        Parameters:
        skinRootFolder - The path to the skin root folder.