maxon.IoHandlerInterface

Description

The IoHandler class offers some I/O functionality for filenames.
This handler needs to be implemented for each scheme.

Inheritance diagram

Inheritance

Parent Class:

Child Class:

Methods Signature

GetHandlerForScheme(scheme) Returns the maxon.IoHandler which is responsible for the given scheme.
GetSystemPath(url) Translates a maxon.Url to a OS or handler-specific system path.
GetUrlScheme() Returns the url scheme to use in Urls for this handler (such as “file” if this is the IoHandler for the file system).
IoNormalize(*args) IoNormalize(self, flags=maxon.NORMALIZEFLAGS.SCHEME_BASED): Returns a normalized maxon.Url.
OpenConnection(url) Opens a connection and returns the specified maxon.IoConnectionRef handler for this type of protocol.
RemoveUrl(url) Removes the last part of the given url and returns the parent url.
SetSystemPath(self, url, systemPath) Converts an OS or handler-specific system path to a maxon.Url.

Methods Definition

static IoHandlerInterface.GetHandlerForScheme(scheme)

Returns the maxon.IoHandler which is responsible for the given scheme. The maxon.IoHandler is searched for at the IoHandlers registry.

Parameters:scheme (maxon.Url) – The maxon.Url scheme for which the matching IoHandler shall be found.
Returns:The matching IoHandler, or a null reference.
Return type:maxon.IoHandler
Raises:LookupError – If the searched scheme can’t be found in the “net.maxon.registry.iohandlers” registry.
IoHandlerInterface.GetSystemPath(url)

Translates a maxon.Url to a OS or handler-specific system path.

Parameters:url (maxon.Url) – The maxon.Url to translate.
Returns:The generated path.
Return type:str
IoHandlerInterface.GetUrlScheme()

Returns the url scheme to use in Urls for this handler (such as “file” if this is the IoHandler for the file system).

Returns:Url scheme of this handler.
Return type:maxon.Url
IoHandlerInterface.IoNormalize(*args)

IoNormalize(self, flags=maxon.NORMALIZEFLAGS.SCHEME_BASED): Returns a normalized maxon.Url. If the normalized maxon.Url is a link, the maxon.IoHandler can resolve it (if supported).

Note

The file:/// handler resolves symbolic links, where the http:// handler does not resolve links.

Parameters:flags (maxon.NORMALIZEFLAGS) – Flags to define type of normalization.
Returns:The normalized maxon.Url.
Return type:maxon.Url
IoHandlerInterface.OpenConnection(url)

Opens a connection and returns the specified maxon.IoConnectionRef handler for this type of protocol.

Parameters:url (maxon.Url) – maxon.Url of the connection to open.
Returns:A reference to the specialized maxon.IoConnectionRef.
Return type:maxon.IoConnectionRef
IoHandlerInterface.RemoveUrl(url)

Removes the last part of the given url and returns the parent url.

Parameters:url (maxon.Url) – The maxon.Url
Returns:The modified maxon.Url.
Return type:maxon.Url
IoHandlerInterface.SetSystemPath(self, url, systemPath)

Converts an OS or handler-specific system path to a maxon.Url.

Parameters:
  • url (maxon.Url) – The url that will be filled.
  • systemPath (str) – The path.