Friday, December 22, 2017

JAVA - How download document from web

This example is used for downloading rss channel:
try {    
  /* - open source */
      
  URL website = new URL( app.pSetup.getData().sRSSLink );
  InputStream in = website.openStream();      
  ...
}
catch( MalformedURLException ex ) {
  Logger.getLogger( FXMLMainController.class.getName() ).log( Level.SEVERE, null, ex );
  return false;
} 
catch( IOException ex ) {
  Logger.getLogger( FXMLMainController.class.getName() ).log( Level.SEVERE, null, ex );
  return false;
}

No comments:

Post a Comment