From 49c0bc59a8d1b173f17282ab20612615ff7d2eac Mon Sep 17 00:00:00 2001 From: Cesar Coelho Date: Mon, 4 Oct 2021 11:35:46 +0200 Subject: [PATCH] System.console() might return null in some cases, so we must use System.out --- .../esa/mo/nmf/nmfpackage/NMFPackageManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/nmf-package-lib/src/main/java/esa/mo/nmf/nmfpackage/NMFPackageManager.java b/core/nmf-package-lib/src/main/java/esa/mo/nmf/nmfpackage/NMFPackageManager.java index f9eaa31c0..b6109981d 100644 --- a/core/nmf-package-lib/src/main/java/esa/mo/nmf/nmfpackage/NMFPackageManager.java +++ b/core/nmf-package-lib/src/main/java/esa/mo/nmf/nmfpackage/NMFPackageManager.java @@ -65,7 +65,7 @@ public class NMFPackageManager { public static void install(final String packageLocation, final File nmfDir) throws FileNotFoundException, IOException { - System.console().printf(SEPARATOR); + System.out.printf(SEPARATOR); // Get the File to be installed ZipFile zipFile = new ZipFile(packageLocation); @@ -210,12 +210,12 @@ public static void install(final String packageLocation, Logger.getLogger(NMFPackageManager.class.getName()).log(Level.INFO, "Package successfully installed from: {0}", packageLocation); - System.console().printf(SEPARATOR); + System.out.printf(SEPARATOR); } public static void uninstall(final NMFPackageDescriptor descriptor, final boolean keepUserData) throws IOException { - System.console().printf(SEPARATOR); + System.out.printf(SEPARATOR); // Safety check... should never happen... if (descriptor == null) { @@ -258,7 +258,7 @@ public static void uninstall(final NMFPackageDescriptor descriptor, Logger.getLogger(NMFPackageManager.class.getName()).log(Level.INFO, "Package successfully uninstalled from: " + installationDir); - System.console().printf(SEPARATOR); + System.out.printf(SEPARATOR); } private static void removeAuxiliaryFiles(File installationDir, String appName) throws IOException { @@ -278,7 +278,7 @@ private static void removeAuxiliaryFiles(File installationDir, String appName) t } public static void upgrade(final String packageLocation, final File nmfDir) throws IOException { - System.console().printf(SEPARATOR); + System.out.printf(SEPARATOR); // Get the Package to be uninstalled ZipFile zipFile = new ZipFile(packageLocation); ZipEntry newReceipt = zipFile.getEntry(HelperNMFPackage.RECEIPT_FILENAME); @@ -398,7 +398,7 @@ public static void upgrade(final String packageLocation, final File nmfDir) thro Logger.getLogger(NMFPackageManager.class.getName()).log(Level.INFO, "Package successfully upgraded from location: " + packageLocation); - System.console().printf(SEPARATOR); + System.out.printf(SEPARATOR); } /**