org.apache.maven.model.building
Class UrlModelSource

java.lang.Object
  extended by org.apache.maven.model.building.UrlModelSource
All Implemented Interfaces:
ModelSource

public class UrlModelSource
extends java.lang.Object
implements ModelSource

Wraps an ordinary URL as a model source.

Author:
Benjamin Bentmann

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

Constructor Detail

UrlModelSource

public UrlModelSource(java.net.URL pomUrl)
Creates a new model source backed by the specified URL.

Parameters:
pomUrl - The POM file, must not be null.
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: ModelSource
Gets a byte stream to the POM contents. Closing the returned stream is the responsibility of the caller.

Specified by:
getInputStream in interface ModelSource
Returns:
A byte stream to the POM contents, never null.
Throws:
java.io.IOException

getLocation

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

getPomUrl

public java.net.URL getPomUrl()
Gets the POM URL of this model source.

Returns:
The underlying POM URL, never null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2011 Apache Software Foundation. All Rights Reserved.