Package com.android.repository.impl.meta
Class RemotePackageImpl
- java.lang.Object
-
- com.android.repository.impl.meta.RepoPackageImpl
-
- com.android.repository.impl.meta.RemotePackageImpl
-
- All Implemented Interfaces:
RemotePackage,RepoPackage,java.lang.Comparable<RepoPackage>
- Direct Known Subclasses:
RemotePackage,RemotePackage
public abstract class RemotePackageImpl extends RepoPackageImpl implements RemotePackage
An implementation ofRemotePackagethat can be created as part of aRepositoryby JAXB.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemotePackageImpl.ChannelRef-
Nested classes/interfaces inherited from class com.android.repository.impl.meta.RepoPackageImpl
RepoPackageImpl.Archives, RepoPackageImpl.Dependencies, RepoPackageImpl.UsesLicense
-
-
Field Summary
-
Fields inherited from interface com.android.repository.api.RepoPackage
PATH_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description RemotePackageImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddArchive(Archive archive)voidaddTo(Repository repo)Adds this package to the givenRepository, overwriting existing packages if necessary.RepoPackageImplasMarshallable()Returns a package with the same content as this one that can be marshalled using JAXB (orthisif it already can be marshalled).static RemotePackageImplcreate(RemotePackage remotePackage)Creates aRemotePackageImplfrom an arbitraryRemotePackage.java.util.List<Archive>getAllArchives()Convenience method to get all theArchives included in this package.ArchivegetArchive()protected abstract RepoPackageImpl.ArchivesgetArchives()ChannelgetChannel()Gets the update channel (e.g.protected abstract RemotePackageImpl.ChannelRefgetChannelRef()Gets the actualRemotePackageImpl.ChannelRef.java.nio.file.PathgetInstallDir(RepoManager manager, ProgressIndicator progress)Gets the path into which thisRemotePackageshould be installed.RepositorySourcegetSource()protected abstract voidsetArchives(RepoPackageImpl.Archives archives)voidsetChannel(Channel c)Convenience method to add a reference to the given channel to this package.protected abstract voidsetChannelRef(RemotePackageImpl.ChannelRef cr)Sets the actualRemotePackageImpl.ChannelRef.voidsetSource(RepositorySource source)-
Methods inherited from class com.android.repository.impl.meta.RepoPackageImpl
addDependency, compareTo, equals, getAllDependencies, getDependencies, getDisplayName, getLicense, getPath, getRevision, getTypeDetails, getUsesLicense, getVersion, hashCode, isObsolete, obsolete, setDependencies, setDisplayName, setLicense, setObsolete, setPath, setRevision, setTypeDetails, setUsesLicense, setVersion
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.android.repository.api.RepoPackage
createFactory, getAllDependencies, getDisplayName, getLicense, getPath, getTypeDetails, getVersion, obsolete
-
-
-
-
Method Detail
-
setSource
public void setSource(@NonNull RepositorySource source)- Specified by:
setSourcein interfaceRemotePackage- Parameters:
source- TheRepositorySourcefrom which we got this package.
-
getArchive
@Nullable public Archive getArchive()
- Specified by:
getArchivein interfaceRemotePackage- Returns:
- The archive in this package compatible with the current hardware, OS, and JDK,
or
nullif there is none.
-
getAllArchives
@NonNull public java.util.List<Archive> getAllArchives()
Convenience method to get all theArchives included in this package.
-
getArchives
@NonNull protected abstract RepoPackageImpl.Archives getArchives()
-
setArchives
protected abstract void setArchives(@Nullable RepoPackageImpl.Archives archives)
-
getSource
@NonNull public RepositorySource getSource()
- Specified by:
getSourcein interfaceRemotePackage- Returns:
- The
RepositorySourcefrom which we got this package.
-
getChannelRef
@Nullable protected abstract RemotePackageImpl.ChannelRef getChannelRef()
Gets the actualRemotePackageImpl.ChannelRef. Probably you actually wantgetChannel().
-
getChannel
@NonNull public Channel getChannel()
Description copied from interface:RemotePackageGets the update channel (e.g. beta, stable) for this package. Channels are sorted in lexicographic order, with the first (and default) being the most stable.- Specified by:
getChannelin interfaceRemotePackage
-
getInstallDir
@NonNull public java.nio.file.Path getInstallDir(@NonNull RepoManager manager, @NonNull ProgressIndicator progress)Description copied from interface:RemotePackageGets the path into which thisRemotePackageshould be installed.- Specified by:
getInstallDirin interfaceRemotePackage
-
setChannel
public void setChannel(@Nullable Channel c)Convenience method to add a reference to the given channel to this package.
-
setChannelRef
protected abstract void setChannelRef(@Nullable RemotePackageImpl.ChannelRef cr)Sets the actualRemotePackageImpl.ChannelRef. Probably you actually wantsetChannel(Channel).
-
create
@NonNull public static RemotePackageImpl create(@NonNull RemotePackage remotePackage)
Creates aRemotePackageImplfrom an arbitraryRemotePackage. Useful if you have aRepoPackageof unknown concrete type and want to marshal it using JAXB. Note that only the compatible archive (if any) will be included.
-
addArchive
public void addArchive(@NonNull Archive archive)
-
asMarshallable
@NonNull public RepoPackageImpl asMarshallable()
Description copied from interface:RepoPackageReturns a package with the same content as this one that can be marshalled using JAXB (orthisif it already can be marshalled).- Specified by:
asMarshallablein interfaceRepoPackage
-
addTo
public void addTo(@NonNull Repository repo)Description copied from class:RepoPackageImplAdds this package to the givenRepository, overwriting existing packages if necessary.- Specified by:
addToin classRepoPackageImpl
-
-