Deadline Scripting Reference  10.3.2.1
Deadline.Scripting.PathUtils Class Reference

Path utility functions. More...

Static Public Member Functions

static string ChangeFilename (string path, string filename)
 Changes the file name in the path. More...
 
static string EnsureTrailingPathSeparator (string path)
 Ensures the given path ends with the appropriate path separator for the current operating system. More...
 
static string GetApplicationPath (string applicationName)
 Searches the PATH environment variable to see if the specified application exists in any of the paths. More...
 
static string GetFullNetworkPath (string filePath)
 Returns the full Network Path of the given file by expanding mapped Network Drives to their full network Path, if applicable. More...
 
static string GetLocalApplicationDataPath ()
 Gets the local appliation data path for the current non-roaming user. More...
 
static string GetMappedDriveNetworkPath (string driveName)
 Gets the network path for the given drive. More...
 
static string GetSystemTempPath ()
 Returns the path of the current system's temporary folder. More...
 
static bool IsDriveMapped (string driveName)
 Checks if the given drive is mapped. More...
 
static bool IsPathLocal (string fileName)
 Simply checks if the root of the path is the C, D, or E drive. More...
 
static bool IsPathLocal (string fileName, string root)
 Check if the root of the given file matches the given root. More...
 
static bool IsPathLocal (string fileName, string[] roots)
 Check if the root of the given file matches any of the roots in the given array. More...
 
static bool IsPathRooted (string path)
 Checks if the given path is rooted or relative. More...
 
static bool IsPathUNC (string path)
 Checks if the given path is a UNC path. More...
 
static bool MapNetworkPath (string driveName, string remotePath, string username, string password, bool force)
 Maps a network path. More...
 
static bool RegisterFont (string fontFileName)
 Registers the given font (Windows only). More...
 
static bool RegisterFont (string fontFileName, int timeoutMilliseconds)
 Registers the given font (Windows only). More...
 
static bool RegisterFonts (string[] fontFileNames)
 Registers the given fonts (Windows only). More...
 
static bool RegisterFonts (string[] fontFileNames, int timeoutMilliseconds)
 Registers the given fonts (Windows only). More...
 
static string ToPlatformIndependentPath (string path)
 Replaces all path separators in the given path with the separators for the current operating system. More...
 
static string ToShortPathName (string path)
 Converts the given path to it's equivalent short path (Windows only). More...
 
static bool UnmapNetworkPath (string driveName, bool force)
 Unmaps a network drive. More...
 
static bool UnregisterFont (string fontFileName)
 Unregisters the given font (Windows only). More...
 
static bool UnregisterFont (string fontFileName, int timeoutMilliseconds)
 Unregisters the given font (Windows only). More...
 
static bool UnregisterFonts (string[] fontFileNames)
 Unregisters the given fonts (Windows only). More...
 
static bool UnregisterFonts (string[] fontFileNames, int timeoutMilliseconds)
 Unregisters the given fonts (Windows only). More...
 

Detailed Description

Path utility functions.

Member Function Documentation

◆ ChangeFilename()

static string Deadline.Scripting.PathUtils.ChangeFilename ( string  path,
string  filename 
)
static

Changes the file name in the path.

Parameters
pathThe original path, filename included.
filenameThe new file name.
Returns
The new path.

◆ EnsureTrailingPathSeparator()

static string Deadline.Scripting.PathUtils.EnsureTrailingPathSeparator ( string  path)
static

Ensures the given path ends with the appropriate path separator for the current operating system.

Parameters
pathThe path.
Returns
The path with a trailing path separator.

◆ GetApplicationPath()

static string Deadline.Scripting.PathUtils.GetApplicationPath ( string  applicationName)
static

Searches the PATH environment variable to see if the specified application exists in any of the paths.

Parameters
applicationNameThe application name.
Returns
The full path to the application if it exists, or "" if it doesn't.

◆ GetFullNetworkPath()

static string Deadline.Scripting.PathUtils.GetFullNetworkPath ( string  filePath)
static

Returns the full Network Path of the given file by expanding mapped Network Drives to their full network Path, if applicable.

Parameters
filePathThe File Path containing a Mapped Drive.
Returns
The expanded network path if applicable, or the unchanged filePath if it isn't a valid network path.

◆ GetLocalApplicationDataPath()

static string Deadline.Scripting.PathUtils.GetLocalApplicationDataPath ( )
static

Gets the local appliation data path for the current non-roaming user.

Returns
The local application data path.

◆ GetMappedDriveNetworkPath()

static string Deadline.Scripting.PathUtils.GetMappedDriveNetworkPath ( string  driveName)
static

Gets the network path for the given drive.

Parameters
driveNameThe drive.
Returns
The corresponding network path, or "" if the drive isn't mapped.

◆ GetSystemTempPath()

static string Deadline.Scripting.PathUtils.GetSystemTempPath ( )
static

Returns the path of the current system's temporary folder.

Returns
The temporary folder.

◆ IsDriveMapped()

static bool Deadline.Scripting.PathUtils.IsDriveMapped ( string  driveName)
static

Checks if the given drive is mapped.

Parameters
driveNameThe drive.
Returns
True if it is mapped.

