public class ClasspathStorage extends Storage
| Modifier and Type | Class and Description |
|---|---|
static class |
ClasspathStorage.ClasspathResolver |
Storage.NotExistException, Storage.PackageResolver| Constructor and Description |
|---|
ClasspathStorage(java.lang.String root) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeInstall(boolean force,
UserInteractionStrategy interact)
The opportunity to do anything before the install of a package.
|
boolean |
isReadOnly()
Return whether this storage is read-only.
|
java.util.Set<java.lang.String> |
listPackageDirectories()
Return the list of installed packages.
|
Storage.PackageResolver |
makePackageResolver(java.lang.String rsrc_name,
java.lang.String abbrev)
Return a resolver for a specific package.
|
java.nio.file.Path |
makeTempDir(java.lang.String prefix)
Create a temporary directory.
|
boolean |
packageKeyExists(java.lang.String key)
Each package in a repository can be identified by a unique key.
|
void |
remove(Package pkg)
Remove a package.
|
void |
storeInstallDir(java.nio.file.Path dir,
java.lang.String key,
Package pkg)
Actually store the package in the storage.
|
java.lang.String |
toString() |
void |
updatePackageLists(Package pkg)
The package has just been install, record the information if needed.
|
public ClasspathStorage(java.lang.String root)
root - The common prefix for all resources.public boolean isReadOnly()
StorageisReadOnly in class Storagepublic Storage.PackageResolver makePackageResolver(java.lang.String rsrc_name, java.lang.String abbrev) throws PackageException
StoragemakePackageResolver in class Storagersrc_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 java.util.Set<java.lang.String> listPackageDirectories()
throws PackageException
StoragelistPackageDirectories in class StoragePackageException - if an error occurspublic void beforeInstall(boolean force,
UserInteractionStrategy interact)
throws PackageException
StoragebeforeInstall in class Storageforce - true to forceinteract - the user interaction strategyPackageException - if an error occurspublic java.nio.file.Path makeTempDir(java.lang.String prefix)
throws PackageException
StoragemakeTempDir in class Storageprefix - prefix for the temporary directoryPackageException - if an error occurspublic boolean packageKeyExists(java.lang.String key)
throws PackageException
StoragepackageKeyExists in class Storagekey - the package key to check for.PackageException - if an error occurspublic void storeInstallDir(java.nio.file.Path dir,
java.lang.String key,
Package pkg)
throws PackageException
StoragestoreInstallDir in class Storagedir - the temporary directory where the package was unzippedkey - the package keypkg - the package descriptorPackageException - if an error occurspublic void updatePackageLists(Package pkg) throws PackageException
StorageupdatePackageLists in class Storagepkg - the package descriptorPackageException - if an error occurspublic void remove(Package pkg) throws PackageException
Storageremove in class Storagepkg - the package descriptor.PackageException - if an error occurspublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2015-2024 EXPath. All Rights Reserved