AbstractPath Class

Summary: An AbstractPath is a base class for classes that specify a unique location in an environment similar to a filesystem,
like a local filesystem, a remote file storage or a ZIP archive, among others.

Module: aspose.gis

Full Name: aspose.gis.AbstractPath

Aspose.PSD Version: 25.9.0

Properties

NameTypeAccessDescription
locationstringrGets a string representation of the location of this AbstractPath.
separatorcharrGets a separator character used to separate directory levels of the AbstractPath.location string.

Methods

NameDescription
combine(location)Combines this AbstractPath with specified path components.
delete()Deletes a file pointed to by this path.
from_local_path(path)Creates an AbstractPath that represents a location on the local filesystem.
from_stream(stream)Creates an AbstractPath from a stream.
get_extension()Returns the extension of this AbstractPath.
get_file_name()Returns the file name and extension of this AbstractPath.
get_file_name_without_extension()Returns the file name of this AbstractPath without the extension.
is_file()Gets a value indicating whether this path points to an existing file that can be opened for reading.
list_directory()Returns paths located inside this AbstractPath, if it’s a directory.
open(access)Opens this AbstractPath as a file.
with_extension(new_extension)Returns a new AbstractPath with the file extension changed to the specified value.

Method: combine(location)

 combine(location) 

Combines this AbstractPath with specified path components.

Parameters:

ParameterTypeDescription
locationstringA path component to append to this AbstractPath.

Returns

TypeDescription
AbstractPathA new AbstractPath pointing to a AbstractPath.location that is a combination of locations of this AbstractPath and
the argument.

Method: from_local_path(path) [static]

 from_local_path(path) 

Creates an AbstractPath that represents a location on the local filesystem.

Parameters:

ParameterTypeDescription
pathstringA path on the local filesystem, like “C:\file.shp” or “D:\directory\".

Returns

TypeDescription
AbstractPathAn AbstractPath that represents the location defined by the .

Method: from_stream(stream) [static]

 from_stream(stream) 

Creates an AbstractPath from a stream.

Parameters:

ParameterTypeDescription
stream_io.BufferedRandomA stream to create an AbstractPath from. Aspose.GIS does not dispose the stream.

Returns

TypeDescription
AbstractPathAn instance of AbstractPath with the specified stream as its content.

Method: get_extension()

 get_extension() 

Returns the extension of this AbstractPath.

Returns

TypeDescription
stringThe extension of this AbstractPath (including the period “.”) or
an empty string if the AbstractPath has no extension.

Method: get_file_name()

 get_file_name() 

Returns the file name and extension of this AbstractPath.

Returns

TypeDescription
stringThe characters after the last AbstractPath.separator character in the AbstractPath.location. If the
last character is the AbstractPath.separator character, an empty string is returned. If there is no
AbstractPath.separator characters in the AbstractPath.location, the AbstractPath.location itself
is returned.

Method: get_file_name_without_extension()

 get_file_name_without_extension() 

Returns the file name of this AbstractPath without the extension.

Returns

TypeDescription
stringThe string returned by AbstractPath.get_file_name() minus the last period and all characters following it.

Method: is_file()

 is_file() 

Gets a value indicating whether this path points to an existing file that can be opened for reading.

Returns

TypeDescription
boolif location points to a file; otherwise.

Method: list_directory()

 list_directory() 

Returns paths located inside this AbstractPath, if it’s a directory.

Returns

TypeDescription
System.Collections.Generic.IEnumerablePaths located inside this AbstractPath.

Method: open(access)

 open(access) 

Opens this AbstractPath as a file.

Parameters:

ParameterTypeDescription
accessSystem.IO.FileAccessSpecifies a subset of operations that can be performed on a stream.

Returns

TypeDescription
_io.BufferedRandomA stream opened with the specified FileAccess.

Method: with_extension(new_extension)

 with_extension(new_extension) 

Returns a new AbstractPath with the file extension changed to the specified value.

Parameters:

ParameterTypeDescription
new_extensionstringA new extension.

Returns

TypeDescription
AbstractPathA new AbstractPath, that points to a file in the same directory, but with a new extension.