Java URL to InputStream getInputStream(URL sourceURL)

Here you can find the source of getInputStream(URL sourceURL)

Description

get Input Stream

License

Open Source License

Declaration

public static InputStream getInputStream(URL sourceURL) 

Method Source Code

//package com.java2s;

import java.io.InputStream;

import java.net.URL;

public class Main {
    public static InputStream getInputStream(URL sourceURL) {
        InputStream is = null;/* w  ww . j  av  a 2s.c  o  m*/
        try {
            is = sourceURL.openStream();
        } catch (Exception e) {
            // do nothing, file does not yet exist
        }
        return is;
    }
}

Related

  1. getInputStream(String url, int timeout)
  2. getInputStream(URL url)
  3. getInputStream(URL url)
  4. getInputStream(URL url)
  5. getInputStream(URL url)