edu.stanford.smi.protegex.owl.repository.impl
Class HTTPRepository

java.lang.Object
  extended byedu.stanford.smi.protegex.owl.repository.impl.HTTPRepository
All Implemented Interfaces:
Repository

public class HTTPRepository
extends Object
implements Repository

User: matthewhorridge
The University Of Manchester
Medical Informatics Group
Date: Sep 18, 2005

matthew.horridge@cs.man.ac.uk
www.cs.man.ac.uk/~horridgm


Field Summary
private  URI ontologyName
           
private  URL ontologyURL
           
 
Constructor Summary
HTTPRepository(URL ontologyURL)
           
 
Method Summary
 boolean contains(URI ontologyName)
          Determines if the repository contains the specified ontology.
 InputStream getInputStream(URI ontologyName)
          Gets an inputstream to read the specified ontology from
 URL getLocation(URI ontologyName)
           
 Collection getOntologies()
          Gets the name of the ontologies that this repository contains.
 String getOntologyLocationDescription(URI ontologyName)
          Gets a description of where the specified ontology is located.
 URL getOntologyURL()
           
 OutputStream getOutputStream(URI ontologyName)
          Gets an output stream which can be used to write changes to the specified ontology.
 String getRepositoryDescription()
          Gets a description of the type of the repository.
 String getRepositoryDescriptor()
          Gets the descriptor for this repository.
 boolean isSystem()
          Determines if the ontology repository is a system repository.
 boolean isWritable(URI ontologyName)
          Determines if the specified ontology is writable.
 void refresh()
          Causes the repository to contain the latest information.
private  void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ontologyURL

private URL ontologyURL

ontologyName

private URI ontologyName
Constructor Detail

HTTPRepository

public HTTPRepository(URL ontologyURL)
Method Detail

getRepositoryDescriptor

public String getRepositoryDescriptor()
Description copied from interface: Repository
Gets the descriptor for this repository. This is used to serialise the repository in a list of the available repositories.

Specified by:
getRepositoryDescriptor in interface Repository

getOntologyLocationDescription

public String getOntologyLocationDescription(URI ontologyName)
Description copied from interface: Repository
Gets a description of where the specified ontology is located.

Specified by:
getOntologyLocationDescription in interface Repository
Parameters:
ontologyName - The name of the ontology.
Returns:
A String description of the location of the ontology, for example, "file:/Users/Blah/Blah/Blah". This return value will be an empty String if the repository does not contain the specified ontology.

update

private void update()

isSystem

public boolean isSystem()
Description copied from interface: Repository
Determines if the ontology repository is a system repository.

Specified by:
isSystem in interface Repository

getOntologyURL

public URL getOntologyURL()

contains

public boolean contains(URI ontologyName)
Description copied from interface: Repository
Determines if the repository contains the specified ontology.

Specified by:
contains in interface Repository
Parameters:
ontologyName - The name of the ontology.

refresh

public void refresh()
Description copied from interface: Repository
Causes the repository to contain the latest information.

Specified by:
refresh in interface Repository

getOntologies

public Collection getOntologies()
Description copied from interface: Repository
Gets the name of the ontologies that this repository contains.

Specified by:
getOntologies in interface Repository
Returns:
A Collection containing URIs.

getLocation

public URL getLocation(URI ontologyName)

getInputStream

public InputStream getInputStream(URI ontologyName)
                           throws IOException
Description copied from interface: Repository
Gets an inputstream to read the specified ontology from

Specified by:
getInputStream in interface Repository
Parameters:
ontologyName - The name of the ontology.
Returns:
an InputStream to read the ontology from, or null if the repository does not contain the ontology or the ontology cannot be retrieved.
Throws:
IOException

isWritable

public boolean isWritable(URI ontologyName)
Description copied from interface: Repository
Determines if the specified ontology is writable.

Specified by:
isWritable in interface Repository
Parameters:
ontologyName -
Returns:
true if the ontology is writable, or false if the ontology is not writable.

getOutputStream

public OutputStream getOutputStream(URI ontologyName)
                             throws IOException
Description copied from interface: Repository
Gets an output stream which can be used to write changes to the specified ontology.

Specified by:
getOutputStream in interface Repository
Parameters:
ontologyName - The ontology to be written
Returns:
an OutputStream that can be used to write changes to the ontology, or null if the ontology is not writable.
Throws:
IOException

getRepositoryDescription

public String getRepositoryDescription()
Description copied from interface: Repository
Gets a description of the type of the repository. For example, "Local folder".

Specified by:
getRepositoryDescription in interface Repository