org.apache.jena.riot.stream
Class StreamManager

java.lang.Object
  extended by org.apache.jena.riot.stream.StreamManager

public class StreamManager
extends Object

Management of stream opening, including redirecting through a location mapper whereby a name (e.g. URL) is redirected to another name (e.g. local file). Includes filename to IRI, handling ".gz" and "-"


Field Summary
static boolean logAllLookups
           
 
Constructor Summary
StreamManager()
           
 
Method Summary
 void addLocator(Locator loc)
          Add a locator to the end of the locators list
 void clearLocators()
          Remove all locators
 StreamManager clone()
          Create a deep copy of this StreamManager
static StreamManager get()
           
 LocationMapper getLocationMapper()
          Get the location mapping
 List<Locator> locators()
          Return an immutable list of all the handlers
static StreamManager makeDefaultStreamManager()
          Return a default configuration StreamManager with a LocatorFile, LocatorHTTP, LocatorFTP and LocatorClassLoader
 String mapURI(String filenameOrURI)
          Apply the mapping of a filename or URI
 TypedInputStream open(String filenameOrURI)
          Open a file using the locators of this FileManager.
 TypedInputStream openNoMap(String filenameOrURI)
          Open a file using the locators of this FileManager but without location mapping.
 TypedInputStream openNoMapOrNull(String filenameOrURI)
          Open a file using the locators of this FileManager without location mapping.
 void remove(Locator loc)
          Remove a locator
static void setGlobal(StreamManager streamManager)
           
 void setLocationMapper(LocationMapper _mapper)
          Set the location mapping
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logAllLookups

public static boolean logAllLookups
Constructor Detail

StreamManager

public StreamManager()
Method Detail

clone

public StreamManager clone()
Create a deep copy of this StreamManager

Overrides:
clone in class Object

makeDefaultStreamManager

public static StreamManager makeDefaultStreamManager()
Return a default configuration StreamManager with a LocatorFile, LocatorHTTP, LocatorFTP and LocatorClassLoader


get

public static StreamManager get()

setGlobal

public static void setGlobal(StreamManager streamManager)

open

public TypedInputStream open(String filenameOrURI)
Open a file using the locators of this FileManager. Returns null if not found.


mapURI

public String mapURI(String filenameOrURI)
Apply the mapping of a filename or URI


openNoMap

public TypedInputStream openNoMap(String filenameOrURI)
Open a file using the locators of this FileManager but without location mapping. Throws RiotNotFoundException if not found.


openNoMapOrNull

public TypedInputStream openNoMapOrNull(String filenameOrURI)
Open a file using the locators of this FileManager without location mapping. Return null if not found


setLocationMapper

public void setLocationMapper(LocationMapper _mapper)
Set the location mapping


getLocationMapper

public LocationMapper getLocationMapper()
Get the location mapping


locators

public List<Locator> locators()
Return an immutable list of all the handlers


remove

public void remove(Locator loc)
Remove a locator


clearLocators

public void clearLocators()
Remove all locators


addLocator

public void addLocator(Locator loc)
Add a locator to the end of the locators list



Licenced under the Apache License, Version 2.0