maxon.Url

Description

Reference class of maxon.UrlInterface.

Inheritance diagram

Inheritance

Parent Class:

Methods Signature

GetBrowseIterator(flags)

Returns a dedicated IoBrowseIterator with the browse iterator internally

GetBrowseRef()

Returns the pure browse iterator

GetData(idValue[, default])

Retrieves the data stored at the given url.

GetHashCode()

Return the hashcode of an url.

IoCopyFile(dest, overwrite, removeReadOnly)

Copies a file to a different location, the path must exist otherwise the function returns an error.

IoCreateDirectory(createParents[, createdDirs])

Creates a new directory.

IoDelete(force[, recursive])

Deletes a file or directory physically on the medium.

IoDetect()

Detects the type of the object behind maxon.Url.

IoGetAttributes()

Returns the file attributes of the object behind maxon.Url.

IoGetTime(mode)

Returns the maxon.DateTime of the current file.

IoMove(destName)

Moves a file or directory (including hierarchy) to a different location, the path must exist otherwise

IoRename(newName)

Renames a file or directory.

OpenConnection()

Returns a reference to a maxon.IoConnectionInterface class of this Url.

OpenInputStream([flags])

Returns a reference to a maxon.InputStreamInterface class of this maxon.Url.

OpenOutputStream([flags])

Returns a reference to a maxon.OutputStreamInterface class of this maxon.Url.

__add__(s)

Appends a relative string or a maxon.Url to the current one.

__hash__()

Returns the hash code of an Url.

__init__([urlOrScheme, scheme, authority, …])

Creates and stores internally the reference of the C++ Data.

__radd__(s)

Appends a relative string or a maxon.Url to the current one.

__repr__()

Returns the string representation of an Url using the StringInterface.ToString method.

__str__()

Returns the string representation of an Url using the StringInterface.ToString method.

Methods Definition

Url.GetBrowseIterator(flags)

Returns a dedicated IoBrowseIterator with the browse iterator internally

Url.GetBrowseRef()

Returns the pure browse iterator

Url.GetData(idValue, default=None)

Retrieves the data stored at the given url.

Parameters
  • idValue (maxon.Id) – The id where to find the data.

  • default (Any) – The default value if the data is not found

Returns

Url.GetHashCode()

Return the hashcode of an url.

Returns

The hashcode.

Return type

int

Url.IoCopyFile(dest, overwrite, removeReadOnly)

Copies a file to a different location, the path must exist otherwise the function returns an error.

Parameters
  • dest (maxon.Url) – Destination name for the copy operation.

  • overwrite (bool) – Set to True to allow overwriting destName file if it was already there.

  • removeReadOnly (bool) – Set to True to remove the read only flag on the newly created copy.

Url.IoCreateDirectory(createParents, createdDirs=None)

Creates a new directory. The function will return false if the directory already exists.

Parameters
  • createParents (bool) – Check if parent directory exists and if not create them recursively.

  • createdDirs (maxon.BaseArray [maxon.Url]) –

    An array that will contain all newly created subdirectories in the order in which they were created.
    If this parameter is None it will be ignored.

Returns

Url.IoDelete(force, recursive=False)

Deletes a file or directory physically on the medium.

Parameters
  • force (bool) – Set to True tries to deletes the file/directory even if the file/directory has read only flags set.

  • recursive (bool) – Recursively deletes a directory and its content. If a file is specified this value is ignored.

Url.IoDetect()

Detects the type of the object behind maxon.Url. This allows to check if a file or directory exists.

Returns

IODETECT of the given maxon.Url.

Return type

maxon.IODETECT

Url.IoGetAttributes()

Returns the file attributes of the object behind maxon.Url.

Returns

The file attribute.

Return type

maxon.IOATTRIBUTES

Url.IoGetTime(mode)

Returns the maxon.DateTime of the current file. The time is in local time.

Parameters

mode (maxon.IOTIMEMODE) – IOTIMEMODE of the requested time.

Returns

Returns the DateTime or an error.

Return type

maxon.UniversalDateTime

Url.IoMove(destName)
Moves a file or directory (including hierarchy) to a different location, the path must exist otherwise the function returns an error.
If the destName file or directory does already exist the function returns with an error.
Moving a file or directory on the same partition will perform without a temporary copy.
Parameters

destName (maxon.Url) – Destination name for the move operation.

Url.IoRename(newName)

Renames a file or directory. The newName must not be the name of an existing file or directory.

Parameters

newName (maxon.Url) – New name for the rename operation.

Url.OpenConnection()

Returns a reference to a maxon.IoConnectionInterface class of this Url.

Returns

The pointer to the maxon.IoConnectionInterface. Can be None.

Return type

maxon.IoConnectionRef

Url.OpenInputStream(flags=<OPENSTREAMFLAGS.NONE: 0>)

Returns a reference to a maxon.InputStreamInterface class of this maxon.Url.

Parameters

flags (See OPENSTREAMFLAGS for details.) – maxon.OPENSTREAMFLAGS

Returns

The reference to the maxon.InputStreamInterface. Can be None.

Return type

maxon.InputStreamRef

Url.OpenOutputStream(flags=<OPENSTREAMFLAGS.NONE: 0>)

Returns a reference to a maxon.OutputStreamInterface class of this maxon.Url.

Parameters

flags (See OPENSTREAMFLAGS for details.) – maxon.OPENSTREAMFLAGS

Returns

The reference to the maxon.OutputStreamInterface. Can be None.

Return type

maxon.OutputStreamRef

Url.__add__(s)

Appends a relative string or a maxon.Url to the current one.

Note

If the Url is file:///c:/directory a call of

url.Append(maxon.Url("test/file.txt"))

will result in file:///c:/directory/test/file.txt.

Parameters

s (Union[str, maxon.Url]) – String or maxon.Url to add to the current url.

Url.__hash__()

Returns the hash code of an Url.

Url.__init__(urlOrScheme=None, scheme=None, authority=None, path=None, name=None)
Creates and stores internally the reference of the C++ Data.

When the passed data is None, an empty data is still allocated.
Parameters

data (Optional[Data]) – An optional c++ data used to hold the C++ reference alive during the whole lifetime of this python object.

Url.__radd__(s)

Appends a relative string or a maxon.Url to the current one.

Note

If the Url is file:///c:/directory a call of

url.Append(maxon.Url("test/file.txt"))

will result in file:///c:/directory/test/file.txt.

Parameters

s (Union[str, maxon.Url]) – String or maxon.Url to add to the current url.

Url.__repr__()

Returns the string representation of an Url using the StringInterface.ToString method.

Return type

str

Url.__str__()

Returns the string representation of an Url using the StringInterface.ToString method.

Return type

str