com.android.sdklib.internal.repository.archives
Class ArchiveInstaller

java.lang.Object
  extended by com.android.sdklib.internal.repository.archives.ArchiveInstaller

public class ArchiveInstaller
extends java.lang.Object

Performs the work of installing a given Archive.


Field Summary
static java.lang.String ENV_VAR_IGNORE_COMPAT
           
static int NUM_MONITOR_INC
           
 
Constructor Summary
  ArchiveInstaller()
          Generates an ArchiveInstaller that relies on the default FileOp.
protected ArchiveInstaller(IFileOp fileUtils)
          Generates an ArchiveInstaller that relies on the given FileOp.
 
Method Summary
protected  com.android.utils.Pair<java.io.File,java.io.File> downloadFile(Archive archive, java.lang.String osSdkRoot, DownloadCache cache, ITaskMonitor monitor, boolean forceHttp)
          Downloads an archive and returns the temp file with it.
protected  boolean generateSourceProperties(Archive archive, java.io.File unzipDestFolder)
          Generates a source.properties in the destination folder that contains all the infos relevant to this archive, this package and the source so that we can reload them locally later.
protected  IFileOp getFileOp()
          Returns current FileOp to use.
 boolean install(ArchiveReplacement archiveInfo, java.lang.String osSdkRoot, boolean forceHttp, SdkManager sdkManager, DownloadCache cache, ITaskMonitor monitor)
          Install this ArchiveReplacements.
protected  boolean unzipFolder(ArchiveReplacement archiveInfo, java.io.File archiveFile, java.io.File unzipDestFolder, ITaskMonitor monitor)
          Unzips a zip file into the given destination directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENV_VAR_IGNORE_COMPAT

public static final java.lang.String ENV_VAR_IGNORE_COMPAT
See Also:
Constant Field Values

NUM_MONITOR_INC

public static final int NUM_MONITOR_INC
See Also:
Constant Field Values
Constructor Detail

ArchiveInstaller

public ArchiveInstaller()
Generates an ArchiveInstaller that relies on the default FileOp.


ArchiveInstaller

protected ArchiveInstaller(IFileOp fileUtils)
Generates an ArchiveInstaller that relies on the given FileOp.

Parameters:
fileUtils - An alternate version of FileOp to use for file operations.
Method Detail

getFileOp

protected IFileOp getFileOp()
Returns current FileOp to use. Never null.


install

public boolean install(ArchiveReplacement archiveInfo,
                       java.lang.String osSdkRoot,
                       boolean forceHttp,
                       SdkManager sdkManager,
                       DownloadCache cache,
                       ITaskMonitor monitor)
Install this ArchiveReplacements. A "replacement" is composed of the actual new archive to install (c.f. ArchiveReplacement.getNewArchive() and an optional archive being replaced (c.f. ArchiveReplacement.getReplaced(). In the case of a new install, the later should be null.

The new archive to install will be skipped if it is incompatible.

Returns:
True if the archive was installed, false otherwise.

downloadFile

protected com.android.utils.Pair<java.io.File,java.io.File> downloadFile(Archive archive,
                                                                         java.lang.String osSdkRoot,
                                                                         DownloadCache cache,
                                                                         ITaskMonitor monitor,
                                                                         boolean forceHttp)
Downloads an archive and returns the temp file with it. Caller is responsible with deleting the temp file when done.


unzipFolder

protected boolean unzipFolder(ArchiveReplacement archiveInfo,
                              java.io.File archiveFile,
                              java.io.File unzipDestFolder,
                              ITaskMonitor monitor)
Unzips a zip file into the given destination directory. The archive file MUST have a unique "root" folder. This root folder is skipped when unarchiving.


generateSourceProperties

protected boolean generateSourceProperties(Archive archive,
                                           java.io.File unzipDestFolder)
Generates a source.properties in the destination folder that contains all the infos relevant to this archive, this package and the source so that we can reload them locally later.