gov.llnl.babel.repository
Class RepositoryFactory

java.lang.Object
  extended by gov.llnl.babel.repository.RepositoryFactory

public class RepositoryFactory
extends java.lang.Object

RepositoryFactory is a singleton factory that manages the creation of repository interfaces based on a repository URI. A URI that starts with "http:" or "https:" specifies a web repository. A URI that starts with "file:" creates a file repository. All other URIs are assumed to be file repositories.


Constructor Summary
RepositoryFactory(Context context)
          Create a new instance of the repository factory.
 
Method Summary
 Repository createRepository(java.lang.String uri)
          Create a new repository object based on the URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryFactory

public RepositoryFactory(Context context)
Create a new instance of the repository factory. Although singleton classes do not typically define a public constructor, this version does so to support multiple repository factories in the same application. Most implementations, however, will not directly create a factory through the constructor and will instead use the singleton functions getInstance and setInstance.

Method Detail

createRepository

public Repository createRepository(java.lang.String uri)
                            throws RepositoryException
Create a new repository object based on the URI. Web repositories are created using a URL starting with "http:" or "https:" and file repositories are created using a URL starting with "file:" or any other prefix. A RepositoryException is thrown if any error is detected in creating the repository.

Throws:
RepositoryException