I am trying to read the csv file from the URL. But I get java.io.FileNotFoundException. The URL works on browser. Please help. Below is my csv reading code.
public static void main(String args[]) {
InputStream input = null;
try {
input = new URL("http://prod2.riskval.com/site/table.csv").openStream();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
Reader reader = new InputStreamReader(input, "UTF-8");
BufferedReader br = new BufferedReader(reader);
String data;
try {
data = br.readLine();
System.out.println(data);
} catch (IOException e) {
e.printStackTrace();
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}