Session.TranslateRemotePathToLocal Method

Generates a local path equivalent of a remote path, given root paths.

This method is deprecated since the current beta version. Use static method RemotePath.TranslateRemotePathToLocal instead.


public string TranslateRemotePathToLocal(
    string remotePath,
    string remoteRoot,
    string localRoot
Public Function TranslateRemotePathToLocal(
    remotePath As String,
    remoteRoot As String,
    localRoot As String
) As String


Name Description
string remotePath An absolute remote path to translate.
string remoteRoot An absolute path to a remote root folder that is an equivalent of the localRoot.
string localRoot An absolute path to a local root folder that is an equivalent of the remoteRoot.

Return Value

A local path equivalent of the remote path.


Exception Condition
InvalidOperationException The remotePath is not within remoteRoot.
ArgumentNullException Some of the arguments is null.


Basically replaces remoteRoot with localRoot in remotePath and converts all slashes (/) to backslashes (\).

It makes no difference if remoteRoot and localRoot end with slash (backslash) or not.

The method useful when enumerating remote files with Session.EnumerateRemoteFiles.

For an opposite operation, see Session.TranslateLocalPathToRemote.


Real-Life Example

Last modified: by martin