clcommon/src/main/java/ucar/nc2/dt/image/image/ImageDatasetFactory.java
public BufferedImage open( String location) throws java.io.IOException {
    log = new StringBuffer();

    if (location.startsWith("http:")) {
      try {
        URL url = new URL(location);
        currentFile = null;
        return javax.imageio.ImageIO.read(url);

      } catch (MalformedURLException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      } catch (IOException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      }
    }

    else  {
      if (location.startsWith("file:)"))
        location = location.substring(5);

      try {
        File f = new File(location);
        if (!f.exists()) {
          return null;
        }

        currentFile = f;
        currentDir = null;
        return javax.imageio.ImageIO.read(f);

      } catch (MalformedURLException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      } catch (IOException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      }
    }
  }
public BufferedImage open( String location) throws java.io.IOException {
    log = new StringBuffer();

    if (location.startsWith("http:")) {
      try {
        URL url = new URL(location);
        currentFile = null;
        return javax.imageio.ImageIO.read(url);

      } catch (MalformedURLException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      } catch (IOException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      }
    }

    else  {
      if (location.startsWith("file:)"))
        location = location.substring(5);

      try {
        File f = new File(location);
        if (!f.exists()) {
          return null;
        }

        currentFile = f;
        currentDir = null;
        return javax.imageio.ImageIO.read(f);

      } catch (MalformedURLException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      } catch (IOException e) {
        log.append(e.getMessage());
        //e.printStackTrace();
        return null;
      }
    }
  }
public BufferedImage open ( String location ) throws java . io . IOException { log = new StringBuffer ( ) ; if ( location . startsWith ( "http:" ) ) { try { URL url = new URL ( location ) ; currentFile = null ; return javax . imageio . ImageIO . read ( url ) ; } catch ( MalformedURLException e ) { log . append ( e . getMessage ( ) ) ; //e.printStackTrace(); return null ; } catch ( IOException e ) { log . append ( e . getMessage ( ) ) ; //e.printStackTrace(); return null ; } } else { if ( location . startsWith ( "file:)" ) ) location = location . substring ( 5 ) ; try { File f = new File ( location ) ; if ( ! f . exists ( ) ) { return null ; } currentFile = f ; currentDir = null ; return javax . imageio . ImageIO . read ( f ) ; } catch ( MalformedURLException e ) { log . append ( e . getMessage ( ) ) ; //e.printStackTrace(); return null ; } catch ( IOException e ) { log . append ( e . getMessage ( ) ) ; //e.printStackTrace(); return null ; } } }
Open from a URL:
adde: use  AddeImage.factory()
http: use javax.imageio.ImageIO.read()
file: javax.imageio.ImageIO.read()
@param location open from this location
@return a BufferedImage
@throws java.io.IOException on read error
Open from a URL : adde : use AddeImage . factory () http : use javax . imageio . ImageIO . read () file : javax . imageio . ImageIO . read ()