Class ApplicationInventory
java.lang.Object
lu.kbra.modelizer_next.bootstrap.subapp.ApplicationInventory
Finds installed application versions and chooses the newest usable installation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFinds the latest installed that matches the supplied input.findLatestInstalled(UpdateChannel wantedChannel) Finds the latest installed that matches the supplied input.install(AvailableUpdate update, ProgressListener listener) Creates an InstalledApplication value from an installed jar path.readInstalledApplication(Path jarPath) Reads the installed application.
-
Constructor Details
-
ApplicationInventory
public ApplicationInventory()
-
-
Method Details
-
findLatestInstalled
Finds the latest installed that matches the supplied input.- Returns:
- the matching latest installed, or
nullwhen no match exists - Throws:
IOException- if the operation cannot be completed
-
findLatestInstalled
public Optional<InstalledApplication> findLatestInstalled(UpdateChannel wantedChannel) throws IOException Finds the latest installed that matches the supplied input.- Parameters:
wantedChannel- wanted channel value used by the operation- Returns:
- the matching latest installed, or
nullwhen no match exists - Throws:
IOException- if the operation cannot be completed
-
install
public InstalledApplication install(AvailableUpdate update, ProgressListener listener) throws IOException Creates an InstalledApplication value from an installed jar path.- Parameters:
update- update metadata to download or installlistener- listener notified about progress or changes- Returns:
- the install result
- Throws:
IOException- if the operation cannot be completed
-
readInstalledApplication
Reads the installed application.- Parameters:
jarPath- path to read or write- Returns:
- an optional result when a matching value is available
-