Package org.apache.ivy.core.cache
Class ArtifactOrigin
- java.lang.Object
-
- org.apache.ivy.core.cache.ArtifactOrigin
-
public class ArtifactOrigin extends java.lang.ObjectThis class contains information about the origin of an artifact.- See Also:
BasicResolver,ResolvedResource
-
-
Constructor Summary
Constructors Constructor Description ArtifactOrigin(Artifact artifact, boolean isLocal, java.lang.String location)Create a new instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)ArtifactgetArtifact()Return the artifact that this location is pointing at.java.lang.LonggetLastChecked()The last time the resource was checked to be up to date.java.lang.StringgetLocation()Return the location of the resource (normally a url)inthashCode()booleanisExists()booleanisLocal()Is this resource local to this host, i.e.static booleanisUnknown(java.lang.String location)static booleanisUnknown(ArtifactOrigin artifact)voidsetExist(boolean exists)voidsetLastChecked(java.lang.Long lastChecked)voidsetLocation(java.lang.String location)java.lang.StringtoString()static ArtifactOriginunkwnown(Artifact artifact)ArtifactOrigin instance used when the origin is unknown.
-
-
-
Constructor Detail
-
ArtifactOrigin
public ArtifactOrigin(Artifact artifact, boolean isLocal, java.lang.String location)
Create a new instance- Parameters:
artifact- the artifact pointed by this location. Must not benull.isLocal-booleanvalue indicating if the resource is local (on the filesystem).location- the location of the resource (normally a url). Must not benull.
-
-
Method Detail
-
unkwnown
public static final ArtifactOrigin unkwnown(Artifact artifact)
ArtifactOrigin instance used when the origin is unknown.
-
isUnknown
public static final boolean isUnknown(ArtifactOrigin artifact)
-
isUnknown
public static final boolean isUnknown(java.lang.String location)
-
isLocal
public boolean isLocal()
Is this resource local to this host, i.e. is it on the file system?- Returns:
booleanvalue indicating if the resource is local.
-
getLocation
public java.lang.String getLocation()
Return the location of the resource (normally a url)- Returns:
- the location of the resource
-
setLocation
public void setLocation(java.lang.String location)
-
getArtifact
public Artifact getArtifact()
Return the artifact that this location is pointing at.- Returns:
- the artifact that this location is pointing at.
-
getLastChecked
public java.lang.Long getLastChecked()
The last time the resource was checked to be up to date. Maybenullif this information is not actually used by in some case.- Returns:
-
setLastChecked
public void setLastChecked(java.lang.Long lastChecked)
-
isExists
public boolean isExists()
-
setExist
public void setExist(boolean exists)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-