Skip to content

Commit

Permalink
System.console() might return null in some cases, so we must use Syst…
Browse files Browse the repository at this point in the history
…em.out
  • Loading branch information
CesarCoelho committed Oct 4, 2021
1 parent 8fc05c6 commit 49c0bc5
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 49c0bc5

Please sign in to comment.