◆ IsPathLocal() [1/3]

static bool Deadline.Scripting.PathUtils.IsPathLocal ( string  fileName)
static

Simply checks if the root of the path is the C, D, or E drive.

Parameters
fileNameThe file name.
Returns
True if the file is on the C, D, or E drive.

◆ IsPathLocal() [2/3]

static bool Deadline.Scripting.PathUtils.IsPathLocal ( string  fileName,
string  root 
)
static

Check if the root of the given file matches the given root.

Parameters
fileNameThe file name.
rootThe root to check.
Returns
True if the root of the given file matches the given root.

◆ IsPathLocal() [3/3]

static bool Deadline.Scripting.PathUtils.IsPathLocal ( string  fileName,
string[]  roots 
)
static

Check if the root of the given file matches any of the roots in the given array.

Parameters
fileNameThe file name.
rootsThe roots to check.
Returns
True if the root of the given file matches any of the given roots.

◆ IsPathRooted()

static bool Deadline.Scripting.PathUtils.IsPathRooted ( string  path)
static

Checks if the given path is rooted or relative.

Parameters
pathThe path.
Returns
True if the path is rooted.

◆ IsPathUNC()

static bool Deadline.Scripting.PathUtils.IsPathUNC ( string  path)
static

Checks if the given path is a UNC path.

Parameters
pathThe path.
Returns
True if the path is UNC.

◆ MapNetworkPath()

static bool Deadline.Scripting.PathUtils.MapNetworkPath ( string  driveName,
string  remotePath,
string  username,
string  password,
bool  force 
)
static

Maps a network path.

Parameters
driveNameThe drive.
remotePathThe remote path.
usernameThe username, can be null.
passwordThe password, can be null.
forceIf an existing mapped path to the local path should be disconnected first.
Returns
Returns True if successful.

◆ RegisterFont() [1/2]

static bool Deadline.Scripting.PathUtils.RegisterFont ( string  fontFileName)
static

Registers the given font (Windows only).

Parameters
fontFileNameThe font file name.
Returns
True if successful.

◆ RegisterFont() [2/2]

static bool Deadline.Scripting.PathUtils.RegisterFont ( string  fontFileName,
int  timeoutMilliseconds 
)
static

Registers the given font (Windows only).

Parameters
fontFileNameThe font file name.
timeoutMillisecondsThe number of milliseconds to wait per font when registering fonts.
Returns
True if successful.

◆ RegisterFonts() [1/2]

static bool Deadline.Scripting.PathUtils.RegisterFonts ( string[]  fontFileNames)
static

Registers the given fonts (Windows only).

Parameters
fontFileNamesThe font file names.
Returns
True if successful.

◆ RegisterFonts() [2/2]

static bool Deadline.Scripting.PathUtils.RegisterFonts ( string[]  fontFileNames,
int  timeoutMilliseconds 
)
static

Registers the given fonts (Windows only).

Parameters
fontFileNamesThe font file names.
timeoutMillisecondsThe number of milliseconds to wait per font when registering fonts.
Returns
True if successful.

◆ ToPlatformIndependentPath()

static string Deadline.Scripting.PathUtils.ToPlatformIndependentPath ( string  path)
static

Replaces all path separators in the given path with the separators for the current operating system.

Parameters
pathThe path.
Returns
The path with updated path separators.

◆ ToShortPathName()

static string Deadline.Scripting.PathUtils.ToShortPathName ( string  path)
static

Converts the given path to it's equivalent short path (Windows only).

Parameters
pathThe path.
Returns
A short representation of the path.

◆ UnmapNetworkPath()

static bool Deadline.Scripting.PathUtils.UnmapNetworkPath ( string  driveName,
bool  force 
)
static

Unmaps a network drive.

Parameters
driveNameThe drive.
forceSpecifies whether the disconnection should occur if there are open files or jobs on the connection. If this parameter is FALSE, the function fails if there are open files or jobs.
Returns
Returns True if successful.

◆ UnregisterFont() [1/2]

static bool Deadline.Scripting.PathUtils.UnregisterFont ( string  fontFileName)
static

Unregisters the given font (Windows only).

Parameters
fontFileNameThe font file name.
Returns
True if successful.

◆ UnregisterFont() [2/2]

static bool Deadline.Scripting.PathUtils.UnregisterFont ( string  fontFileName,
int  timeoutMilliseconds 
)
static

Unregisters the given font (Windows only).

Parameters
fontFileNameThe font file name.
timeoutMillisecondsThe number of milliseconds to wait per font when registering fonts.
Returns
True if successful.

◆ UnregisterFonts() [1/2]

static bool Deadline.Scripting.PathUtils.UnregisterFonts ( string[]  fontFileNames)
static

Unregisters the given fonts (Windows only).

Parameters
fontFileNamesThe font file names.
Returns
True if successful.

◆ UnregisterFonts() [2/2]

static bool Deadline.Scripting.PathUtils.UnregisterFonts ( string[]  fontFileNames,
int  timeoutMilliseconds 
)
static

Unregisters the given fonts (Windows only).

Parameters
fontFileNamesThe font file names.
timeoutMillisecondsThe number of milliseconds to wait per font when registering fonts.
Returns
True if successful.