Java InputStream Create getInputStream(String location)

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

Description

get Input Stream

License

Apache License

Declaration

public static InputStream getInputStream(String location) 

Method Source Code

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

import java.io.InputStream;

public class Main {
    public static InputStream getInputStream(String location) {
        InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(location);
        if (inputStream == null) {
            throw new RuntimeException("File not found in classpath: " + location);
        }//from  w  w w .j ava  2s . c o  m
        return inputStream;
    }
}

Related

  1. getInputStream(String filename)
  2. getInputStream(String filePath)
  3. getInputStream(String fileType, String fileName)
  4. getInputStream(String fname, String enc)
  5. getInputStream(String inputFile)
  6. getInputStream(String parentFolder, String fileName)
  7. getInputStream(String path)
  8. getInputStream(String path)
  9. getInputStream(String path)