package droplauncher.util;

import adakite.debugging.Debugging;
import java.util.ArrayList;
import java.util.logging.Logger;

/**
 * Utilities and constants class for DropLauncher.
 */
public class Util {

  private static final Logger LOGGER = Logger.getLogger(Util.class.getName());
  private static final boolean CLASS_DEBUG = (Constants.DEBUG && true);

  public static final String NEWLINE = System.lineSeparator();

  private Util() {}

  /**
   * Returns the String[] version of the specified ArrayList object.
   *
   * @param arrlist specified ArrayList object
   * @return
   *     String[] object if specified ArrayList is not null or empty,
   *     otherwise null
   */
  public static String[] toStringArray(ArrayList<String> arrlist) {
    int len = (arrlist == null) ? 0 : arrlist.size();
    if (len < 1) {
      if (CLASS_DEBUG) {
        LOGGER.log(Constants.DEFAULT_LOG_LEVEL, Debugging.nullObject("null or empty list"));
      }
      return null;
    }
    String[] arr = new String[len];
    for (int i = 0; i < len; i++) {
      arr[i] = arrlist.get(i);
    }
    return arr;
  }

  public static String newline(int n) {
    if (n < 1) {
      return "";
    }
    StringBuilder sb = new StringBuilder(n);
    for (int i = 0; i < n; i++) {
      sb.append(NEWLINE);
    }
    return sb.toString();
  }

}

@@ -57,16 +57,79 @@
 ugging;%0A
+import adakite.utils.AdakiteUtils;%0Aimport java.nio.file.Paths;%0A
 import j
@@ -180,16 +180,63 @@
 .Logger;
+%0Aimport javax.swing.filechooser.FileSystemView;
 %0A%0A/**%0A *
@@ -1430,10 +1430,411 @@
 );%0A  %7D%0A%0A
+  public static String getUserHomeDirectory() %7B%0A    FileSystemView fsv = FileSystemView.getFileSystemView();%0A    fsv.getRoots();%0A    String desktopDirectory = fsv.getHomeDirectory().getAbsolutePath();%0A    if (!AdakiteUtils.isNullOrEmpty(desktopDirectory)%0A        && AdakiteUtils.directoryExists(Paths.get(desktopDirectory))) %7B%0A      return desktopDirectory;%0A    %7D else %7B%0A      return null;%0A    %7D%0A  %7D%0A%0A
 %7D%0A

Add method "getUserHomeDirectory"