Package com.vaadin.copilot
Class JetbrainsRuntimeUtil
java.lang.Object
com.vaadin.copilot.JetbrainsRuntimeUtil
Utility class for downloading and referencing a JetBrains Runtime.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownloadLatestJBR(Consumer<String> statusUpdater) Downloads the latest JetBrains Runtime and returns the downloaded file.Returns the key to use for downloading the correct JBR SDK for the current architecture.getHotswapAgentLocation(File jdkFolder) Returns the location inside the JDK where HotswapAgent should be placed.getJavaExecutable(File jdkFolder) Returns the location of the Java executable inside the JDK.Unpacks the given JetBrains Runtime archive into a folder.
-
Constructor Details
-
JetbrainsRuntimeUtil
public JetbrainsRuntimeUtil()
-
-
Method Details
-
unpackJbr
public File unpackJbr(File jbrArchive, Consumer<String> statusUpdater) throws IOException, com.vaadin.flow.server.frontend.installer.ArchiveExtractionException Unpacks the given JetBrains Runtime archive into a folder.- Parameters:
jbrArchive- the archive to unpackstatusUpdater- the consumer to pass status information to- Returns:
- the folder where the archive was unpacked
- Throws:
IOException- if an I/O error occurscom.vaadin.flow.server.frontend.installer.ArchiveExtractionException- if the archive cannot be extracted
-
getHotswapAgentLocation
Returns the location inside the JDK where HotswapAgent should be placed.- Parameters:
jdkFolder- the JDK folder- Returns:
- the location inside the JDK where HotswapAgent should be placed
-
getJavaExecutable
Returns the location of the Java executable inside the JDK.- Parameters:
jdkFolder- the JDK folder- Returns:
- the location of the Java executable inside the JDK
-
downloadLatestJBR
public Optional<File> downloadLatestJBR(Consumer<String> statusUpdater) throws IOException, URISyntaxException, com.vaadin.flow.server.frontend.installer.DownloadException Downloads the latest JetBrains Runtime and returns the downloaded file.The downloaded file will be placed in the Vaadin home directory under the "jdk" folder. If the file already exists, it will not be downloaded again.
If no suitable download is found, an empty optional is returned.
- Parameters:
statusUpdater- the consumer to pass status information to- Returns:
- the downloaded file, if any
- Throws:
IOException- if an I/O error occursURISyntaxException- if there is an internal error with url handlingcom.vaadin.flow.server.frontend.installer.DownloadException- if the download fails
-
getDownloadKey
Returns the key to use for downloading the correct JBR SDK for the current architecture.- Returns:
- the key to use for downloading
-