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 Pattern |
ARTIFACT_METADATA_URL_REGEX |
static Pattern |
ARTIFACT_REQUEST_URL_REGEX |
static String |
DEFAULT_REPO_ID |
protected static Logger |
LOGGER |
protected Map<String,org.sonatype.aether.repository.RemoteRepository> |
repositories |
static Pattern |
REPOSITORY_ID_REGEX |
protected org.sonatype.aether.RepositorySystemSession |
session |
protected org.sonatype.aether.RepositorySystem |
system |
protected File |
tmpFolder |
DOWNLOAD_TYPE, UPLOAD_TYPE| Constructor and Description |
|---|
MavenProxyServletSupport(String localRepository,
List<String> remoteRepositories,
boolean appendSystemRepos,
String updatePolicy,
String checksumPolicy,
String proxyProtocol,
String proxyHost,
int proxyPort,
String proxyUsername,
String proxyPassword,
String proxyNonProxyHosts) |
| Modifier and Type | Method and Description |
|---|---|
protected org.sonatype.aether.artifact.Artifact |
convertPathToArtifact(String path)
Converts the path of the request to an
Artifact. |
protected org.sonatype.aether.metadata.Metadata |
convertPathToMetadata(String path)
Converts the path of the request to
Metadata. |
protected String |
convertToMavenUrl(String path)
Converts the path of the request to maven coords.
|
File |
download(String path)
Downloads a
File from the MavenProxy. |
String |
getChecksumPolicy() |
String |
getLocalRepository() |
String |
getProxyHost() |
String |
getProxyNonProxyHosts() |
String |
getProxyPassword() |
int |
getProxyPort() |
String |
getProxyProtocol() |
String |
getProxyUsername() |
List<String> |
getRemoteRepositories() |
String |
getUpdatePolicy() |
boolean |
isAppendSystemRepos() |
protected org.sonatype.aether.RepositorySystem |
newRepositorySystem() |
protected org.sonatype.aether.RepositorySystemSession |
newSession(org.sonatype.aether.RepositorySystem system,
String localRepository) |
protected File |
readFile(InputStream is,
File tempLocation,
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(InputStream is,
String path)
Upload a
File to the MavenProxy. |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceprotected static final Logger LOGGER
public static final Pattern ARTIFACT_REQUEST_URL_REGEX
public static final Pattern ARTIFACT_METADATA_URL_REGEX
public static final Pattern REPOSITORY_ID_REGEX
public static final String DEFAULT_REPO_ID
protected org.sonatype.aether.RepositorySystem system
protected org.sonatype.aether.RepositorySystemSession session
protected File tmpFolder
public MavenProxyServletSupport(String localRepository, List<String> remoteRepositories, boolean appendSystemRepos, String updatePolicy, String checksumPolicy, String proxyProtocol, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String proxyNonProxyHosts)
public void start()
throws IOException
start in interface MavenProxyIOExceptionpublic void stop()
stop in interface MavenProxypublic File download(String path) throws InvalidMavenArtifactRequest
MavenProxyFile from the MavenProxy.download in interface MavenProxypath - The path from which to download the File.InvalidMavenArtifactRequestpublic boolean upload(InputStream is, 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,
String localRepository)
protected org.sonatype.aether.RepositorySystem newRepositorySystem()
protected String convertToMavenUrl(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(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(String path) throws InvalidMavenArtifactRequest
Metadata.path - The request path, following the format: <groupId>/<artifactId>/<version>/<artifactId>-<version>-[<classifier>].extensionInvalidMavenArtifactRequestprotected File readFile(InputStream is, File tempLocation, String name) throws 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.FileNotFoundExceptionpublic String getLocalRepository()
public boolean isAppendSystemRepos()
public String getUpdatePolicy()
public String getChecksumPolicy()
public String getProxyProtocol()
public String getProxyHost()
public int getProxyPort()
public String getProxyUsername()
public String getProxyPassword()
public String getProxyNonProxyHosts()
Copyright © 2011–2014 Red Hat. All rights reserved.