Class MavenLocalRepoFileInitializer


  • public class MavenLocalRepoFileInitializer
    extends FileInitializer
    Attempt to download a maven:// 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
    • 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.IOException
        Description copied from class: FileInitializer
        Initialize a file resource
        Specified by:
        create in class FileInitializer
        Parameters:
        uri - the URI of the resource acting as its source
        location - 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()
      • download

        protected void download​(java.net.URI uri,
                                java.nio.file.Path destination)
                         throws java.io.IOException
        protected only for testing purpose
        Overrides:
        download in class FileInitializer
        Parameters:
        uri - the the uri to download
        destination - the destination File
        Throws:
        java.io.IOException