List of usage examples for javax.activation URLDataSource getInputStream
public InputStream getInputStream() throws IOException
From source file:org.rebioma.server.FileUploadServlet.java
public static void main(String args[]) { try {// w ww . ja v a 2s. c o m URLDataSource csvSource = new URLDataSource( new URL("https://sites.google.com/site/rebiomahelp/home/english#datause")); BufferedReader stream = new BufferedReader(new InputStreamReader(csvSource.getInputStream())); String line; while ((line = stream.readLine()) != null) { System.out.println(line); } } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
From source file:org.rebioma.server.FileUploadServlet.java
private InputStream getUrlInputStream(String url) throws IOException { URLDataSource csvSource = new URLDataSource(new URL(url)); return csvSource.getInputStream(); }