org.apache.maven.dotnet.vendor.impl
Class SettingsRepository

java.lang.Object
  extended by org.apache.maven.dotnet.vendor.impl.SettingsRepository
All Implemented Interfaces:
Repository

public final class SettingsRepository
extends java.lang.Object
implements Repository

Provides methods for loading and reading the nmaven-settings config file.

Author:
Shane Isbell

Constructor Summary
SettingsRepository()
          Constructor.
 
Method Summary
 java.io.File getInstallRootFor(java.lang.String vendor, java.lang.String vendorVersion, java.lang.String frameworkVersion)
          Returns the install root for the .NET framework for the specified parameters.
 void load(java.io.InputStream inputStream, java.util.Hashtable properties)
          Loads the configuration file and configuration properties.
 void setRepositoryRegistry(RepositoryRegistry repositoryRegistry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SettingsRepository

public SettingsRepository()
Constructor. This method is intended to be invoked by the RepositoryRegistry, not by the application developer.

Method Detail

load

public void load(java.io.InputStream inputStream,
                 java.util.Hashtable properties)
          throws java.io.IOException
Description copied from interface: Repository
Loads the configuration file and configuration properties. In the case below, the inputStream contains the adapters.txt file and the properties holds the init-params. The init params should be used to specialize the repository configuration. The example below shows that you can add new properties to MyRepository but not delete them.
 <registry-config>
 <repositories>
 <repository>
 <repository-name>adapter</repository-name>
 <repository-class>org.jvending.sample.MyRepository</repository-class>
 <repository-config>${basedir}/adapters.txt</repository-config>
 <init-param>
 <param-name>add</param-name>
 <param-value>true</param-value>
 </init-param>
 <init-param>
 <param-name>delete</param-name>
 <param-value>false</param-value>
 </init-param>
 </repository>
 </repositories>
 </registry-config>
 

Since this method uses an InputStream parameter, the configuration file can be loaded off of the local file system or from a specific URL located at an HTTP address.

Specified by:
load in interface Repository
Parameters:
inputStream - the configuration file
properties - the properties used to configure the repository
Throws:
java.io.IOException - thrown on interrupted I/O. Implementing class may also use this exception to throw other exceptions like invalid properties.
See Also:
Repository.load(java.io.InputStream, java.util.Hashtable)

setRepositoryRegistry

public void setRepositoryRegistry(RepositoryRegistry repositoryRegistry)
Specified by:
setRepositoryRegistry in interface Repository
See Also:
Repository.setRepositoryRegistry(org.apache.maven.dotnet.registry.RepositoryRegistry)

getInstallRootFor

public java.io.File getInstallRootFor(java.lang.String vendor,
                                      java.lang.String vendorVersion,
                                      java.lang.String frameworkVersion)
                               throws PlatformUnsupportedException
Returns the install root for the .NET framework for the specified parameters. None of the parameter values should be null.

Parameters:
vendor - the vendor name
vendorVersion - the vendor version
frameworkVersion - the .NET framework version
Returns:
the install root for the .NET framework
Throws:
PlatformUnsupportedException - if there is no install root found for the specified parameters


Copyright © 2007 NMaven. All Rights Reserved.