public class MavenEntry
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
(package private) java.util.concurrent.FutureTask<java.io.File> |
artifact |
(package private) java.io.File |
artifactFile |
(package private) java.lang.String |
artifactPath |
(package private) java.io.File |
dir |
(package private) DirectoryLock |
lock |
(package private) Maven |
maven |
(package private) java.lang.String |
path |
(package private) java.io.File |
pomFile |
(package private) java.lang.String |
pomPath |
(package private) java.util.Map<java.net.URI,CachedPom> |
poms |
(package private) UTF8Properties |
properties |
private boolean |
propertiesChanged |
(package private) java.io.File |
propertiesFile |
(package private) java.io.File |
root |
Constructor and Description |
---|
MavenEntry(Maven maven,
java.lang.String path)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
private CachedPom |
createPom(java.net.URI url)
Help function to create the POM and record its source.
|
(package private) boolean |
download(java.net.URI repo,
java.lang.String path)
Download a resource from the given repo.
|
java.io.File |
getArtifact() |
java.io.File |
getArtifactFile() |
CachedPom |
getPom(java.net.URI[] urls)
This is the method to get the POM for a cached entry.
|
java.io.File |
getPomFile() |
protected java.util.Properties |
getProperties()
Answer the properties, loading if needed.
|
private java.lang.String |
getProperty(java.lang.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 |
saveProperties() |
private void |
setProperty(java.lang.String key,
java.lang.String value)
We maintain a set of bnd properties in the cache directory.
|
(package private) java.net.URL |
toURL(java.net.URI base,
java.lang.String path)
Converts a repo + path to a URL..
|
(package private) boolean |
verify(java.net.URI repo,
java.lang.String path)
Verify that the repo has a checksum file for the given path and that this
checksum matchs.
|
private boolean |
verify(java.net.URI repo,
java.lang.String path,
java.lang.String algorithm)
Verify the path against its digest for the given algorithm.
|
final Maven maven
final java.io.File root
final java.io.File dir
final java.lang.String path
final DirectoryLock lock
final java.util.Map<java.net.URI,CachedPom> poms
final java.io.File pomFile
final java.io.File artifactFile
final java.lang.String pomPath
final java.io.File propertiesFile
UTF8Properties properties
private boolean propertiesChanged
java.util.concurrent.FutureTask<java.io.File> artifact
java.lang.String artifactPath
MavenEntry(Maven maven, java.lang.String path)
maven
- path
- public java.io.File getArtifactFile()
public CachedPom getPom(java.net.URI[] urls) throws java.lang.Exception
urls
- The allowed URLsjava.lang.Exception
- If something goes haywireboolean download(java.net.URI repo, java.lang.String path) throws java.net.MalformedURLException
url
- The base url for the repopath
- The path partjava.net.MalformedURLException
java.net.URL toURL(java.net.URI base, java.lang.String path) throws java.net.MalformedURLException
base
- The base repopath
- The path in the directory + urljava.net.MalformedURLException
private boolean isValid()
private void setProperty(java.lang.String key, java.lang.String value)
key
- The key for the propertyvalue
- The value for the propertyprotected java.util.Properties getProperties()
private java.lang.String getProperty(java.lang.String key)
key
- The keyprivate void saveProperties() throws java.io.IOException
java.io.IOException
private CachedPom createPom(java.net.URI url) throws java.lang.Exception
url
- the repo from which it was constructedjava.lang.Exception
boolean verify(java.net.URI repo, java.lang.String path) throws java.lang.Exception
repo
- The repopath
- The file idjava.lang.Exception
private boolean verify(java.net.URI repo, java.lang.String path, java.lang.String algorithm) throws java.lang.Exception
repo
- path
- algorithm
- java.lang.Exception
public java.io.File getArtifact() throws java.lang.Exception
java.lang.Exception
public java.io.File getPomFile()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void remove()