Package pt.opensoft.text

Examples of pt.opensoft.text.StringAppender


  };

  public String toString (String nvSeparator, String separator) {
    List names = getNamesSorted();
    if (names == null) return "";
    StringAppender buffer = new StringAppender();
    for (int i = 0; i < names.size(); i++) {
      String name = (String) names.get(i);
      if (i > 0) buffer.append(separator);
      buffer.append(name);
      buffer.append(nvSeparator);
      String nameLower = name.toLowerCase();
      if( ListUtil.contains(DEFAULT_FILTERED_PASSWORDS, nameLower, PASSWORDS_FILTER_COMPARATOR) )
        buffer.append("*");
      else
        buffer.append(getString(name));
    }
    return buffer.toString();
  }
View Full Code Here


        return new String(buffer);
    }

    private String readFile(String fileName) throws IOException {
    StringAppender appender = new StringAppender();
    FileReader in = new FileReader(new File(_dir, fileName));
    try {
      BufferedReader reader = new BufferedReader(in);
      try {
        for (String line = reader.readLine(); line != null; line = reader.readLine()) {
          appender.append(line);
        }
        return appender.toString();
      } finally {
        reader.close();
      }
    } finally {
      in.close();
View Full Code Here

    public static String readFile(String filename) throws IOException {
        return readFile(new File(filename));
    }

    public static String readFile(File file) throws IOException {
        StringAppender appender = new StringAppender(DEFAULT_BUFFER_SIZE);
        readFile(file, appender);
        return appender.toString();
    }
View Full Code Here

        readFile(file, appender);
        return appender.toString();
    }

    public static String readFile(InputStream in) throws IOException {
        StringAppender appender = new StringAppender(DEFAULT_BUFFER_SIZE);
        readFile(in, appender);
        return appender.toString();
    }
View Full Code Here

TOP

Related Classes of pt.opensoft.text.StringAppender

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.