public final class LocalRepoLoaderImpl extends java.lang.Object implements LocalRepoLoader
LocalPackages under a given path based on package.xml
files.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PACKAGE_XML_FN
The name of the package metadata file we can read.
|
| Constructor and Description |
|---|
LocalRepoLoaderImpl(java.io.File root,
RepoManager manager,
FallbackLocalRepoLoader fallback,
FileOp fop)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,LocalPackage> |
getPackages(ProgressIndicator progress)
Gets our packages, loading them if necessary.
|
boolean |
needsUpdate(long lastLocalRefreshMs,
boolean deepCheck)
Checks whether it looks like we need to be reloaded.
|
public static final java.lang.String PACKAGE_XML_FN
public LocalRepoLoaderImpl(@NonNull
java.io.File root,
@NonNull
RepoManager manager,
@Nullable
FallbackLocalRepoLoader fallback,
@NonNull
FileOp fop)
root - The root directory under which we'll look for packages.manager - A RepoManager, notably containing the SchemaModules we'll use for
reading and writing LocalPackagesfallback - The FallbackLocalRepoLoader we'll use if we can't find a package in a
directory.fop - The FileOp to use for file operations. Should be
FileOpUtils.create() for normal operation.@NonNull public java.util.Map<java.lang.String,LocalPackage> getPackages(@NonNull ProgressIndicator progress)
LocalRepoLoadergetPackages in interface LocalRepoLoaderprogress - A ProgressIndicator used to show progress (unimplemented) and
logging.LocalPackage, containing all the packages found in
the given root.public boolean needsUpdate(long lastLocalRefreshMs,
boolean deepCheck)
deepCheck is false, we just check whether .knownPackages has
been updated more recently than lastLocalRefreshMs.
If deepCheck is true, we check whether the hash in .knownPackages
accurately reflects the currently-installed packages (traversing the SDK directory tree to do
so).needsUpdate in interface LocalRepoLoaderlastLocalRefreshMs - The last time a load was donedeepCheck - How vigorously to check. If false, the check should be quite fast.
If true it should still be reasonably fast, but less so.true if a reload is needed, false otherwise.