org.sonatype.aether.repository
Class LocalArtifactResult

java.lang.Object
  extended by org.sonatype.aether.repository.LocalArtifactResult

public class LocalArtifactResult
extends java.lang.Object

A result from the local repository about the existence of an artifact.

Author:
Benjamin Bentmann
See Also:
LocalRepositoryManager.find(RepositorySystemSession, LocalArtifactRequest)

Constructor Summary
LocalArtifactResult(LocalArtifactRequest request)
          Creates a new result for the specified request.
 
Method Summary
 java.io.File getFile()
          Gets the file to the requested artifact.
 LocalArtifactRequest getRequest()
          Gets the request corresponding to this result.
 boolean isAvailable()
          Indicates whether the requested artifact is available for use.
 LocalArtifactResult setAvailable(boolean available)
          Sets whether the artifact is available.
 LocalArtifactResult setFile(java.io.File file)
          Sets the file to requested artifact.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalArtifactResult

public LocalArtifactResult(LocalArtifactRequest request)
Creates a new result for the specified request.

Parameters:
request - The local artifact request, must not be null.
Method Detail

getRequest

public LocalArtifactRequest getRequest()
Gets the request corresponding to this result.

Returns:
The corresponding request, never null.

getFile

public java.io.File getFile()
Gets the file to the requested artifact. Note that this file must not be used unless isAvailable() returns true. An artifact file can be found but considered unavailable if the artifact was cached from a remote repository that is not part of the list of remote repositories used for this query.

Returns:
The file to the requested artifact or null.

setFile

public LocalArtifactResult setFile(java.io.File file)
Sets the file to requested artifact.

Parameters:
file - The artifact file, may be null.
Returns:
This result for chaining, never null.

isAvailable

public boolean isAvailable()
Indicates whether the requested artifact is available for use. As a minimum, the file needs to be physically existent in the local repository to be available. Additionally, a local repository manager can consider the list of supplied remote repositories to determine whether the artifact is logically available and mark an artifact unavailable if it is not known to be hosted by any of the provided repositories.

Returns:
true if the artifact is available, false otherwise.

setAvailable

public LocalArtifactResult setAvailable(boolean available)
Sets whether the artifact is available.

Parameters:
available - true if the artifact is available, false otherwise.
Returns:
This query for chaining, never null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Sonatype, Inc.. All Rights Reserved.