com.android.ide.common.repository
Enum SdkMavenRepository

java.lang.Object
  extended by java.lang.Enum<SdkMavenRepository>
      extended by com.android.ide.common.repository.SdkMavenRepository
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SdkMavenRepository>

public enum SdkMavenRepository
extends java.lang.Enum<SdkMavenRepository>

A SdkMavenRepository represents a Maven repository that is shipped with the SDK and located in the extras folder of the SDK location.


Enum Constant Summary
ANDROID
          The Android repository; contains support lib, app compat, media router, etc
GOOGLE
          The Google repository; contains Play Services etc
 
Method Summary
 java.lang.String getDirName()
          The directory name of the repository inside the extras folder
 GradleCoordinate getHighestInstalledVersion(java.io.File sdkHome, java.lang.String groupId, java.lang.String artifactId, java.lang.String filter, boolean allowPreview)
          Find the best matching GradleCoordinate
static GradleCoordinate getHighestInstalledVersion(java.lang.String groupId, java.lang.String artifactId, java.io.File repository, java.lang.String filter, boolean allowPreview)
          Find the best matching GradleCoordinate
 com.android.sdklib.repository.descriptors.IPkgDesc getPackageDescription()
           
 java.io.File getRepositoryLocation(java.io.File sdkHome, boolean requireExists)
          Returns the location of the repository within a given SDK home
 boolean isInstalled(java.io.File sdkHome)
          Returns true if the given SDK repository is installed
 boolean isInstalled(com.android.sdklib.repository.local.LocalSdk sdk)
          Returns true if the given SDK repository is installed
static SdkMavenRepository valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SdkMavenRepository[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ANDROID

public static final SdkMavenRepository ANDROID
The Android repository; contains support lib, app compat, media router, etc


GOOGLE

public static final SdkMavenRepository GOOGLE
The Google repository; contains Play Services etc

Method Detail

values

public static SdkMavenRepository[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SdkMavenRepository c : SdkMavenRepository.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SdkMavenRepository valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getRepositoryLocation

@Nullable
public java.io.File getRepositoryLocation(@Nullable
                                                   java.io.File sdkHome,
                                                   boolean requireExists)
Returns the location of the repository within a given SDK home

Parameters:
sdkHome - the SDK home, or null
requireExists - if true, the location will only be returned if it also exists
Returns:
the location of the this repository within a given SDK

isInstalled

public boolean isInstalled(@Nullable
                           java.io.File sdkHome)
Returns true if the given SDK repository is installed

Parameters:
sdkHome - the SDK installation location
Returns:
true if the repository is installed

isInstalled

public boolean isInstalled(@Nullable
                           com.android.sdklib.repository.local.LocalSdk sdk)
Returns true if the given SDK repository is installed

Parameters:
sdk - the SDK to check
Returns:
true if the repository is installed

getHighestInstalledVersion

@Nullable
public GradleCoordinate getHighestInstalledVersion(@Nullable
                                                            java.io.File sdkHome,
                                                            @NonNull
                                                            java.lang.String groupId,
                                                            @NonNull
                                                            java.lang.String artifactId,
                                                            @Nullable
                                                            java.lang.String filter,
                                                            boolean allowPreview)
Find the best matching GradleCoordinate

Parameters:
sdkHome - the SDK installation
groupId - the artifact group id
artifactId - the artifact id
filter - an optional filter which the matched coordinate's version name must start with
allowPreview - whether preview versions are allowed to match
Returns:
the best (highest version) matching coordinate, or null if none were found

getHighestInstalledVersion

@Nullable
public static GradleCoordinate getHighestInstalledVersion(@NonNull
                                                                   java.lang.String groupId,
                                                                   @NonNull
                                                                   java.lang.String artifactId,
                                                                   @NonNull
                                                                   java.io.File repository,
                                                                   @Nullable
                                                                   java.lang.String filter,
                                                                   boolean allowPreview)
Find the best matching GradleCoordinate

Parameters:
groupId - the artifact group id
artifactId - the artifact id
repository - the path to the m2repository directory
filter - an optional filter which the matched coordinate's version name must start with
allowPreview - whether preview versions are allowed to match
Returns:
the best (highest version) matching coordinate, or null if none were found

getDirName

@NonNull
public java.lang.String getDirName()
The directory name of the repository inside the extras folder


getPackageDescription

public com.android.sdklib.repository.descriptors.IPkgDesc getPackageDescription()
Returns:
SDK package description for this repository