code: private static String removeQuoteCharactersIfNecessary(String fileName,
              String option, char quote) throws Exception {
          boolean startingQuote = (option.charAt(0) == quote);
          boolean endingQuote = (option.charAt(option.length() - 1) == quote);
  
          if (startingQuote && endingQuote) {
              if (option.length() == 1) {
                  throw new Exception("Malformed option in options file("
                          + fileName + "): " + option);
              }
              return option.substring(1, option.length() - 1);
          }
  
          if (startingQuote || endingQuote) {
              throw new Exception("Malformed option in options file("
                      + fileName + "): " + option);
          }
  
          return option;
      }
docs: Removes the surrounding quote characters from the given string. The quotes
  are identified by the quote parameter, the given string by option. The
  fileName parameter is used for raising exceptions with relevant message.
  @param fileName
  @param option
  @param quote
  @return
  @throws Exception