java - What to import to use IOUtils.toString()? -
i trying use ioutils.tostring() read file. however, getting error saying "ioutils cannot resolved."
what supposed importing allow me use function?
string = ioutils.tostring(inputstream);
thanks
import org.apache.commons.io.ioutils;
if still can't import add pom.xml:
<dependency> <groupid>commons-io</groupid> <artifactid>commons-io</artifactid> <version>2.5</version> </dependency>
or direct jar/gradle etc visit: http://mvnrepository.com/artifact/commons-io/commons-io/2.5
also since version 2.5 of commons-io method ioutils.tostring(inputstream) has been deprecated. should use method encoding i.e.
ioutils.tostring(is, "utf-8");
Comments
Post a Comment