public class LocalSourceProvider extends java.lang.Object implements RepositorySourceProvider
RepositorySources saved locally. Allows sources to be saved, modified, and
deleted.| Constructor and Description |
|---|
LocalSourceProvider(java.io.File location,
java.util.Collection<SchemaModule> allowedModules,
FileOp fop)
Create a new
LocalSourceProvider. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addSource(RepositorySource source)
Add a source to this provider.
|
java.util.List<RepositorySource> |
getSources(Downloader downloader,
ProgressIndicator logger,
boolean forceRefresh)
Gets the
RepositorySources from this provider. |
boolean |
isModifiable()
Whether this source is modifiable.
|
boolean |
removeSource(RepositorySource source)
Remove the specified source from this provider.
|
void |
save(ProgressIndicator progress)
Saves any changes in the sources to the specified file.
|
void |
setRepoManager(RepoManager manager)
Sets the
RepoManager that will use this provider. |
public LocalSourceProvider(@NonNull
java.io.File location,
@NonNull
java.util.Collection<SchemaModule> allowedModules,
@NonNull
FileOp fop)
LocalSourceProvider.location - The file to load from and save to.allowedModules - The SchemaModules that are allowed to be used by sources
provided by this provider.fop - The FileOp to use for local file operations. For normal use
should probably be FileOpImpl.public void setRepoManager(@NonNull
RepoManager manager)
RepoManager that will use this provider.@NonNull public java.util.List<RepositorySource> getSources(@Nullable Downloader downloader, @NonNull ProgressIndicator logger, boolean forceRefresh)
RepositorySources from this provider.getSources in interface RepositorySourceProviderdownloader - Unused by this provider.logger - A ProgressIndicator to be used for showing progress and logging.forceRefresh - If true, this provider should refresh its list of sources, rather than
return any cached sources.public boolean addSource(@NonNull
RepositorySource source)
save(ProgressIndicator) is called.addSource in interface RepositorySourceProvidersource - The source to add.true if the source was successfully added, false otherwise.public boolean isModifiable()
isModifiable in interface RepositorySourceProvidertrue for this class.public void save(@NonNull
ProgressIndicator progress)
save in interface RepositorySourceProviderprogress - ProgressIndicator for logging.public boolean removeSource(@NonNull
RepositorySource source)
save(ProgressIndicator) is called.removeSource in interface RepositorySourceProvidersource - The source to remove.true if a matching source was found and actually removed.RepositorySourceProvider.addSource(RepositorySource)