Class FileDocumentSource

All Implemented Interfaces:
OWLOntologyDocumentSource

public class FileDocumentSource extends OWLOntologyDocumentSourceBase
A convenience class which will prepare an input source from a file.
Since:
2.2.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
  • Constructor Details

    • FileDocumentSource

      public FileDocumentSource(File file)
      Constructs an ontology input source using the specified file.
      Parameters:
      file - The file from which a concrete representation of an ontology will be obtained.
    • FileDocumentSource

      public FileDocumentSource(File file, OWLDocumentFormat format)
      Constructs an ontology input source using the specified file.
      Parameters:
      file - The file from which a concrete representation of an ontology will be obtained.
      format - ontology format. Can be null.
    • FileDocumentSource

      public FileDocumentSource(File file, @Nullable OWLDocumentFormat format, @Nullable String mime)
      Constructs an ontology input source using the specified file.
      Parameters:
      file - The file from which a concrete representation of an ontology will be obtained.
      format - ontology format. Can be null.
      mime - mime type
  • Method Details

    • getInputStream

      public Optional<InputStream> getInputStream()
      Description copied from interface: OWLOntologyDocumentSource
      If an input stream can be obtained from this document source then this method creates it. This method may be called multiple times. Each invocation will return a new input stream. If there is no input stream available, returns Optional.absent. .
      Returns:
      A new input stream which the ontology can be read from, wrapped in an Optional.