Using Apache ANT to built. Included the commons-io-2.4.jar in classpath.
Compiler shows this error:
error: cannot find symbol
[javac] IOUtils.copy(in, out);
EDIT – code
File f1 = new File("c:\\json\\user.json");
File f2 = new File("c:\\json\\user1.json");
InputStream in = new FileInputStream(f1);
OutputStream out = new FileOutputStream(f2, true); // appending output stream
try {
IOUtils.copy(in, out);
}
finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(out);
}
EDIT- Answer
Did a mistake with the imports.
import org.apache.commons.io.IOUtils;
To try few things please:
Verify that code has:
import org.apache.commons.compress.utils.IOUtils;Verify that build.xml has a classpath reference for javac task that contains:
<classpath><pathelement path="${classpath}"/>
<pathelement location="lib/commons-io-2.4.jar"/>
</classpath>