String trimToOptions(String help) { boolean success = false; try { int dividerPos = help.indexOf(DIVIDER); int start = dividerPos + DIVIDER.length(); int stop = help.indexOf(END_TEXT); if (dividerPos == -1) { throw new RuntimeException("Can not parse: <" + help + ">"); } help = help.substring(start, stop); help = help + System.getProperty("line.separator"); success = true; return help; } finally { if (!success) { StringBuffer msg = new StringBuffer(); msg.append("["); msg.append(classUtil.shortName(this)); msg.append("] parsing unseccessful:"); msg.append(str.newLine()); msg.append(help); err.println(msg); } } }
utils.files().writeString(portFile, port + utils.str().newLine());