org.apache.maven.settings.building
Class UrlSettingsSource

java.lang.Object
  extended by org.apache.maven.settings.building.UrlSettingsSource
All Implemented Interfaces:
SettingsSource

public class UrlSettingsSource
extends Object
implements SettingsSource

Wraps an ordinary URL as a settings source.

Author:
Benjamin Bentmann

Constructor Summary
UrlSettingsSource(URL settingsUrl)
          Creates a new model source backed by the specified URL.
 
Method Summary
 InputStream getInputStream()
          Gets a byte stream to the settings contents.
 String getLocation()
          Provides a user-friendly hint about the location of the settings.
 URL getSettingsUrl()
          Gets the settings URL of this model source.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlSettingsSource

public UrlSettingsSource(URL settingsUrl)
Creates a new model source backed by the specified URL.

Parameters:
settingsUrl - The settings URL, must not be null.
Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: SettingsSource
Gets a byte stream to the settings contents. Closing the returned stream is the responsibility of the caller. Note that each invocation of this method returns a new/fresh stream which represents the entire contents.

Specified by:
getInputStream in interface SettingsSource
Returns:
A byte stream to the settings contents, never null.
Throws:
IOException

getLocation

public String getLocation()
Description copied from interface: SettingsSource
Provides a user-friendly hint about the location of the settings. 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 interface SettingsSource
Returns:
A user-friendly hint about the location of the settings, never null.

getSettingsUrl

public URL getSettingsUrl()
Gets the settings URL of this model source.

Returns:
The underlying settings URL, never null.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.