Class StreamManager
- java.lang.Object
-
- org.apache.jena.riot.system.stream.StreamManager
-
public class StreamManager extends java.lang.ObjectManagement 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
Fields Modifier and Type Field Description static booleanlogAllLookups
-
Constructor Summary
Constructors Constructor Description StreamManager()Create aStreamManagerwith no locator or location mapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamManageraddLocator(Locator loc)Add a locator to the end of the locators list.voidclearLocators()Remove all locatorsStreamManagerclone()Create a deep copy of this StreamManagerstatic StreamManagercreateStd()Return a default configuration StreamManager with aLocatorFile,LocatorHTTP,LocatorFTPandLocatorClassLoaderstatic StreamManagerget()Return the globalStreamManager.static StreamManagerget(Context context)Return theStreamManagerin a context, or the global one if the context is null or does not contain a valid entry for aStreamManager.LocationMappergetLocationMapper()Get the location mappingbooleanhasMapping(java.lang.String filenameOrURI)Test whether a mapping existsjava.util.List<Locator>locators()Return an immutable list of all the handlersjava.lang.StringmapURI(java.lang.String filenameOrURI)Apply the mapping of a filename or URITypedInputStreamopen(java.lang.String filenameOrURI)Open a file using the locators of this StreamManager.TypedInputStreamopenNoMap(java.lang.String filenameOrURI)Open a file using the locators of this StreamManager but without location mapping.TypedInputStreamopenNoMapOrNull(java.lang.String filenameOrURI)Open a file using the locators of this StreamManager without location mapping.voidremove(Locator loc)Remove a locator.static voidsetGlobal(StreamManager streamManager)Set the globalStreamManager.voidsetLocationMapper(LocationMapper _mapper)Set the location mapping
-
-
-
Method Detail
-
createStd
public static StreamManager createStd()
Return a default configuration StreamManager with aLocatorFile,LocatorHTTP,LocatorFTPandLocatorClassLoader
-
get
public static StreamManager get()
Return the globalStreamManager.
-
get
public static StreamManager get(Context context)
Return theStreamManagerin a context, or the global one if the context is null or does not contain a valid entry for aStreamManager.The
StreamManageris keyed in the context bySysRIOT.sysStreamManager.
-
setGlobal
public static void setGlobal(StreamManager streamManager)
Set the globalStreamManager.
-
clone
public StreamManager clone()
Create a deep copy of this StreamManager
-
open
public TypedInputStream open(java.lang.String filenameOrURI)
Open a file using the locators of this StreamManager. Returns null if not found.
-
hasMapping
public boolean hasMapping(java.lang.String filenameOrURI)
Test whether a mapping exists
-
mapURI
public java.lang.String mapURI(java.lang.String filenameOrURI)
Apply the mapping of a filename or URI
-
openNoMap
public TypedInputStream openNoMap(java.lang.String filenameOrURI)
Open a file using the locators of this StreamManager but without location mapping. Throws RiotNotFoundException if not found.
-
openNoMapOrNull
public TypedInputStream openNoMapOrNull(java.lang.String filenameOrURI)
Open a file using the locators of this StreamManager 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 java.util.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 StreamManager addLocator(Locator loc)
Add a locator to the end of the locators list. ReturnsthisStreamManager.
-
-