Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 195285
Collapse All | Expand All

(-)src/org/eclipse/rse/files/ui/resources/ISystemMountPathMapper.java (-10 / +17 lines)
Lines 11-24 Link Here
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * 
12
 * 
13
 * Contributors:
13
 * Contributors:
14
 * {Name} (company) - description of contribution.
14
 * David McKnight   (IBM) - [195285] mount path mapper changes
15
 ********************************************************************************/
15
 ********************************************************************************/
16
16
17
package org.eclipse.rse.files.ui.resources;
17
package org.eclipse.rse.files.ui.resources;
18
18
19
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
20
19
/**
21
/**
20
 * This interface is used to provide a common way of mapping mounted resources to the temp files project.
22
 * This interface is used to provide a common way of mapping mounted resources to the temp files project.
21
 * Since local mounts can change or be removed (i.e. disconnected) this provides a way for a vender to
23
 * Since local (or remote) mounts can change or be removed (i.e. disconnected) this provides a way for a vender to
22
 * remap a particular resource if the vender software is able to determine the new mount location.
24
 * remap a particular resource if the vender software is able to determine the new mount location.
23
 * Implementors of this interface should register their mappers via the mountPathMapper extension point.
25
 * Implementors of this interface should register their mappers via the mountPathMapper extension point.
24
 */
26
 */
Lines 28-54 Link Here
28
	/**
30
	/**
29
	 * Indicates whether this mapper handles remapping of the specified resource
31
	 * Indicates whether this mapper handles remapping of the specified resource
30
	 * @param hostname the remote host
32
	 * @param hostname the remote host
31
	 * @param remotePath the remote path as seen by the local file subsystem
33
	 * @param remotePath the remote path as seen by the file subsystem
32
	 * @return whether this mapper handles remapping of the specified remote resource
34
	 * @return whether this mapper handles remapping of the specified remote resource
33
	 */
35
	 */
34
	public boolean handlesMappingFor(String hostname, String remotePath);
36
	public boolean handlesMappingFor(String hostname, String remotePath);
35
	
37
	
36
	/**
38
	/**
37
	 * Returns the qualified workspace path for a replica of this mounted file.  Since the local
39
	 * Returns the qualified workspace path for a replica of this mounted file.  Since the
38
	 * system path is not unique for mounted files, this allows a vender to make sure it is unique.
40
	 * system path is not unique for mounted files, this allows a vender to make sure it is unique.
39
	 * The workspace mapping should always be the remote path on the originating host.
41
	 * The workspace mapping should always be the remote path on the originating host.
40
	 * 
42
	 * 
41
	 * @param hostname the remote host
43
	 * @param hostname the remote host
42
	 * @param remotePath the remote path as seen by the local file subsystem
44
	 * @param remotePath the remote path as seen by the file subsystem
45
	 * @param the remote file subsystem.  User the subsystem to customize how the temp file is located.  If null
46
	 *        is specified, then the subsystem is not used in determining the mapping
43
     * @return the corresponding workspace replica mapping
47
     * @return the corresponding workspace replica mapping
44
	 */
48
	 */
45
	public String getWorkspaceMappingFor(String hostname, String remotePath);
49
	public String getWorkspaceMappingFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem);
50
	
46
	
51
	
47
	
52
	
