Back to project page PicoClock.
The source code is released under:
GNU General Public License
If you think the Android project PicoClock listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.arighi.picoclock.widget; //from w w w . ja v a 2 s .c om import java.io.File; import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; import android.util.Log; public class FileContent extends File { private static final String LOG_TAG = "PicoClock"; public FileContent(String filename) { super(filename); } public String content() { StringBuilder text = new StringBuilder(); try { BufferedReader buf = new BufferedReader(new FileReader(this)); String line; while ((line = buf.readLine()) != null) { text.append(line); } buf.close(); } catch (java.io.IOException e) { Log.e(LOG_TAG, "failed to read " + getName()); } return text.toString(); } }