String getEnabledCiphers() {
   StringBuilder sb = new StringBuilder();
   for (Entry e : data) {
     if (e.enabled) {
       sb.append(e.cipher);
       sb.append(',');
     }
   }
   if (sb.length() == 0) {
     return sb.toString();
   } else {
     return sb.substring(0, sb.length() - 1);
   }
 }
  protected String consume(BufferedReader br) throws Exception {
    StringBuilder ret = new StringBuilder();

    int ch;
    while ((ch = br.read()) != -1) ret.appendCodePoint(ch);

    return ret.toString();
  }
Exemple #3
0
 public static String getLines(String s) {
   StringBuilder sb = new StringBuilder();
   int index = 0;
   for (int i = 1; index != -1; i++) {
     sb.append(i + "\n");
     index = s.indexOf("\n", index + 1);
   }
   return sb.toString();
 }
Exemple #4
0
  private <T extends Enum<T>> String getPropertyValue(T algo) {
    StringBuilder strb = new StringBuilder();

    for (T it : active.algos(algo)) {
      strb.append(it.name());
      strb.append(';');
    }
    return strb.toString();
  }
Exemple #5
0
 public static String inputStreamReaderToString(InputStreamReader in) throws Exception {
   StringBuilder sb = new StringBuilder();
   char[] buf = new char[1025];
   while (in.ready()) {
     sb.append((new String(buf, 0, in.read(buf, 0, 1024))).replaceAll("\r\n", "\n"));
   }
   in.close();
   String tmp = sb.toString();
   while (tmp.contains("\r\n")) {
     tmp = tmp.replaceAll("\r\n", "\n");
   }
   return tmp;
 }
 public static String getNextName(String base) {
   StringBuilder sb = new StringBuilder();
   sb.append(base);
   sb.append(nextEntryNumber++);
   return sb.toString();
 }