This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch wrapper-rewrite
in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to refs/heads/wrapper-rewrite by this push:
new 99a7503c7f Indicate the source of the downloaded jar
99a7503c7f is described below
commit 99a7503c7f6c2cca827673b11e24fd628d5725d1
Author: James Daugherty <[email protected]>
AuthorDate: Thu May 15 08:33:00 2025 -0400
Indicate the source of the downloaded jar
---
grails-wrapper/src/main/java/grails/init/GrailsUpdater.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/grails-wrapper/src/main/java/grails/init/GrailsUpdater.java
b/grails-wrapper/src/main/java/grails/init/GrailsUpdater.java
index b37fe55ac1..bb0fb0b8d6 100644
--- a/grails-wrapper/src/main/java/grails/init/GrailsUpdater.java
+++ b/grails-wrapper/src/main/java/grails/init/GrailsUpdater.java
@@ -152,7 +152,7 @@ public class GrailsUpdater {
inputStream = conn.getInputStream();
}
- success = downloadWrapperJar(version, downloadedJar, inputStream);
+ success = downloadWrapperJar(version, downloadedJar, inputStream,
repo.isFile);
} catch (Exception e) {
System.err.println("There was an error downloading the wrapper
jar");
e.printStackTrace();
@@ -160,7 +160,7 @@ public class GrailsUpdater {
return success;
}
- private boolean downloadWrapperJar(GrailsVersion version, File
downloadJarLocation, InputStream inputStream) throws IOException {
+ private boolean downloadWrapperJar(GrailsVersion version, File
downloadJarLocation, InputStream inputStream, boolean isLocal) throws
IOException {
ReadableByteChannel rbc = Channels.newChannel(inputStream);
try (FileOutputStream fos = new FileOutputStream(downloadJarLocation))
{
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
@@ -179,7 +179,7 @@ public class GrailsUpdater {
directory.mkdirs();
}
Path jarFile = new File(directory,
GrailsWrapperHome.CLI_COMBINED_PROJECT_NAME + "-" + version.version +
".jar").toPath();
- System.out.println("...Moving downloaded jar to: " +
jarFile.toAbsolutePath());
+ System.out.println("...Moving " + (isLocal ? "local" : "remotely") + "
downloaded jar to: " + jarFile.toAbsolutePath());
Files.move(downloadJarLocation.getAbsoluteFile().toPath(), jarFile,
REPLACE_EXISTING);
return true;