public abstract class Storage
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Storage.NotExistException
If a resource or a component does not exist, when trying to resolve a path.
|
static class |
Storage.PackageResolver
Resolve paths in a package installed in the repository.
|
| Constructor and Description |
|---|
Storage() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
beforeInstall(boolean force,
UserInteractionStrategy interact)
The opportunity to do anything before the install of a package.
|
abstract boolean |
isReadOnly()
Return whether this storage is read-only.
|
abstract java.util.Set<java.lang.String> |
listPackageDirectories()
Return the list of installed packages.
|
abstract Storage.PackageResolver |
makePackageResolver(java.lang.String rsrc_name,
java.lang.String abbrev)
Return a resolver for a specific package.
|
abstract java.nio.file.Path |
makeTempDir(java.lang.String prefix)
Create a temporary directory.
|
abstract boolean |
packageKeyExists(java.lang.String key)
Each package in a repository can be identified by a unique key.
|
abstract void |
remove(Package pkg)
Remove a package.
|
abstract void |
storeInstallDir(java.nio.file.Path dir,
java.lang.String key,
Package pkg)
Actually store the package in the storage.
|
abstract void |
updatePackageLists(Package pkg)
The package has just been install, record the information if needed.
|
public abstract boolean isReadOnly()
public abstract Storage.PackageResolver makePackageResolver(java.lang.String rsrc_name, java.lang.String abbrev) throws PackageException
rsrc_name - is the name of the resource representing the package.
For instance, on the filesystem that is the name of the root directory,
and in the classpath that is the name of the root package (in the Java
sense).abbrev - is the abbrev of the package (as in the package descriptor,
and must match the module dir within the package).PackageException - if an error occurspublic abstract java.util.Set<java.lang.String> listPackageDirectories()
throws PackageException
PackageException - if an error occurspublic abstract void beforeInstall(boolean force,
UserInteractionStrategy interact)
throws PackageException
force - true to forceinteract - the user interaction strategyPackageException - if an error occurspublic abstract java.nio.file.Path makeTempDir(java.lang.String prefix)
throws PackageException
prefix - prefix for the temporary directoryPackageException - if an error occurspublic abstract boolean packageKeyExists(java.lang.String key)
throws PackageException
key - the package key to check for.PackageException - if an error occurspublic abstract void storeInstallDir(java.nio.file.Path dir,
java.lang.String key,
Package pkg)
throws PackageException
dir - the temporary directory where the package was unzippedkey - the package keypkg - the package descriptorPackageException - if an error occurspublic abstract void updatePackageLists(Package pkg) throws PackageException
pkg - the package descriptorPackageException - if an error occurspublic abstract void remove(Package pkg) throws PackageException
pkg - the package descriptor.PackageException - if an error occursCopyright © 2015-2023 EXPath. All Rights Reserved