Returns for the file the input stream.

@return input stream of the file with the content
@throws EFapsException on error
341958
@Override
    public InputStream read()
        throws EFapsException
    {
        StoreResourceInputStream in = null;
        ConnectionResource res = null;
        try {
            res = Context.getThreadContext().getConnectionResource();

            final Statement stmt = res.createStatement();
            final StringBuffer cmd = new StringBuffer()
                .append("select ").append(JDBCStoreResource.COLNAME_FILECONTENT).append(" ")
                .append("from ").append(JDBCStoreResource.TABLENAME_STORE).append(" ")
                .append("where ID =").append(getGeneralID());
            final ResultSet resultSet = stmt.executeQuery(cmd.toString());
            if (resultSet.next()) {
                if (Context.getDbType().supportsBinaryInputStream())  {
                    in = new JDBCStoreResourceInputStream(this,
                                                          res,
                                                          resultSet.getBinaryStream(1));
                } else  {
                    in = new JDBCStoreResourceInputStream(this,
                                                          res,
                                                          resultSet.getBlob(1));
                }
            }
            resultSet.close();
            stmt.close();
        } catch (final IOException e) {
            JDBCStoreResource.LOG.error("read of content failed", e);
            throw new EFapsException(JDBCStoreResource.class, "read.SQLException", e);
        } catch (final SQLException e) {
            JDBCStoreResource.LOG.error("read of content failed", e);
            throw new EFapsException(JDBCStoreResource.class, "read.SQLException", e);
        }
        return in;
    }
1205773
public  InputStream getInputStream(File f)
	throws IOException
	{

		// use the magic numbers to determine the compression type,
		// use file extension only as 2nd choice

		int magic = 0;


		InputStream test = getInputStreamFromFile(f);
		magic = getMagicNumber(test);
		test.close();


		InputStream inputStream = null;

		String fileName = f.getName();

		if (magic == UncompressInputStream.LZW_MAGIC ) {
			// a Z compressed file
			return openCompressedFile(f);
		}

		else if (magic == GZIP_MAGIC ) {
			return openGZIPFile(f);
		}

		else if ( fileName.endsWith(".gz")) {
			return openGZIPFile(f);
		}

		else if ( fileName.endsWith(".zip")){

			ZipFile zipfile = new ZipFile(f);

			// stream to first entry is returned ...
			ZipEntry entry;
			Enumeration<? extends ZipEntry> e = zipfile.entries();
			if ( e.hasMoreElements()){
				entry = e.nextElement();
				inputStream = zipfile.getInputStream(entry);
			} else {
				throw new IOException ("Zip file has no entries");
			}

		}

		else if ( fileName.endsWith(".jar")) {

			JarFile jarFile = new JarFile(f);

			// stream to first entry is returned
			JarEntry entry;
			Enumeration<JarEntry> e = jarFile.entries();
			if ( e.hasMoreElements()){
				entry = e.nextElement();
				inputStream = jarFile.getInputStream(entry);
			} else {
				throw new IOException ("Jar file has no entries");
			}
		}

		else if ( fileName.endsWith(".Z")) {
			// unix compressed
			return openCompressedFile(f);

		}

		else {

			// no particular extension found, assume that it is an uncompressed file
			inputStream = getInputStreamFromFile(f);
		}

		return inputStream;
	}
1078539
public function createInputStream(): InputStream {
		$this->ensureValid();
		try {
			return IoUtils::createSafeFileInputStream($this->fsPath);
		} catch (CouldNotAchieveFlockException $e) {
			return new FileResourceStream($this->fsPath, 'r');
		}
	}
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;
    }
781851
protected Content getNextFile() throws IOException {
        JarEntry entry;
        if ((entry = jis.getNextJarEntry()) != null) {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            byte[] data = new byte[BUFFER];
            int size;
            while ((size = jis.read(data, 0, data.length)) != -1) {
                bos.write(data, 0, size);
            }
            Content file = new Content(entry.getName(), bos.toByteArray());
            bos.close();
            return file;
        }
        return null;
    }
307260
public InputStream toInputStream() {
        byte[] encoded = toXML().toString().getBytes(Charset.forName("UTF-8"));
        return new ByteArrayInputStream(encoded);
    }
1129980
public InputStream getInputStream() throws APIException, IOException {
        final HttpResponse response = client.get(getUrl());
        HttpClientHelpers.throwIfNotOk(response);
        return response.getEntity().getContent();
    }
