Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.joseki.server
Class FileManager

    java.lang.Object
      org.joseki.server.FileManager

public class FileManager
extends java.lang.Object

A class to encapsulate accessing a file, whether it is in the local file system (various places), in a JAR file or a URL. Places to look for a file with a relative path name are: the servlet context, webserver current directory.

Error handling: on errors, a log message is written and nulls are returned

Version:
  $Id: FileManager.java,v 1.10 2004/04/30 14:13:13 andy_seaborne Exp $
Author:
  Andy Seaborne

Method Summary
`static FileManager` | `getInstance()` Get the file manager.
`com.hp.hpl.jena.rdf.model.Model` | `loadModel(java.lang.String filenameOrURI)` Load a model from a file (local or remote).
`com.hp.hpl.jena.rdf.model.Model` | `loadModel(java.lang.String filenameOrURI, java.lang.String baseURI)` Load a model from a file (local or remote).
`java.io.InputStream` | `open(java.lang.String filenameOrURI)`
`com.hp.hpl.jena.rdf.model.Model` | `readModel(com.hp.hpl.jena.rdf.model.Model model, java.lang.String filenameOrURI)` Read a file of RDF into a model.
`com.hp.hpl.jena.rdf.model.Model` | `readModel(com.hp.hpl.jena.rdf.model.Model model, java.lang.String filenameOrURI, java.lang.String baseURI)` Read a file of RDF into a model.
`void` | `setServletContext(javax.servlet.ServletContext _servletContext)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static FileManager getInstance()

  Get the file manager.

  Returns:
    the file manager

### setServletContext

    public void setServletContext(javax.servlet.ServletContext _servletContext)

### loadModel

    public com.hp.hpl.jena.rdf.model.Model loadModel(java.lang.String filenameOrURI)

  Load a model from a file (local or remote). Guesses the syntax of the file based on filename extension, defaulting to RDF/XML.

  Parameters:
    `filenameOrURI` - The filename or a URI (file:, http:)
  Returns:
    a new model, or null on error.

### loadModel

    public com.hp.hpl.jena.rdf.model.Model loadModel(java.lang.String filenameOrURI,
                                                     java.lang.String baseURI)

  Load a model from a file (local or remote). Guesses the syntax of the file based on filename extension, defaulting to RDF/XML.

  Parameters:
    `filenameOrURI` - The filename or a URI (file:, http:)
    `baseURI` - Base URI for loading the RDF model.
  Returns:
    a new model, or null on error.

### readModel

    public com.hp.hpl.jena.rdf.model.Model readModel(com.hp.hpl.jena.rdf.model.Model model,
                                                     java.lang.String filenameOrURI)

  Read a file of RDF into a model.

  Parameters:
    `model` -
    `filenameOrURI` -
  Returns:
    The model or null, if there was an error.

### readModel

    public com.hp.hpl.jena.rdf.model.Model readModel(com.hp.hpl.jena.rdf.model.Model model,
                                                     java.lang.String filenameOrURI,
                                                     java.lang.String baseURI)

  Read a file of RDF into a model.

  Parameters:
    `model` -
    `filenameOrURI` -
    `baseURI` -
  Returns:
    The model or null, if there was an error.

### open

    public java.io.InputStream open(java.lang.String filenameOrURI)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 Hewlett-Packard. All Rights Reserved.