Package org.ops4j.pax.url.mvn.internal
Class Connection
- java.lang.Object
-
- java.net.URLConnection
-
- org.ops4j.pax.url.mvn.internal.Connection
-
public class Connection extends URLConnection
An URLConnection that supports mvn: protocol.
Syntax:
mvn:[repository_url!]groupId/artifactId[/version[/type[/classifier]]
where:- repository_url = an url that points to a maven 2 repository; optional, if not specified the repositories are resolved based on the repository/localRepository.
- groupId = group id of maven artifact; mandatory
- artifactId = artifact id of maven artifact; mandatory
- version = version of maven artifact; optional, if not specified uses LATEST and will try to resolve the version from available maven metadata. If version is a SNAPSHOT version, SNAPSHOT will be resolved from available maven metadata
- type = type of maven artifact; optional, if not specified uses "jar"
- classifier
mvn:http://repository.ops4j.org/mvn-releases!org.ops4j.pax.runner/runner/0.4.0- an artifact from an http repositorymvn:http://user:password@repository.ops4j.org/mvn-releases!org.ops4j.pax.runner/runner/0.4.0- an artifact from an http repository with authenticationmvn:file://c:/localRepo!org.ops4j.pax.runner/runner/0.4.0- an artifact from a directorymvn:jar:file://c:/repo.zip!/repository!org.ops4j.pax.runner/runner/0.4.0- an artifact from a zip filemvn:org.ops4j.pax.runner/runner/0.4.0- an artifact that will be resolved based on the configured repositories
The service can be configured in two ways: via configuration admin if available and via framework/system properties where the configuration via config admin has priority. See properties defined in
ServiceConstants.- Since:
- September 10, 2010
- Author:
- Toni Menzel, Alin Dreghiciu, Guillaume Nodet
-
-
Field Summary
-
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-
-
Constructor Summary
Constructors Constructor Description Connection(URL url, MavenResolver resolver)Creates a new connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()Does nothing.InputStreamgetInputStream()-
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
-
-
-
Constructor Detail
-
Connection
public Connection(URL url, MavenResolver resolver) throws MalformedURLException
Creates a new connection.- Parameters:
url- the url; cannot be null.resolver- resolver service; cannot be null- Throws:
MalformedURLException- in case of a malformed url
-
-
Method Detail
-
connect
public void connect()
Does nothing.- Specified by:
connectin classURLConnection- See Also:
URLConnection.connect()
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStreamin classURLConnection- Throws:
IOException
-
-