public class FileResource extends AbstractResource
baseName, name, path, repository| Modifier | Constructor and Description |
|---|---|
|
FileResource(File file) |
protected |
FileResource(File file,
FileRepository repository) |
|
FileResource(String path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
boolean |
exists()
Checks wether this resource actually (still) exists
|
InputStream |
getInputStream()
Returns an input stream to the content of the resource
|
long |
getLength()
Returns the length of the resource's content
|
URL |
getUrl()
Returns an url to the resource if the repository of this resource is
able to provide urls.
|
int |
hashCode() |
long |
lastModified()
Returns the date the resource was last modified
|
String |
toString() |
getBaseName, getChecksum, getContent, getContent, getLineNumber, getModuleName, getName, getParentRepository, getPath, getReader, getReader, getRelativePath, getRootRepository, getStripShebang, isAbsolute, setAbsolute, setBaseNameFromName, setStripShebang, stripShebangpublic FileResource(String path) throws IOException
IOExceptionpublic FileResource(File file) throws IOException
IOExceptionprotected FileResource(File file, FileRepository repository) throws IOException
IOExceptionpublic InputStream getInputStream() throws IOException
ResourceIOException - if a I/O related error occurspublic URL getUrl() throws MalformedURLException
TrackableMalformedURLExceptionpublic long lastModified()
Trackablepublic long getLength()
Resourcepublic boolean exists()
TrackableCopyright © 2016. All rights reserved.