0

I have to convert a file into a string where the file should be obtained from the given downloadable url link

String result = "";
        try 
        {
            URL url = new URL(downloadablelink);
            BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();
            while (line != null) 
            {
                sb.append(line);
                line = br.readLine();
            }
            result = sb.toString();
        } catch(Exception e) {}

I have tried this but I get the html content of the page as the result. what should I do?

Abhijith S
  • 526
  • 5
  • 17

0 Answers0