com.android.sdklib.repository.local
Class PackageParserUtils

java.lang.Object
  extended by com.android.sdklib.repository.local.PackageParserUtils

public class PackageParserUtils
extends java.lang.Object

Misc utilities to help extracting elements and attributes out of a repository XML document.


Constructor Summary
PackageParserUtils()
           
 
Method Summary
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.io.File> parseSkinFolder(java.io.File skinRootFolder, com.android.repository.io.FileOp fileOp)
          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.io.File> parseSkinFolder(@NonNull
                                                                   java.io.File skinRootFolder,
                                                                   @NonNull
                                                                   com.android.repository.io.FileOp fileOp)
Parses the skin folder and builds the skin list.

Parameters:
skinRootFolder - The path to the skin root folder.