48
	/**
53
	/**
49
	 * Returns the corresponding hostname for the specified path on the specified host.  If a file is mounted
54
	 * Returns the corresponding hostname for the specified path on the specified host.  If a file is mounted
50
	 * via local, then the actual host containing the file will not be local.  If there is no mapping, then
55
	 * then the actual host containing the file will not be local.  If there is no mapping, then
51
	 * the hostname will be the same as the argument.
56
	 * the hostname will be the same as the argument.  If the file is remote (i.e. not locally mounted) then
57
	 * this will retrun the same as the hostname argument.
58
	 * 
52
	 * @param hostname the system host
59
	 * @param hostname the system host
53
	 * @param remotePath the path on the system host
60
	 * @param remotePath the path on the system host
54
	 * @return the actual host that contains the specified remote path
61
	 * @return the actual host that contains the specified remote path
Lines 56-63 Link Here
56
	public String getActualHostFor(String hostname, String remotePath);
63
	public String getActualHostFor(String hostname, String remotePath);
57
	
64
	
58
	/**
65
	/**
59
	 * Returns the local system path that can be used for copying the replica back to remote. When null
66
	 * Returns the system path that can be used for copying the replica back to remote. When null
60
	 * is returned RSE the file is treated as no longer available and thus remote uploads do not occur.  Venders
67
	 * is returned RSE the file is treated as no longer available and thus remote uploads do not occur.  Vendors
61
	 * who would like to disable uploads for some period can implement this to return null during that period.
68
	 * who would like to disable uploads for some period can implement this to return null during that period.
62
	 * 
69
	 * 
63
	 * @param hostname the remote host
70
	 * @param hostname the remote host
(-)src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java (-11 / +13 lines)
Lines 28-33 Link Here
28
 * Xuan Chen (IBM)        - [202670] [Supertransfer] After doing a copy to a directory that contains folders some folders name's display "deleted"
28
 * Xuan Chen (IBM)        - [202670] [Supertransfer] After doing a copy to a directory that contains folders some folders name's display "deleted"
29
 * Xuan Chen (IBM)        - [202949] [archives] copy a folder from one connection to an archive file in a different connection does not work
29
 * Xuan Chen (IBM)        - [202949] [archives] copy a folder from one connection to an archive file in a different connection does not work
30
 * David McKnight   (IBM)        - [205819] Need to use input stream copy when EFS files are the src
30
 * David McKnight   (IBM)        - [205819] Need to use input stream copy when EFS files are the src
31
 * David McKnight   (IBM)        - [195285] mount path mapper changes
31
 ********************************************************************************/
32
 ********************************************************************************/
32
33
33
package org.eclipse.rse.files.ui.resources;
34
package org.eclipse.rse.files.ui.resources;
Lines 297-303 Link Here
297
		}
298
		}
298
	}
299
	}
299
	
300
	
300
	protected static void setIFileProperties(IFile tempFile, File remoteFile, String hostname)
301
	protected static void setIFileProperties(IFile tempFile, File remoteFile, String hostname, String userId)
301
	{
302
	{
302
		// set it's properties for use later
303
		// set it's properties for use later
303
		SystemIFileProperties properties = new SystemIFileProperties(tempFile);
304
		SystemIFileProperties properties = new SystemIFileProperties(tempFile);
Lines 322-329 Link Here
322
		properties.setRemoteFileMounted(isMounted);
323
		properties.setRemoteFileMounted(isMounted);
323
		if (isMounted)
324
		if (isMounted)
324
		{
325
		{
325
			String actualRemoteHost = getActualHostFor(hostname, remotePath);
326
			String actualRemoteHost = getActualHostFor(hostname, remotePath);						
326
			String actualRemotePath = getWorkspaceRemotePath(hostname, remotePath);
327
			String actualRemotePath = getWorkspaceRemotePath(hostname, remotePath, null); // no subsystem
327
			properties.setResolvedMountedRemoteFileHost(actualRemoteHost);
328
			properties.setResolvedMountedRemoteFileHost(actualRemoteHost);
328
			properties.setResolvedMountedRemoteFilePath(actualRemotePath);
329
			properties.setResolvedMountedRemoteFilePath(actualRemotePath);
329
		}
330
		}
Lines 554-560 Link Here
554
			{
555
			{
555
				try
556
				try
556
				{
557
				{
557
					setIFileProperties(tempFile, srcFileOrFolder, "LOCALHOST");		 //$NON-NLS-1$
558
					setIFileProperties(tempFile, srcFileOrFolder, "LOCALHOST", System.getProperty("user.name"));		 //$NON-NLS-1$ //$NON-NLS-2$
558
				}
559
				}
559
				catch (Exception e)
560
				catch (Exception e)
560
				{
561
				{
Lines 1860-1866 Link Here
1860
		
1861
		
1861
		if (srcFileOrFolder.getSystemConnection().getSystemType().isLocal())
1862
		if (srcFileOrFolder.getSystemConnection().getSystemType().isLocal())
1862
		{
1863
		{
1863
			absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath());
1864
			absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath(), srcFileOrFolder.getParentRemoteFileSubSystem());
1864
		}
1865
		}
1865
		
1866
		
1866
		IPath remote = new Path(absolutePath);
1867
		IPath remote = new Path(absolutePath);
Lines 1932-1938 Link Here
1932
		String actualHost = "LOCALHOST";	 //$NON-NLS-1$
1933
		String actualHost = "LOCALHOST";	 //$NON-NLS-1$
1933
		path = path.append(separator + actualHost + separator);
1934
		path = path.append(separator + actualHost + separator);
1934
1935
1935
		String absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath());
1936
		// this is only for local, so no remote name required
1937
		String absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath(), null); // no subsystem
1936
1938
1937
		int colonIndex = absolutePath.indexOf(IPath.DEVICE_SEPARATOR);
1939
		int colonIndex = absolutePath.indexOf(IPath.DEVICE_SEPARATOR);
1938
1940
Lines 2097-2113 Link Here
2097
		return false;	
2099
		return false;	
2098
	}
2100
	}
