org.eclipse.rse.files.ui.resources
Interface ISystemMountPathMapper
-
public interface ISystemMountPathMapper
This interface is used to provide a common way of mapping mounted resources to the temp files project.
Since local (or remote) mounts can change or be removed (i.e. disconnected) this provides a way for a vendor to
remap a particular resource if the vendor software is able to determine the new mount location.
There are a number of use cases where a customized workspace mapping would be desirable:
- Two connections to the same host using different user IDs for each connection. In that case, it may make
sense to store the temp files differently for each connection (for example, qualified by user ID).
- If port-forwarding is used then a port could be used to qualify the temp file path.
- If the remote path contains invalid characters for the local file system, then the temp file mapping could
be made such that invalid characters ( e.g. :<>?* on Windows) translate to a sequence of valid characters on the client.
Implementors of this interface should register their mappers via the mountPathMappers extension point.
getWorkspaceMappingFor
String getWorkspaceMappingFor(
String hostname,
String remotePath,
IRemoteFileSubSystem subsystem)
- Returns the qualified workspace path for a replica of this mounted file. Since the
system path is not unique for mounted files, this allows a vendor to make sure it is unique.
The workspace mapping should always be the remote path on the originating host.
-
-
Parameters:
-
hostname
- the remote host -
remotePath
- the remote path as seen by the file subsystem -
subsystem
- the remote file subsystem. User the subsystem to customize how the temp file is located. If null
is specified, then the subsystem is not used in determining the mapping
-
Returns:
- the corresponding workspace replica mapping
-
Since:
- 3.0
getActualHostFor
String getActualHostFor(
String hostname,
String remotePath)
- Returns the corresponding hostname for the specified path on the specified host. If a file is mounted
then the actual host containing the file will not be local. If there is no mapping, then
the hostname will be the same as the argument. If the file is remote (i.e. not locally mounted) then
this will return the same as the hostname argument.
-
-
Parameters:
-
hostname
- the system host -
remotePath
- the path on the system host
-
Returns:
- the actual host that contains the specified remote path
getMountedMappingFor
String getMountedMappingFor(
String hostname,
String remotePath)
- Returns the system path that can be used for copying the replica back to remote. When null
is returned RSE the file is treated as no longer available and thus remote uploads do not occur. Vendors
who would like to disable uploads for some period can implement this to return null during that period.
-
-
Parameters:
-
hostname
- the remote host -
remotePath
- the remote path as seen by the local file subsystem
-
Returns:
- the local system path that represents the mounted file
handlesMappingFor
boolean handlesMappingFor(
String hostname,
String remotePath,
IRemoteFileSubSystem subsystem)
- Indicates whether this mapper handles remapping of the specified resource. If more than one mount
path mapper returns true for this, then the getPriority() method will be used to determine precedence.
-
-
Parameters:
-
hostname
- the remote host -
remotePath
- the remote path as seen by the file subsystem -
subsystem
- the remote file subsystem
-
Returns:
- whether this mapper handles remapping of the specified remote resource
-
Since:
- 3.0
getPriority
int getPriority(
String hostname,
String remotePath,
IRemoteFileSubSystem subsystem)
- Returns the priority of this mount path mapper. This is used to determine which mount
path mapper to use when more than one are applicable. The lower the return value, the
higher priority.
-
-
Parameters:
-
hostname
- the host name for the file system -
remotePath
- the path on the remote file system -
subsystem
- the subsystem used to retrieve files
-
Returns:
- the priority, where the lower in value, the higher the priority.
-
Since:
- 3.0
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.