Resource
public class BuiltFileResource extends java.lang.Object implements Resource
PackagerResolver
.Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
BUILT_ARTIFACT_PATTERN |
Where the build file should put built artifacts (relative
to the build directory).
|
Constructor | Description |
---|---|
BuiltFileResource(java.io.File file) |
|
BuiltFileResource(java.io.File dir,
Artifact artifact) |
Modifier and Type | Method | Description |
---|---|---|
Resource |
clone(java.lang.String name) |
Clones this resource with a new resource with a different name
|
boolean |
exists() |
Determine if the resource is available.
|
long |
getContentLength() |
Get the resource size
|
java.io.File |
getFile() |
|
long |
getLastModified() |
Get the date the resource was last modified
|
java.lang.String |
getName() |
Get the name of the resource.
|
boolean |
isLocal() |
Is this resource local to this host, i.e.
|
java.io.InputStream |
openStream() |
Opens a stream on this resource
|
java.lang.String |
toString() |
public static final java.lang.String BUILT_ARTIFACT_PATTERN
public BuiltFileResource(java.io.File file)
public BuiltFileResource(java.io.File dir, Artifact artifact)
public java.lang.String getName()
Resource
public Resource clone(java.lang.String name)
Resource
public long getLastModified()
Resource
getLastModified
in interface Resource
long
value representing the time the file was last modified,
measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or
0L
if the file does not exist or if an I/O error occurs.public long getContentLength()
Resource
getContentLength
in interface Resource
long
value representing the size of the resource in bytes.public boolean exists()
Resource
public java.lang.String toString()
toString
in class java.lang.Object
public java.io.File getFile()
public boolean isLocal()
Resource
public java.io.InputStream openStream() throws java.io.IOException
Resource
openStream
in interface Resource
java.io.IOException