How to read content of a file into string in java.

import org.apache.commons.io.IOUtils;

String s = IOUtils.toString(new FileInputStream("/tmp/file"));

See Apache Commons IO for more.

BACK TO TOP
Post tagged with: java