public static InputStream getInputStreamByFilename(String filename) {
        File inputFile = new File(filename);
        InputStream inputStream = null;
        try {
            inputStream = inputFile.toURI().toURL().openStream();
        } catch (IOException e) {
            System.out.println("Unable to create InputStream from file.");
            e.printStackTrace();
        }

        return inputStream;
    }