org.apache.maven.settings.building
Class FileSettingsSource

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

public class FileSettingsSource
extends Object
implements SettingsSource

Wraps an ordinary File as a settings source.

Author:
Benjamin Bentmann

Constructor Summary
FileSettingsSource(File settingsFile)
          Creates a new settings source backed by the specified file.
 
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.
 File getSettingsFile()
          Gets the settings file 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

FileSettingsSource

public FileSettingsSource(File settingsFile)
Creates a new settings source backed by the specified file.

Parameters:
settingsFile - The settings file, 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.

getSettingsFile

public File getSettingsFile()
Gets the settings file of this model source.

Returns:
The underlying settings file, never null.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001–2013 The Apache Software Foundation. All rights reserved.