public class MavenProxyServletSupport extends javax.servlet.http.HttpServlet implements MavenProxy
| Modifier and Type | Class and Description |
|---|---|
static class |
MavenProxyServletSupport.LogAdapter |
static class |
MavenProxyServletSupport.ManualWagonProvider |
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
ARTIFACT_METADATA_URL_REGEX |
static java.util.regex.Pattern |
ARTIFACT_REQUEST_URL_REGEX |
static java.lang.String |
DEFAULT_REPO_ID |
protected static java.util.logging.Logger |
LOGGER |
protected java.util.Map<java.lang.String,org.sonatype.aether.repository.RemoteRepository> |
repositories |
static java.util.regex.Pattern |
REPOSITORY_ID_REGEX |
protected org.sonatype.aether.RepositorySystemSession |
session |
protected org.sonatype.aether.RepositorySystem |
system |
protected java.io.File |
tmpFolder |
DOWNLOAD_TYPE, UPLOAD_TYPE| Constructor and Description |
|---|
MavenProxyServletSupport(java.lang.String localRepository,
java.util.List<java.lang.String> remoteRepositories,
boolean appendSystemRepos,
java.lang.String updatePolicy,
java.lang.String checksumPolicy,
java.lang.String proxyProtocol,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUsername,
java.lang.String proxyPassword,
java.lang.String proxyNonProxyHosts) |
| Modifier and Type | Method and Description |
|---|---|
protected org.sonatype.aether.artifact.Artifact |
convertPathToArtifact(java.lang.String path)
Converts the path of the request to an
Artifact. |
protected org.sonatype.aether.metadata.Metadata |
convertPathToMetadata(java.lang.String path)
Converts the path of the request to
Metadata. |
protected java.lang.String |
convertToMavenUrl(java.lang.String path)
Converts the path of the request to maven coords.
|
java.io.File |
download(java.lang.String path)
Downloads a
File from the MavenProxy. |
java.lang.String |
getChecksumPolicy() |
java.lang.String |
getLocalRepository() |
java.lang.String |
getProxyHost() |
java.lang.String |
getProxyNonProxyHosts() |
java.lang.String |
getProxyPassword() |
int |
getProxyPort() |
java.lang.String |
getProxyProtocol() |
java.lang.String |
getProxyUsername() |
java.util.List<java.lang.String> |
getRemoteRepositories() |
java.lang.String |
getUpdatePolicy() |
boolean |
isAppendSystemRepos() |
protected org.sonatype.aether.RepositorySystem |
newRepositorySystem() |
protected org.sonatype.aether.RepositorySystemSession |
newSession(org.sonatype.aether.RepositorySystem system,
java.lang.String localRepository) |
protected java.io.File |
readFile(java.io.InputStream is,
java.io.File tempLocation,
java.lang.String name)
Reads a
File from the InputStream then saves it under a temp location and returns the file. |
void |
start() |
void |
stop() |
boolean |
upload(java.io.InputStream is,
java.lang.String path)
Upload a
File to the MavenProxy. |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceprotected static final java.util.logging.Logger LOGGER
public static final java.util.regex.Pattern ARTIFACT_REQUEST_URL_REGEX
public static final java.util.regex.Pattern ARTIFACT_METADATA_URL_REGEX
public static final java.util.regex.Pattern REPOSITORY_ID_REGEX
public static final java.lang.String DEFAULT_REPO_ID
protected java.util.Map<java.lang.String,org.sonatype.aether.repository.RemoteRepository> repositories
protected org.sonatype.aether.RepositorySystem system
protected org.sonatype.aether.RepositorySystemSession session
protected java.io.File tmpFolder
public MavenProxyServletSupport(java.lang.String localRepository,
java.util.List<java.lang.String> remoteRepositories,
boolean appendSystemRepos,
java.lang.String updatePolicy,
java.lang.String checksumPolicy,
java.lang.String proxyProtocol,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUsername,
java.lang.String proxyPassword,
java.lang.String proxyNonProxyHosts)
public void start()
throws java.io.IOException
start in interface MavenProxyjava.io.IOExceptionpublic void stop()
stop in interface MavenProxypublic java.io.File download(java.lang.String path)
throws InvalidMavenArtifactRequest
MavenProxyFile from the MavenProxy.download in interface MavenProxypath - The path from which to download the File.InvalidMavenArtifactRequestpublic boolean upload(java.io.InputStream is,
java.lang.String path)
throws InvalidMavenArtifactRequest
MavenProxyFile to the MavenProxy.upload in interface MavenProxyis - The InputStream to upload.path - The upload path.InvalidMavenArtifactRequestprotected org.sonatype.aether.RepositorySystemSession newSession(org.sonatype.aether.RepositorySystem system,
java.lang.String localRepository)
protected org.sonatype.aether.RepositorySystem newRepositorySystem()
protected java.lang.String convertToMavenUrl(java.lang.String path)
throws InvalidMavenArtifactRequest
DefaultArtifact.path - The request path, following the format: <groupId>/<artifactId>/<version>/<artifactId>-<version>-[<classifier>].extensionString in the following format: <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>InvalidMavenArtifactRequestprotected org.sonatype.aether.artifact.Artifact convertPathToArtifact(java.lang.String path)
throws InvalidMavenArtifactRequest
Artifact.path - The request path, following the format: <groupId>/<artifactId>/<version>/<artifactId>-<version>-[<classifier>].extensionDefaultArtifact that matches the request path.InvalidMavenArtifactRequestprotected org.sonatype.aether.metadata.Metadata convertPathToMetadata(java.lang.String path)
throws InvalidMavenArtifactRequest
Metadata.path - The request path, following the format: <groupId>/<artifactId>/<version>/<artifactId>-<version>-[<classifier>].extensionInvalidMavenArtifactRequestprotected java.io.File readFile(java.io.InputStream is,
java.io.File tempLocation,
java.lang.String name)
throws java.io.FileNotFoundException
File from the InputStream then saves it under a temp location and returns the file.is - The source input stream.tempLocation - The temporary location to save the content of the stream.name - The name of the file.java.io.FileNotFoundExceptionpublic java.lang.String getLocalRepository()
public java.util.List<java.lang.String> getRemoteRepositories()
public boolean isAppendSystemRepos()
public java.lang.String getUpdatePolicy()
public java.lang.String getChecksumPolicy()
public java.lang.String getProxyProtocol()
public java.lang.String getProxyHost()
public int getProxyPort()
public java.lang.String getProxyUsername()
public java.lang.String getProxyPassword()
public java.lang.String getProxyNonProxyHosts()
Copyright © 2015 Red Hat. All Rights Reserved.