Package com.android.repository.api
Interface RepositorySourceProvider
-
- All Known Implementing Classes:
ConstantSourceProvider,LocalSourceProvider,RemoteListSourceProvider,RemoteListSourceProviderImpl
public interface RepositorySourceProviderA source ofRepositorySources.
-
-
Method Summary
All Methods Instance Methods Abstract 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 logger, 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.
-
-
-
Method Detail
-
getSources
@NonNull java.util.List<RepositorySource> getSources(@Nullable Downloader downloader, @NonNull ProgressIndicator logger, boolean forceRefresh)
Gets theRepositorySources from this provider.- Parameters:
downloader- TheDownloader, if required by this provider.logger- 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
boolean addSource(@NonNull RepositorySource source)Add a source to this provider, if this provider is editable. Changes will be reflected ingetSources(Downloader, ProgressIndicator, boolean), but not persisted untilsave(ProgressIndicator)is called.- Parameters:
source- The source to add.- Returns:
trueif the source was successfully added,falseotherwise.
-
isModifiable
boolean isModifiable()
- Returns:
trueif this provider can be edited (that is, it has a facility for saving and loading changes),falseotherwise.
-
save
void save(@NonNull ProgressIndicator progress)If any changes have been made, persist them.
-
removeSource
boolean removeSource(@NonNull RepositorySource source)Remove the given source from this provider, if this provider is editable.- Parameters:
source- The source to remove.- Returns:
trueif the source was successfully removed,falseotherwise.- See Also:
addSource(RepositorySource)
-
-