com.android.repository.impl.manager
Class LocalRepoLoader

java.lang.Object
  extended by com.android.repository.impl.manager.LocalRepoLoader

public final class LocalRepoLoader
extends java.lang.Object

A utility class that finds LocalPackages under a given path based on package.xml files.


Field Summary
static java.lang.String PACKAGE_XML_FN
          The name of the package metadata file we can read.
 
Constructor Summary
LocalRepoLoader(java.io.File root, RepoManager manager, FallbackLocalRepoLoader fallback, FileOp fop)
          Constructor.
 
Method Summary
 java.util.Map<java.lang.String,LocalPackage> getPackages(ProgressIndicator progress)
          Gets our packages, loading them if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE_XML_FN

public static final java.lang.String PACKAGE_XML_FN
The name of the package metadata file we can read.

See Also:
Constant Field Values
Constructor Detail

LocalRepoLoader

public LocalRepoLoader(@NonNull
                       java.io.File root,
                       @NonNull
                       RepoManager manager,
                       @Nullable
                       FallbackLocalRepoLoader fallback,
                       @NonNull
                       FileOp fop)
Constructor. Probably should only be used within repository framework.

Parameters:
root - The root directory under which we'll look for packages.
manager - A RepoManager, notably containing the SchemaModules we'll use for reading and writing LocalPackages
fallback - The FallbackLocalRepoLoader we'll use if we can't find a package in a directory.
fop - The FileOp to use for file operations. Should be FileOpUtils.create() for normal operation.
Method Detail

getPackages

@NonNull
public java.util.Map<java.lang.String,LocalPackage> getPackages(@NonNull
                                                                        ProgressIndicator progress)
Gets our packages, loading them if necessary.

Parameters:
progress - A ProgressIndicator used to show progress (unimplemented) and logging.
Returns:
A map of install path to LocalPackage, containing all the packages found in the given root.