|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.repository.util.InstallerUtil
public class InstallerUtil
Utility methods for PackageInstaller implementations.
| Constructor Summary | |
|---|---|
InstallerUtil()
|
|
| Method Summary | |
|---|---|
static java.net.URL |
resolveCompleteArchiveUrl(RemotePackage p,
ProgressIndicator progress)
Returns a URL corresponding to Archive.getComplete() of the given
RemotePackage. |
static void |
unzip(java.io.InputStream in,
java.io.File out,
FileOp fop,
long expectedSize,
ProgressIndicator progress)
Unzips the given zipped input stream into the given directory. |
static void |
writePackageXml(RemotePackage p,
java.io.File packageRoot,
RepoManager manager,
FileOp fop,
ProgressIndicator progress)
Writes out the XML for a LocalPackageImpl corresponding to the given
RemotePackage to a package.xml file in packageRoot. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InstallerUtil()
| Method Detail |
|---|
public static void unzip(@NonNull
java.io.InputStream in,
@NonNull
java.io.File out,
@NonNull
FileOp fop,
long expectedSize,
@NonNull
ProgressIndicator progress)
throws java.io.IOException
in - The (zipped) input stream.out - The directory into which to expand the files. Must exist.fop - The FileOp to use for file operations.expectedSize - Compressed size of the stream.progress - Currently only used for logging.
java.io.IOException - If we're unable to read or write.
public static void writePackageXml(@NonNull
RemotePackage p,
@NonNull
java.io.File packageRoot,
@NonNull
RepoManager manager,
@NonNull
FileOp fop,
@NonNull
ProgressIndicator progress)
throws java.io.IOException
LocalPackageImpl corresponding to the given
RemotePackage to a package.xml file in packageRoot.
p - The package to convert to a local package and write out.packageRoot - The location to write to. Must exist and be a directory.manager - A RepoManager instance.fop - The FileOp to use for file operations.progress - Currently only used for logging.
java.io.IOException - If we fail to write the output file.
@Nullable
public static java.net.URL resolveCompleteArchiveUrl(@NonNull
RemotePackage p,
@NonNull
ProgressIndicator progress)
Archive.getComplete() of the given
RemotePackage. If the url in the package is a relative url, resolves it by using the
prefix of the url in the RepositorySource of the package.
URL, or null if the given archive location is not
parsable in its original or resolved form.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||