Class BuiltFileResource
- java.lang.Object
-
- org.apache.ivy.plugins.resolver.packager.BuiltFileResource
-
- All Implemented Interfaces:
Resource
public class BuiltFileResource extends java.lang.Object implements Resource
Represents an artifact built by aPackagerResolver.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBUILT_ARTIFACT_PATTERNWhere the build file should put built artifacts (relative to the build directory).
-
Constructor Summary
Constructors Constructor Description BuiltFileResource(java.io.File file)BuiltFileResource(java.io.File dir, Artifact artifact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resourceclone(java.lang.String name)Clones this resource with a new resource with a different namebooleanexists()Determine if the resource is available.longgetContentLength()Get the resource sizejava.io.FilegetFile()longgetLastModified()Get the date the resource was last modifiedjava.lang.StringgetName()Get the name of the resource.booleanisLocal()Is this resource local to this host, i.e. is it on the file system?java.io.InputStreamopenStream()Opens a stream on this resourcejava.lang.StringtoString()
-
-
-
Field Detail
-
BUILT_ARTIFACT_PATTERN
public static final java.lang.String BUILT_ARTIFACT_PATTERN
Where the build file should put built artifacts (relative to the build directory). Value is: "artifacts/[type]s/[artifact].[ext]"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BuiltFileResource
public BuiltFileResource(java.io.File file)
-
BuiltFileResource
public BuiltFileResource(java.io.File dir, Artifact artifact)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:ResourceGet the name of the resource.
-
clone
public Resource clone(java.lang.String name)
Description copied from interface:ResourceClones this resource with a new resource with a different name
-
getLastModified
public long getLastModified()
Description copied from interface:ResourceGet the date the resource was last modified- Specified by:
getLastModifiedin interfaceResource- Returns:
- A
longvalue representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or0Lif the file does not exist or if an I/O error occurs.
-
getContentLength
public long getContentLength()
Description copied from interface:ResourceGet the resource size- Specified by:
getContentLengthin interfaceResource- Returns:
- a
longvalue representing the size of the resource in bytes.
-
exists
public boolean exists()
Description copied from interface:ResourceDetermine if the resource is available. Note that this method only checks for availability, not for actual existence.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getFile
public java.io.File getFile()
-
isLocal
public boolean isLocal()
Description copied from interface:ResourceIs this resource local to this host, i.e. is it on the file system?
-
openStream
public java.io.InputStream openStream() throws java.io.IOExceptionDescription copied from interface:ResourceOpens a stream on this resource- Specified by:
openStreamin interfaceResource- Returns:
- the opened input stream
- Throws:
java.io.IOException- if something goes wrong
-
-