public interface Resource extends Trackable
| Modifier and Type | Method and Description |
|---|---|
String |
getBaseName()
Returns the short name of the resource with the file extension
(everything following the last dot character) cut off.
|
String |
getContent()
Returns the content of the resource
|
String |
getContent(String encoding)
Returns the content of the resource in a given encoding
|
InputStream |
getInputStream()
Returns an input stream to the content of the resource
|
long |
getLength()
Returns the length of the resource's content
|
int |
getLineNumber()
Return the current line number of this resource.
|
Reader |
getReader()
Returns a reader for the resource
|
Reader |
getReader(String encoding)
Returns a reader for the resource using the given character encoding
|
String |
getRelativePath()
Get the path of this resource relative to its root repository.
|
boolean |
getStripShebang()
Returns true if the input stream for this resource will look for a
first line starting with the characters #! and suppress it if found
|
void |
setStripShebang(boolean stripShebang)
Switch shebang stripping on or off
|
exists, getChecksum, getModuleName, getName, getParentRepository, getPath, getRootRepository, getUrl, isAbsolute, lastModified, setAbsolutelong getLength()
InputStream getInputStream() throws IOException
IOException - if a I/O related error occursReader getReader(String encoding) throws IOException
encoding - the character encodingIOException - if a I/O related error occursReader getReader() throws IOException
IOException - if a I/O related error occursString getContent(String encoding) throws IOException
encoding - the character encodingIOException - if a I/O related error occursString getContent() throws IOException
IOException - if a I/O related error occursString getBaseName()
String getRelativePath()
getRelativePath in interface Trackableboolean getStripShebang()
void setStripShebang(boolean stripShebang)
stripShebang - true to enable shebang strippingint getLineNumber()
Copyright © 2016. All rights reserved.