Package com.android.repository.api
Class ConstantSourceProvider
- java.lang.Object
-
- com.android.repository.api.ConstantSourceProvider
-
- All Implemented Interfaces:
RepositorySourceProvider
public class ConstantSourceProvider extends java.lang.Object implements RepositorySourceProvider
ARepositorySourceProviderthat provides a single source allowing a single set of schema modules.
-
-
Constructor Summary
Constructors Constructor Description ConstantSourceProvider(java.lang.String url, java.lang.String uiName, java.util.Collection<SchemaModule<?>> permittedSchemaModules)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddSource(RepositorySource source)Add a source to this provider, if this provider is editable.java.util.List<RepositorySource>getSources(Downloader downloader, ProgressIndicator indicator, boolean forceRefresh)Gets theRepositorySources from this provider.booleanisModifiable()booleanremoveSource(RepositorySource source)Remove the given source from this provider, if this provider is editable.voidsave(ProgressIndicator progress)If any changes have been made, persist them.
-
-
-
Constructor Detail
-
ConstantSourceProvider
public ConstantSourceProvider(@NonNull java.lang.String url, @NonNull java.lang.String uiName, @NonNull java.util.Collection<SchemaModule<?>> permittedSchemaModules)
-
-
Method Detail
-
getSources
@NonNull public java.util.List<RepositorySource> getSources(@Nullable Downloader downloader, @Nullable ProgressIndicator indicator, boolean forceRefresh)
Description copied from interface:RepositorySourceProviderGets theRepositorySources from this provider.- Specified by:
getSourcesin interfaceRepositorySourceProvider- Parameters:
downloader- TheDownloader, if required by this provider.indicator- AProgressIndicatorto be used for showing progress and logging.forceRefresh- If true, this provider should refresh its list of sources, rather than using a cached version.
-
addSource
public boolean addSource(@NonNull RepositorySource source)Description copied from interface:RepositorySourceProviderAdd a source to this provider, if this provider is editable. Changes will be reflected inRepositorySourceProvider.getSources(Downloader, ProgressIndicator, boolean), but not persisted untilRepositorySourceProvider.save(ProgressIndicator)is called.- Specified by:
addSourcein interfaceRepositorySourceProvider- Parameters:
source- The source to add.- Returns:
trueif the source was successfully added,falseotherwise.
-
isModifiable
public boolean isModifiable()
- Specified by:
isModifiablein interfaceRepositorySourceProvider- Returns:
trueif this provider can be edited (that is, it has a facility for saving and loading changes),falseotherwise.
-
save
public void save(@NonNull ProgressIndicator progress)Description copied from interface:RepositorySourceProviderIf any changes have been made, persist them.- Specified by:
savein interfaceRepositorySourceProvider
-
removeSource
public boolean removeSource(@NonNull RepositorySource source)Description copied from interface:RepositorySourceProviderRemove the given source from this provider, if this provider is editable.- Specified by:
removeSourcein interfaceRepositorySourceProvider- Parameters:
source- The source to remove.- Returns:
trueif the source was successfully removed,falseotherwise.- See Also:
RepositorySourceProvider.addSource(RepositorySource)
-
-