|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ArtifactStore
An artifact store holds Maven Artifacts and can provide Metadata about the artifacts that it holds.
| Method Summary | |
|---|---|
InputStream |
get(Artifact artifact)
Retrieves the the artifact as an InputStream. |
Set |
getArtifactIds(String groupId)
Returns the set of artifactIds that belong in the specified groupId. |
Set |
getArtifacts(String groupId,
String artifactId,
String version)
Returns the set of artifacts at the specified groupId:artifactId:version. |
Set |
getGroupIds(String parentGroupId)
Returns the set of groupIds that begin with the specified prefix. |
long |
getLastModified(Artifact artifact)
Returns the time that the specified artifact was last modified. |
org.apache.maven.artifact.repository.metadata.Metadata |
getMetadata(String path)
Returns the specified metadata. |
long |
getMetadataLastModified(String path)
Returns the time that the specified metadata was last modified. |
long |
getSize(Artifact artifact)
Returns the size in bytes of the specified artifact. |
Set |
getVersions(String groupId,
String artifactId)
Returns the set of versions of the specified groupId:artifactId. |
void |
set(Artifact artifact,
InputStream content)
Create/update the specified artifact. |
| Method Detail |
|---|
Set getGroupIds(String parentGroupId)
get(Artifact) method.
If there are known to be groupIds: org.codehaus.mojo, org.apache.maven and commons-io then
assertEquals(new HashSet<String>(Arrays.asList("commons-io","org")), getGroupIds("")); // Query root level
assertEquals(new HashSet<String>(Arrays.asList("org.codehaus", "org.apache")), getGroupIds("org")); // query with a prefix
assertEquals(new HashSet<String>(Arrays.asList("org.codehaus.mojo")), getGroupIds("org.codehaus"));
Note that while the existence of groupId org.codehaus.mojo implies that there must be groupIds
org and org.codehaus there is no requirement that an implementation should
report these inferred parent groupIds, it is just strongly encouraged.
Note that where an implementation cannot differentiate between artifactIds, child groupIds and perhaps even
versions, it is permitted to return all three.
parentGroupId - The prefix to query or the empty string to query the root, cannot be null.
String) of groupIds that are known to have
parentGroupId as their prefix. All returned elements must start with parentGroupId and must have
one and only one additional segment.Set getArtifactIds(String groupId)
get(Artifact) method.
Note that where an implementation cannot differentiate between artifactIds, child groupIds and perhaps even
versions, it is permitted to return all three.
groupId - The groupId to query cannot be empty or null.
String) of artifactIds that are known to belong to
groupId.
Set getVersions(String groupId,
String artifactId)
get(Artifact) method.
Note that where an implementation cannot differentiate between artifactIds, child groupIds and perhaps even
versions, it is permitted to return all three.
groupId - The groupId to query cannot be empty or null.artifactId - The artifactId to query cannot be empty or null.
String) of versions that are known to exist for
groupId:artifactId.
Set getArtifacts(String groupId,
String artifactId,
String version)
get(Artifact) method.
groupId - The groupId to query cannot be empty or null.artifactId - The artifactId to query cannot be empty or null.version - The version to query cannot be empty or null.
Artifact of artifacts that are known to exist of the
specified groupId:artifactId:version.
long getLastModified(Artifact artifact)
throws IOException,
ArtifactNotFoundException
artifact - the artifact.
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
artifact might not exist (where the artifact is known to not exist an
ArtifactNotFoundException must be thrown.
IOException - if an I/O error occurs.
ArtifactNotFoundException - if the artifact definitely does not exist.
long getSize(Artifact artifact)
throws IOException,
ArtifactNotFoundException
artifact - the artifact.
-1L if the length cannot be determined.
IOException - if an I/O error occurs.
ArtifactNotFoundException - if the artifact definitely does not exist.
InputStream get(Artifact artifact)
throws IOException,
ArtifactNotFoundException
InputStream. The caller is responsible for closing the stream.
artifact - the artifact.
IOException - if the artifact could not be retrieved.
ArtifactNotFoundException - if the artifact does not exist.
void set(Artifact artifact,
InputStream content)
throws IOException
artifact - the artifact to create/update.content - the stream of contents (implementer is responsible for closing).
IOException - if the content could not be read/written.
UnsupportedOperationException - if the implementation is a read-only implementation.
org.apache.maven.artifact.repository.metadata.Metadata getMetadata(String path)
throws IOException,
MetadataNotFoundException
path - of the metadata (should not include the maven-metadata.xml.
null.
IOException - if an I/O error occurs.
MetadataNotFoundException - if the metadata does not exist.
long getMetadataLastModified(String path)
throws IOException,
MetadataNotFoundException
path - of the metadata (should not include the maven-metadata.xml.
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
metadata might not exist (where the metadtat is known to not exist a
MetadataNotFoundException must be thrown.
IOException - if an I/O error occurs.
MetadataNotFoundException - if the metadata definitely does not exist.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||