com.android.sdklib.internal.repository.packages
Class MajorRevisionPackage
java.lang.Object
com.android.sdklib.internal.repository.packages.Package
com.android.sdklib.internal.repository.packages.MajorRevisionPackage
- All Implemented Interfaces:
- IDescription, java.lang.Comparable<Package>
- Direct Known Subclasses:
- AddonPackage, BrokenPackage, DocPackage, MinToolsPackage, SourcePackage, SystemImagePackage
public abstract class MajorRevisionPackage
- extends Package
Represents a package in an SDK repository that has a MajorRevision,
which is a single major revision number (not minor, micro or previews).
|
Constructor Summary |
MajorRevisionPackage(SdkSource source,
java.util.Properties props,
int revision,
java.lang.String license,
java.lang.String description,
java.lang.String descUrl,
Archive.Os archiveOs,
Archive.Arch archiveArch,
java.lang.String archiveOsPath)
Manually create a new package with one archive and the given attributes. |
|
Method Summary |
Package.UpdateInfo |
canBeUpdatedBy(Package replacementPackage)
Computes whether the given package is a suitable update for the current package. |
FullRevision |
getRevision()
Returns the revision, an int > 0, for all packages (platform, add-on, tool, doc). |
void |
saveProperties(java.util.Properties props)
Save the properties of the current packages in the given Properties object. |
| Methods inherited from class com.android.sdklib.internal.repository.packages.Package |
compareTo, comparisonKey, equals, getArchives, getDescription, getDescUrl, getInstallFolder, getLicense, getListDescription, getLongDescription, getParentSource, getReleaseNote, getReleaseNoteUrl, getShortDescription, hasArchive, hasCompatibleArchive, hashCode, initializeArchives, installId, isLocal, isObsolete, postInstallHook, postUnzipFileHook, preInstallHook, sameItemAs, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
MajorRevisionPackage
public MajorRevisionPackage(SdkSource source,
java.util.Properties props,
int revision,
java.lang.String license,
java.lang.String description,
java.lang.String descUrl,
Archive.Os archiveOs,
Archive.Arch archiveArch,
java.lang.String archiveOsPath)
- Manually create a new package with one archive and the given attributes.
This is used to create packages from local directories in which case there must be
one archive which URL is the actual target location.
Properties from props are used first when possible, e.g. if props is non null.
By design, this creates a package with one and only one archive.
getRevision
public FullRevision getRevision()
- Returns the revision, an int > 0, for all packages (platform, add-on, tool, doc).
Can be 0 if this is a local package of unknown revision.
- Specified by:
getRevision in class Package
saveProperties
public void saveProperties(java.util.Properties props)
- Description copied from class:
Package
- Save the properties of the current packages in the given
Properties object.
These properties will later be give the constructor that takes a Properties object.
- Overrides:
saveProperties in class Package
canBeUpdatedBy
public Package.UpdateInfo canBeUpdatedBy(Package replacementPackage)
- Description copied from class:
Package
- Computes whether the given package is a suitable update for the current package.
An update is just that: a new package that supersedes the current one. If the new
package does not represent the same item or if it has the same or lower revision as the
current one, it's not an update.
- Specified by:
canBeUpdatedBy in class Package
- Parameters:
replacementPackage - The potential replacement package.
- Returns:
- One of the
Package.UpdateInfo values. - See Also:
Package.sameItemAs(Package)