How to read file stored on server using java? I have .txt file stored on server, how to read contents of it.
String test, newq;
newq = "http://www.example.com/pqr.txt";
test = new String(Files.readAllBytes(Paths.get(newq)));
// variable test should contain pqr.txt content
What I am doing wrong?