Package org.apache.maven.building
Class UrlSource
- java.lang.Object
-
- org.apache.maven.building.UrlSource
-
- All Implemented Interfaces:
Source
- Direct Known Subclasses:
UrlModelSource
,UrlSettingsSource
public class UrlSource extends java.lang.Object implements Source
Wraps an ordinaryURL
as a source.
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.URL
url
-
Constructor Summary
Constructors Constructor Description UrlSource(java.net.URL url)
Creates a new source backed by the specified URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
getInputStream()
Gets a byte stream to the source contents.java.lang.String
getLocation()
Provides a user-friendly hint about the location of the source.java.net.URL
getUrl()
Gets the URL of this source.java.lang.String
toString()
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Description copied from interface:Source
Gets a byte stream to the source contents. Closing the returned stream is the responsibility of the caller.- Specified by:
getInputStream
in interfaceSource
- Returns:
- A byte stream to the source contents, never
null
. - Throws:
java.io.IOException
-
getLocation
public java.lang.String getLocation()
Description copied from interface:Source
Provides a user-friendly hint about the location of the source. This could be a local file path, a URI or just an empty string. The intention is to assist users during error reporting.- Specified by:
getLocation
in interfaceSource
- Returns:
- A user-friendly hint about the location of the source, never
null
.
-
getUrl
public java.net.URL getUrl()
Gets the URL of this source.- Returns:
- The underlying URL, never
null
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-