mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-17 08:26:08 -04:00
*) Using StringBuffer instead of String concatenation
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1018 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
@ -163,15 +163,21 @@ public class listManager {
|
||||
}
|
||||
|
||||
public static String getListString(String filename, boolean withcomments){
|
||||
String temp = "";
|
||||
String line = "";
|
||||
BufferedReader br = null;
|
||||
StringBuffer temp = new StringBuffer();
|
||||
|
||||
BufferedReader br = null;
|
||||
try{
|
||||
br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(listsPath ,filename))));
|
||||
File listFile;
|
||||
br = new BufferedReader(new InputStreamReader(new FileInputStream(listFile = new File(listsPath ,filename))));
|
||||
temp.ensureCapacity((int) listFile.length());
|
||||
|
||||
// Read the List
|
||||
String line = "";
|
||||
while ((line = br.readLine()) != null) {
|
||||
if ((!line.startsWith("#") || withcomments) || !line.equals("")) {
|
||||
temp += line + serverCore.crlfString;
|
||||
//temp += line + serverCore.crlfString;
|
||||
temp.append(line)
|
||||
.append(serverCore.crlfString);
|
||||
}
|
||||
}
|
||||
br.close();
|
||||
@ -180,7 +186,7 @@ public class listManager {
|
||||
if (br!=null) try { br.close(); } catch (Exception e) {}
|
||||
}
|
||||
|
||||
return temp;
|
||||
return temp.toString();
|
||||
}
|
||||
|
||||
// get a Directory Listing as a String Array
|
||||
|
Reference in New Issue
Block a user