2099
	
2101
	
2100
	protected static String getWorkspaceRemotePath(ISubSystem subsystem, String remotePath) {
2102
	protected static String getWorkspaceRemotePath(IRemoteFileSubSystem subsystem, String remotePath) {
2101
		
2103
		
2102
		if (subsystem != null && subsystem.getHost().getSystemType().isLocal()) {
2104
		if (subsystem != null) {
2103
			return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath);
2105
			return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath, subsystem);
2104
		}
2106
		}
2105
		
2107
		
2106
		return remotePath;
2108
		return remotePath;
2107
	}
2109
	}
2108
	
2110
	
2109
	protected static String getWorkspaceRemotePath(String hostname, String remotePath) {
2111
	protected static String getWorkspaceRemotePath(String hostname, String remotePath, IRemoteFileSubSystem subsystem) {		
2110
		return SystemRemoteEditManager.getInstance().getWorkspacePathFor(hostname, remotePath);
2112
		return SystemRemoteEditManager.getInstance().getWorkspacePathFor(hostname, remotePath, subsystem);
2111
	}
2113
	}
2112
2114
2113
	protected static RenameStatus checkForCollision(SystemRemoteResourceSet existingFiles, IRemoteFile targetFolder, String oldName, String oldPath)
2115
	protected static RenameStatus checkForCollision(SystemRemoteResourceSet existingFiles, IRemoteFile targetFolder, String oldName, String oldPath)
(-)src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java (-1 / +2 lines)
Lines 18-23 Link Here
18
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
18
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
19
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
19
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
20
 * David McKnight   (IBM)        - [205297] Editor upload should not be on main thread
20
 * David McKnight   (IBM)        - [205297] Editor upload should not be on main thread
21
 * David McKnight   (IBM)        - [195285] mount path mapper changes
21
 ********************************************************************************/
22
 ********************************************************************************/
22
23
23
package org.eclipse.rse.files.ui.resources;
24
package org.eclipse.rse.files.ui.resources;
Lines 137-143 Link Here
137
			else
138
			else
