Java InputStream Create getInputStream(String path)

Here you can find the source of getInputStream(String path)

Description

get Input Stream

License

Apache License

Declaration

private static InputStream getInputStream(String path) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Main {
    private static InputStream getInputStream(String path) throws IOException {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
        if (null == is) {
            throw new FileNotFoundException(path + " cannot be opened because it does not exist");
        }//from w  ww . java2s . c  o m
        return is;
    }
}

Related

  1. getInputStream(String fname, String enc)
  2. getInputStream(String inputFile)
  3. getInputStream(String location)
  4. getInputStream(String parentFolder, String fileName)
  5. getInputStream(String path)
  6. getInputStream(String path)
  7. getInputStream(String sPath)
  8. getInputStream(String str)
  9. getInputStream(String text)