Class MavenLocalRepoFileInitializer
- java.lang.Object
-
- org.eclipse.jetty.start.FileInitializer
-
- org.eclipse.jetty.start.fileinits.MavenLocalRepoFileInitializer
-
public class MavenLocalRepoFileInitializer extends FileInitializer
Attempt to download amaven://URI, by first attempting to find the resource in the maven repository system (starting with local, then central)Valid URI Formats:
maven://<groupId>/<artifactId>/<version>- minimum requirement (type defaults to
jar, with no classifier) maven://<groupId>/<artifactId>/<version>/<type>- optional type requirement
-
maven://<groupId>/<artifactId>/<version>/<type>/<classifier> - optional type and classifier requirement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMavenLocalRepoFileInitializer.Coordinates
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.start.FileInitializer
_basehome, _scheme
-
-
Constructor Summary
Constructors Constructor Description MavenLocalRepoFileInitializer(BaseHome baseHome)MavenLocalRepoFileInitializer(BaseHome baseHome, java.nio.file.Path localRepoDir, boolean readonly)MavenLocalRepoFileInitializer(BaseHome baseHome, java.nio.file.Path localRepoDir, boolean readonly, java.lang.String mavenRepoUri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreate(java.net.URI uri, java.lang.String location)Initialize a file resourceprotected voiddownload(java.net.URI uri, java.nio.file.Path destination)protected only for testing purposeMavenLocalRepoFileInitializer.CoordinatesgetCoordinates(java.net.URI uri)java.lang.StringgetRemoteUri()-
Methods inherited from class org.eclipse.jetty.start.FileInitializer
check, copyDirectory, getDestination, isApplicable, isFilePresent
-
-
-
-
Constructor Detail
-
MavenLocalRepoFileInitializer
public MavenLocalRepoFileInitializer(BaseHome baseHome)
-
MavenLocalRepoFileInitializer
public MavenLocalRepoFileInitializer(BaseHome baseHome, java.nio.file.Path localRepoDir, boolean readonly)
-
MavenLocalRepoFileInitializer
public MavenLocalRepoFileInitializer(BaseHome baseHome, java.nio.file.Path localRepoDir, boolean readonly, java.lang.String mavenRepoUri)
-
-
Method Detail
-
create
public boolean create(java.net.URI uri, java.lang.String location) throws java.io.IOExceptionDescription copied from class:FileInitializerInitialize a file resource- Specified by:
createin classFileInitializer- Parameters:
uri- the URI of the resource acting as its sourcelocation- the simple string reference to the output file, suitable for searching for the file in other locations (like ${jetty.home} or ${jetty.dir}) *- Returns:
- true if local file system is modified.
- Throws:
java.io.IOException- if there was an attempt to initialize, but an error occurred.
-
getRemoteUri
public java.lang.String getRemoteUri()
-
getCoordinates
public MavenLocalRepoFileInitializer.Coordinates getCoordinates(java.net.URI uri)
-
download
protected void download(java.net.URI uri, java.nio.file.Path destination) throws java.io.IOExceptionprotected only for testing purpose- Overrides:
downloadin classFileInitializer- Parameters:
uri- the the uri to downloaddestination- the destination File- Throws:
java.io.IOException
-
-