java.lang.Object
org.apache.jena.riot.system.stream.StreamManager
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddLocator
(Locator loc) Add a locator to the end of the locators list.void
Remove all locatorsclone()
Create a deep copy of this StreamManagerstatic StreamManager
Return a default configuration StreamManager with aLocatorFile
,LocatorHTTP
,LocatorFTP
andLocatorClassLoader
static StreamManager
get()
Return the globalStreamManager
.static StreamManager
Return theStreamManager
in a context, or the global one if the context is null or does not contain a valid entry for aStreamManager
.Deprecated, for removal: This API element is subject to removal in a future version.boolean
hasMapping
(String filenameOrURI) Test whether a mapping existsSet the location mappinglocationMapper
(LocationMapper mapper) Set the location mappinglocators()
Return an immutable list of all the handlersApply the mapping of a filename or URIOpen a file using the locators of this StreamManager.Open a file using the locators of this StreamManager but without location mapping.openNoMapOrNull
(String filenameOrURI) Open a file using the locators of this StreamManager without location mapping.void
Remove a locator.static void
setGlobal
(StreamManager streamManager) Set the globalStreamManager
.void
setLocationMapper
(LocationMapper mapper) Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
logAllLookups
public static boolean logAllLookups
-
-
Constructor Details
-
StreamManager
public StreamManager()Create aStreamManager
with no locator or location mapper.
-
-
Method Details
-
createStd
Return a default configuration StreamManager with aLocatorFile
,LocatorHTTP
,LocatorFTP
andLocatorClassLoader
-
get
Return the globalStreamManager
. -
get
Return theStreamManager
in a context, or the global one if the context is null or does not contain a valid entry for aStreamManager
.The
StreamManager
is keyed in the context bySysRIOT.sysStreamManager
. -
setGlobal
Set the globalStreamManager
. -
clone
Create a deep copy of this StreamManager -
open
Open a file using the locators of this StreamManager. Returns null if not found. -
hasMapping
Test whether a mapping exists -
mapURI
Apply the mapping of a filename or URI -
openNoMap
Open a file using the locators of this StreamManager but without location mapping. Throws RiotNotFoundException if not found. -
openNoMapOrNull
Open a file using the locators of this StreamManager without location mapping. Return null if not found -
setLocationMapper
Deprecated, for removal: This API element is subject to removal in a future version.Set the location mapping -
getLocationMapper
Deprecated, for removal: This API element is subject to removal in a future version.UselocationMapper()
Get the location mapping -
locationMapper
Set the location mapping -
locationMapper
Set the location mapping -
locators
Return an immutable list of all the handlers -
remove
Remove a locator. -
clearLocators
public void clearLocators()Remove all locators -
addLocator
Add a locator to the end of the locators list. Returnsthis
StreamManager.
-
locationMapper()