Package aQute.bnd.maven.support
Class MavenEntry
java.lang.Object
aQute.bnd.maven.support.MavenEntry
- All Implemented Interfaces:
Closeable
,AutoCloseable
An entry (a group/artifact) in the maven cache in the .m2/repository
directory. It provides methods to get the pom and the artifact.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) FutureTask<File>
(package private) final File
(package private) String
(package private) final File
(package private) final DirectoryLock
(package private) final Maven
(package private) final String
(package private) final File
(package private) final String
(package private) UTF8Properties
private boolean
(package private) final File
(package private) final Reporter
(package private) final File
-
Constructor Summary
ConstructorsConstructorDescriptionMavenEntry
(Maven maven, String path) Constructor.MavenEntry
(Maven maven, String path, Reporter reporter) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private CachedPom
Help function to create the POM and record its source.(package private) boolean
Download a resource from the given repo.This is the method to get the POM for a cached entry.protected Properties
Answer the properties, loading if needed.private String
getProperty
(String key) Answer a property.private boolean
isValid()
Check if this is a valid cache directory, might probably need some more stuff.void
remove()
private void
private void
setProperty
(String key, String value) We maintain a set of bnd properties in the cache directory.(package private) URL
Converts a repo + path to a URL..(package private) boolean
Verify that the repo has a checksum file for the given path and that this checksum matchs.private boolean
Verify the path against its digest for the given algorithm.
-
Field Details
-
maven
-
root
-
dir
-
path
-
lock
-
poms
-
pomFile
-
artifactFile
-
pomPath
-
propertiesFile
-
reporter
-
properties
UTF8Properties properties -
propertiesChanged
private boolean propertiesChanged -
artifact
FutureTask<File> artifact -
artifactPath
String artifactPath
-
-
Constructor Details
-
MavenEntry
Constructor.- Parameters:
maven
-path
-
-
MavenEntry
Constructor.- Parameters:
maven
-path
-reporter
-
-
-
Method Details
-
getArtifactFile
-
getPom
This is the method to get the POM for a cached entry.- Parameters:
urls
- The allowed URLs- Returns:
- a CachedPom for this maven entry
- Throws:
Exception
- If something goes haywire
-
download
Download a resource from the given repo.- Parameters:
repo
- The base url for the repopath
- The path part- Throws:
MalformedURLException
-
toURL
Converts a repo + path to a URL..- Parameters:
base
- The base repopath
- The path in the directory + url- Returns:
- a URL that points to the file in the repo
- Throws:
MalformedURLException
-
isValid
private boolean isValid()Check if this is a valid cache directory, might probably need some more stuff.- Returns:
- true if valid
-
setProperty
We maintain a set of bnd properties in the cache directory.- Parameters:
key
- The key for the propertyvalue
- The value for the property
-
getProperties
Answer the properties, loading if needed. -
getProperty
Answer a property.- Parameters:
key
- The key- Returns:
- The value
-
saveProperties
- Throws:
IOException
-
createPom
Help function to create the POM and record its source.- Parameters:
url
- the repo from which it was constructed- Returns:
- the new pom
- Throws:
Exception
-
verify
Verify that the repo has a checksum file for the given path and that this checksum matchs.- Parameters:
repo
- The repopath
- The file id- Returns:
- true if there is a digest and it matches one of the algorithms
- Throws:
Exception
-
verify
Verify the path against its digest for the given algorithm.- Parameters:
repo
-path
-algorithm
-- Throws:
Exception
-
getArtifact
- Throws:
Exception
-
getPomFile
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
remove
public void remove()
-