public class FileHandle extends Object
InputStream rather than ever needing
to refer to the entire content at once
Written with the intention for use within functionality that unzips files over FileTransfer
protocols whereby we do not want to hold the entire file itself in memory
at any given time, rather a handle to an IO stream| Constructor and Description |
|---|
FileHandle(String path,
ByteArrayInputStream byteArrayInputStream)
Constructor
|
FileHandle(String path,
InputStream inputStream,
boolean isDirectory)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getContentAsInputStream()
Returns the content by way of an InputStream
Note that as with all
InputStreams, once read, there is no way to rewind. |
String |
getPath()
Returns the path of the file as a String
|
boolean |
isDirectory()
Accessor for isDirectory flag
|
String |
toString() |
public FileHandle(String path, InputStream inputStream, boolean isDirectory)
path - inputStream - isDirectory - public FileHandle(String path, ByteArrayInputStream byteArrayInputStream)
path - byteArrayInputStream - public String getPath()
public InputStream getContentAsInputStream()
InputStreams, once read, there is no way to rewind.
A new instance of the handle would be required.public boolean isDirectory()
public String toString()
toString in class ObjectObject.toString()Copyright © 2007-2017 Ikasan. All Rights Reserved.