return the inputstream of the source file

@return return the inputstream for the source from physical or archive
@throws FileNotFoundException
968149
private InputStream getSourceAsInputStream() throws IOException {
	if (!mapping.hasArchive()) return IOUtil.toBufferedInputStream(getPhyscalFile().getInputStream());
	else if (isLoad(LOAD_PHYSICAL)) return IOUtil.toBufferedInputStream(getPhyscalFile().getInputStream());
	else if (isLoad(LOAD_ARCHIVE)) {
	    StringBuffer name = new StringBuffer(_getPackageName().replace('.', '/'));
	    if (name.length() > 0) name.append("/");
	    name.append(getFileName());

	    return mapping.getArchiveResourceAsStream(name.toString());
	}
	else {
	    return null;
	}
    }
1162183
public InputStream getInputStream(String strFilename)
    {
        InputStream streamIn = null;
        if ((strFilename != null) && (strFilename.length() > 0))
        {
            try   {
                URL url = null;
                if (strFilename.indexOf(':') == -1)
                    if (this.getApplication() != null)
                        url = this.getApplication().getResourceURL(strFilename, this);
                if (url != null)
                    streamIn = url.openStream();
            } catch (Exception ex)  {
                streamIn = null;
            }
        }
        if (streamIn == null)
            streamIn = Util.getInputStream(strFilename, this.getApplication());
        return streamIn;
    }
156833
public synchronized InputStream getInputStream() throws IOException {
        if (!connected) {
            connect();
        }

        // Nothing to return
        if (responseCode == HTTP_NOT_FOUND) {
            throw new FileNotFoundException(url.toString());
        }
        int length;

        if (inputStream == null) {
            return null;
        }

        // "De-chunk" the output stream
        else if ("chunked".equalsIgnoreCase(getHeaderField("Transfer-Encoding"))) {
            if (!(inputStream instanceof ChunkedInputStream)) {
                inputStream = new ChunkedInputStream(inputStream);
            }
        }

        // Make sure we don't wait forever, if the content-length is known
        else if ((length = getHeaderFieldInt("Content-Length", -1)) >= 0) {
            if (!(inputStream instanceof FixedLengthInputStream)) {
                inputStream = new FixedLengthInputStream(inputStream, length);
            }
        }
        return inputStream;
    }
128066
@Override
    public InputStream getInputStream() {
        try {
            LOGGER.debug("getInputStream getExternalIdentifier: {} {} ", property().getName(), getExternalIdentifier());
            return URI.create(getExternalIdentifier()).toURL().openStream();
        } catch (final MalformedURLException e) {
            throw new RepositoryRuntimeException("Malformed URL: " + getExternalIdentifier(), e);
        } catch (final Exception e) {
            throw new RepositoryRuntimeException(e);
        }
    }
236852
public synchronized InputStream getInputStream()
        throws java.io.IOException
    {
        if (!checkConnection())
            throw new IOException( "Invalid resource");

        try
        {    
            if( _in != null)
            {
                InputStream in = _in;
                _in=null;
                return in;
            }
            return _connection.getInputStream();
        }
        finally
        {
            _connection=null;
        }
    }
462567
public static InputStream getResourceAsStream(String fileName) throws FileNotFoundException {
    String localPath = UI_DIR + fileName;
    String altLocalPath = INTERNAL_BUILD_UI_DIR + fileName;
    InputStream in = StaticContentHandler.class.getResourceAsStream(localPath);
    if (in == null) {
      in = StaticContentHandler.class.getResourceAsStream(altLocalPath);
    }
    if (in == null) {
      throw new FileNotFoundException(localPath + " <or> " + altLocalPath);
    }
    return in;
  }
128137
public BufferedInputStream asBufferedInputStream() {
        InputStream is = asInputStream();
        if (is == null) return null;
        if (is instanceof BufferedInputStream) return (BufferedInputStream) is;
        return new BufferedInputStream(is);
    }
437943
public InputStream getInputStream()
    throws IOException
  {
    if (_is == null)
      _is = new FileInputStream(_file.getFD());

    return _is;
  }
1009092
public InputStream getInput(File file) throws FileNotFoundException {
      return file != null ? getInput(file.getPath()) : null;
   }
443960
@Override
    public InputStream getInputStream() throws IOException, IllegalStateException {
        if (this.read) {
            throw new IllegalStateException("InputStream has already been read - " +
                    "do not use InputStreamResource if a stream needs to be read multiple times");
        }
        this.read = true;
        return this.inputStream;
    }
96852
public Optional<InputStream> getFile() {
        if (!this.files.isEmpty()) {
            return Optional.of(this.files.get(0));
        }

        return Optional.empty();
    }
178648
@Override
  public InputStream getInputStream()
    throws IOException
  {
    InputStream is = _is;
    _is = null;

    return is;
  }
307260
public InputStream toInputStream() {
        byte[] encoded = toXML().toString().getBytes(Charset.forName("UTF-8"));
        return new ByteArrayInputStream(encoded);
    }
1343831
public static InputStream inputStream(File file) {
        // workaround http://stackoverflow.com/questions/36880692/java-file-does-not-exists-but-file-getabsolutefile-exists
        if (!file.exists()) {
            file = file.getAbsoluteFile();
        }
        if (!file.exists()) {
            throw E.ioException("File does not exists: %s", file.getPath());
        }
        try {
            return new FileInputStream(file);
        } catch (FileNotFoundException e) {
            throw E.ioException(e);
        }
    }
400835
@Override
    public InputStream getInputStream() throws IOException {
        try {
            InputStream result = entry.adapt(InputStream.class);
            if (result == null) {
                throw new IOException("The entry did not supply an input stream: " + entry);
            }
            return result;
        } catch (UnableToAdaptException e) {
            throw new IOException("Unable to get input stream for entry: " + entry.getPath() + '/' + entry.getName(), e);
        }
    }
917023
protected Resource getDownloadResource() {

        String pathToDownload = (String)m_file.getValue();

        if (m_donwloadAll.getValue().booleanValue()) {
            pathToDownload = ZIP_PATH;
            writeZipFile();
        }

        final File downloadFile = new File(pathToDownload);

        return new StreamResource(new StreamResource.StreamSource() {

            private static final long serialVersionUID = -8868657402793427460L;

            public InputStream getStream() {

                try {
                    return new FileInputStream(downloadFile);
                } catch (FileNotFoundException e) {
                    return null;
                }

            }
        }, downloadFile.getName());
    }
925485
public InputStream getInputStream()
        throws java.io.IOException
    {
        if (!_urlString.endsWith("!/"))
            return super.getInputStream();
        
        URL url = new URL(_urlString.substring(4,_urlString.length()-2));
        return url.openStream();
    }