*/
private static String getFileContents(String filename) {
String url = "file:///values/" + filename;
String contents = "";
try {
FileConnection c = (FileConnection) Connector.open(url);
BufferedReader buf = new BufferedReader(new InputStreamReader(c.openInputStream()));
String line;
boolean lineRead;
while ((line = buf.readLine()) != null) {
lineRead = false;
if (line.charAt(0) != '#') {
for (int i = 0; i < line.toCharArray().length; i++) {
if (line.toCharArray()[i] == '#') {
contents += line.substring(0, i).trim() + "\n";
lineRead = true;
break;
}
}
if (lineRead == false) {
contents += line + "\n";
}
}
}
c.close();
}
catch (IOException e) {
}
return contents;
}