138
			{
139
			{
139
				// for mounting...
140
				// for mounting...
140
				if (fs.getHost().getSystemType().isLocal())
141
				//if (fs.getHost().getSystemType().isLocal())
141
				{
142
				{
142
					boolean isMounted = properties.getRemoteFileMounted();
143
					boolean isMounted = properties.getRemoteFileMounted();
143
					if (isMounted)
144
					if (isMounted)
(-)src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java (-2 / +2 lines)
Lines 912-920 Link Here
912
	 */
912
	 */
913
	public String getWorkspaceRemotePath(String remotePath)
913
	public String getWorkspaceRemotePath(String remotePath)
914
	{
914
	{
915
		if (subsystem != null && subsystem.getHost().getSystemType().isLocal())
915
		if (subsystem != null)
916
		{
916
		{
917
			return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath);
917
			return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath, subsystem);
918
		}
918
		}
919
		return remotePath;
919
		return remotePath;
920
	}
920
	}
(-)src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java (-2 / +7 lines)
Lines 14-19 Link Here
14
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
14
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
16
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
16
 * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
17
 * David McKnight   (IBM) - [195285] mount path mapper changes
17
 ********************************************************************************/
18
 ********************************************************************************/
18
19
19
package org.eclipse.rse.internal.files.ui.resources;
20
package org.eclipse.rse.internal.files.ui.resources;
Lines 41-46 Link Here
41
import org.eclipse.rse.files.ui.resources.ISystemMountPathMapper;
42
import org.eclipse.rse.files.ui.resources.ISystemMountPathMapper;
42
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
43
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
43
import org.eclipse.rse.subsystems.files.core.SystemIFileProperties;
44
import org.eclipse.rse.subsystems.files.core.SystemIFileProperties;
45
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
44
import org.eclipse.rse.ui.RSEUIPlugin;
46
import org.eclipse.rse.ui.RSEUIPlugin;
45
import org.eclipse.rse.ui.SystemBasePlugin;
47
import org.eclipse.rse.ui.SystemBasePlugin;
46
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
48
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
Lines 113-118 Link Here
113
	 * Return the path to use on the system (i.e. Windows) for saving from the workspace to remote
115
	 * Return the path to use on the system (i.e. Windows) for saving from the workspace to remote
114
	 * @param hostname the remote host
116
	 * @param hostname the remote host
115
	 * @param remotePath the file path on the remote host
117
	 * @param remotePath the file path on the remote host
118
116
	 * @return the system path
119
	 * @return the system path
117
	 */
120
	 */
118
	public String getMountPathFor(String hostname, String remotePath)
121
	public String getMountPathFor(String hostname, String remotePath)
Lines 128-145 Link Here
128
		}
131
		}
129
	}
132
	}
130
	
133
	
134
	
131
	/**
135
	/**
132
	 * Return the path to use relative to the hostname in the RemoteSystemsTempFiles project for saving a local replica
136
	 * Return the path to use relative to the hostname in the RemoteSystemsTempFiles project for saving a local replica
133
	 * @param hostname the originating remote host
137
	 * @param hostname the originating remote host
134
	 * @param remotePath the file path on the system (i.e. Windows) 
138
	 * @param remotePath the file path on the system (i.e. Windows) 
139
	 * @param subSystem the remote subsystem.  The subsystem may be null if none is available. 
135
	 * @return the relative replica path
140
	 * @return the relative replica path
136
	 */
141
	 */
137
	public String getWorkspacePathFor(String hostname, String remotePath)
142
	public String getWorkspacePathFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem)
138
	{
143
	{
139
		ISystemMountPathMapper mapper = getMountPathMapperFor(hostname, remotePath);
144
		ISystemMountPathMapper mapper = getMountPathMapperFor(hostname, remotePath);
140
		if (mapper != null)
145
		if (mapper != null)
141
		{
146
		{
142
			return mapper.getWorkspaceMappingFor(hostname, remotePath);
147
			return mapper.getWorkspaceMappingFor(hostname, remotePath, subsystem);
143
		}
148
		}
144
		else
149
		else
145
		{
150
		{
(-)src/org/eclipse/rse/internal/files/ui/resources/DefaultMountPathMapper.java (-1 / +3 lines)
Lines 13-23 Link Here
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * {Name} (company) - description of contribution.
15
 * {Name} (company) - description of contribution.
16
 * David McKnight   (IBM) - [195285] mount path mapper changes
16
 *******************************************************************************/
17
 *******************************************************************************/
17
18
18
package org.eclipse.rse.internal.files.ui.resources;
19
package org.eclipse.rse.internal.files.ui.resources;
19
20
20
import org.eclipse.rse.files.ui.resources.ISystemMountPathMapper;
21
import org.eclipse.rse.files.ui.resources.ISystemMountPathMapper;
22
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
21
23
22
public class DefaultMountPathMapper implements ISystemMountPathMapper
24
public class DefaultMountPathMapper implements ISystemMountPathMapper
23
{
25
{
Lines 32-38 Link Here
32
		return hostname;
34
		return hostname;
33
	}
35
	}
34
	
36
	
35
	public String getWorkspaceMappingFor(String hostname, String remotePath)
37
	public String getWorkspaceMappingFor(String hostname, String remotePath, IRemoteFileSubSystem subSystem)
36
	{
38
	{
37
		return remotePath;
39
		return remotePath;
38
	}
40
	}

Return to bug 195285