649942
public function getFileStream() {
		$stream = new \FAL\FileStream();
		$pt = $stream->getProtocolName();
		file_put_contents($path = $pt.'://'.$this->file,$this->getContent());
		return $path;
	}
1348257
public File getFile()
   {
      File file = (File)this.getSource();
      
      if(file != null)
          FileMonitor.waitFor(file);
      
      return file;
  
   }
948761
public URI getInputFile() {
//        if (prop.containsKey(PROPERTY_INPUT_MAP_URI)) {
//            return toURI(prop.get(PROPERTY_INPUT_MAP_URI).toString());
//        }
//        return null;
        return files.values().stream()
                .filter(fi -> fi.isInput)
                .map(fi -> fi.src)
                .findAny()
                .orElse(null);

    }
608782
function getStream()
    {
        if ($err = $this->getError() !== UPLOAD_ERR_OK)
            // TODO Handle Upload With Exception Error
            throw new \RuntimeException(sprintf(
                'Cannot retrieve stream due to upload error. error: (%s).'
                , getUploadErrorMessageFromCode($err)
            ));

        if ($this->isFileMoved)
            throw new \RuntimeException('Cannot retrieve stream after it has already been moved');

        if ($this->stream)
            return $this->stream;

        $givenFileResource = $this->_c_givenResource;
        if (!$givenFileResource instanceof StreamInterface)
            $givenFileResource = new Stream($givenFileResource, 'r');
        
        return $this->stream = $givenFileResource;
    }
1121265
public Stream<T> asStream() {
        if (modelType == null) {
            throw new IllegalArgumentException("modelType can be not null");
        }

        if (fromFile == null && fromStream == null) {
            throw new IllegalArgumentException("Excel source not is null");
        }

        if (fromFile != null) {
            return ReaderFactory.readByFile(this);
        } else {
            return ReaderFactory.readByStream(this);
        }
    }
878662
@FFDCIgnore({ PrivilegedActionException.class })
    protected InputStream getInputStream(final File f, String fileSystemSelector,  String location, String classLoadingSelector ) throws IOException {      
        // check file system first like we used to do
        if (f != null) {
            InputStream is = null;
            try { 
                is = (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                    @Override
                    public Object run() throws Exception {
                        if (f.exists()) {
                            return new FileInputStream(f);
                        } else {
                            return null;
                        }
                    }
                });
                
            } catch (PrivilegedActionException e1) {
            }
            if (is != null) { 
                locationUsed = fileSystemSelector;
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "input stream obtained from file system and locationUsed set to: "+ locationUsed);
                }
                return is;
            }
        }        
        // do the expensive classpath search
        // performant: we're avoiding calling getResource if entry was previously cached.
        URL u = Thread.currentThread().getContextClassLoader().getResource(location);  
        locationUsed = classLoadingSelector;
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "input stream obtained from classloader and  locationUsed set to: "+ locationUsed);
        }
        if (u != null) {            
            return u.openStream();
        }
        return null;
    }
1142410
public InputStream toInputStream() {
        
        String text = toXml();
        return new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8));
        
    }
562431
protected synchronized InputStream getInputStream() throws IOException {
        if (isClosedOrPending()) {
            throw new IOException("Socket Closed");
        }
        if (shut_rd) {
            throw new IOException("Socket input is shutdown");
        }
        if (socketInputStream == null) {
            socketInputStream = new SocketInputStream(this);
        }
        return socketInputStream;
    }
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;
    }
169280
public InputStream getContent() {
        switch(contentType){
            case EMPTY:
                throw new RuntimeException("There is not Content available to analyze");
            case FILE:
                if(consumed)
                    try {
                        contentStream = Optional.of((InputStream) new FileInputStream(contentFile.get()));
                    } catch (FileNotFoundException e) {
                        throw new RuntimeException(e);
                    }
                break;
                case STRING:
                    if (consumed) {
                        if (contentEncoding.isPresent()) {
                            try {
                                contentStream = Optional.of(IOUtils.toInputStream(contentString.get(), contentEncoding.get()));
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            }
                        } else {
                            contentStream = Optional.of(IOUtils.toInputStream(contentString.get()));
                        }
                    }
                    break;
                case INPUTSTREAM:
                    if (consumed) {
                        throw new RuntimeException("The Content Stream to be analyzed has been already consumed");
                    }
                    break;
                default:
                    break;
        }
        
        consumed = true;
        return contentStream.get();
    }