public class FileSource extends java.lang.Object implements Source
File
as a source.Modifier and Type | Field and Description |
---|---|
private java.io.File |
file |
Constructor and Description |
---|
FileSource(java.io.File file)
Creates a new source backed by the specified file.
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
getFile()
Gets the file of this source.
|
java.io.InputStream |
getInputStream()
Gets a byte stream to the source contents.
|
java.lang.String |
getLocation()
Provides a user-friendly hint about the location of the source.
|
java.lang.String |
toString() |
public FileSource(java.io.File file)
file
- The file, must not be null
.public java.io.InputStream getInputStream() throws java.io.IOException
Source
getInputStream
in interface Source
null
.java.io.IOException
public java.lang.String getLocation()
Source
getLocation
in interface Source
null
.public java.io.File getFile()
null
.public java.lang.String toString()
toString
in class java.lang.Object