Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 80671 Details for
Bug 195285
[api][breaking] mountPathMapper extension point should be more general than local
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
changes to mount path mapper extension point
patch.txt (text/plain), 15.27 KB, created by
David McKnight
on 2007-10-18 11:24:20 EDT
(
hide
)
Description:
changes to mount path mapper extension point
Filename:
MIME Type:
Creator:
David McKnight
Created:
2007-10-18 11:24:20 EDT
Size:
15.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.files.ui >Index: src/org/eclipse/rse/files/ui/resources/ISystemMountPathMapper.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/ISystemMountPathMapper.java,v >retrieving revision 1.1 >diff -u -r1.1 ISystemMountPathMapper.java >--- src/org/eclipse/rse/files/ui/resources/ISystemMountPathMapper.java 10 Apr 2006 20:11:03 -0000 1.1 >+++ src/org/eclipse/rse/files/ui/resources/ISystemMountPathMapper.java 18 Oct 2007 15:23:59 -0000 >@@ -11,14 +11,16 @@ > * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. > * > * Contributors: >- * {Name} (company) - description of contribution. >+ * David McKnight (IBM) - [195285] mount path mapper changes > ********************************************************************************/ > > package org.eclipse.rse.files.ui.resources; > >+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; >+ > /** > * This interface is used to provide a common way of mapping mounted resources to the temp files project. >- * Since local mounts can change or be removed (i.e. disconnected) this provides a way for a vender to >+ * Since local (or remote) mounts can change or be removed (i.e. disconnected) this provides a way for a vender to > * remap a particular resource if the vender software is able to determine the new mount location. > * Implementors of this interface should register their mappers via the mountPathMapper extension point. > */ >@@ -28,27 +30,32 @@ > /** > * Indicates whether this mapper handles remapping of the specified resource > * @param hostname the remote host >- * @param remotePath the remote path as seen by the local file subsystem >+ * @param remotePath the remote path as seen by the file subsystem > * @return whether this mapper handles remapping of the specified remote resource > */ > public boolean handlesMappingFor(String hostname, String remotePath); > > /** >- * Returns the qualified workspace path for a replica of this mounted file. Since the local >+ * 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 vender to make sure it is unique. > * The workspace mapping should always be the remote path on the originating host. > * > * @param hostname the remote host >- * @param remotePath the remote path as seen by the local file subsystem >+ * @param remotePath the remote path as seen by the file subsystem >+ * @param 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 > * @return the corresponding workspace replica mapping > */ >- public String getWorkspaceMappingFor(String hostname, String remotePath); >+ public String getWorkspaceMappingFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem); >+ > > > /** > * Returns the corresponding hostname for the specified path on the specified host. If a file is mounted >- * via local, 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. >+ * 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 retrun the same as the hostname argument. >+ * > * @param hostname the system host > * @param remotePath the path on the system host > * @return the actual host that contains the specified remote path >@@ -56,8 +63,8 @@ > public String getActualHostFor(String hostname, String remotePath); > > /** >- * Returns the local 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. Venders >+ * 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. > * > * @param hostname the remote host >Index: src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java,v >retrieving revision 1.58 >diff -u -r1.58 UniversalFileTransferUtility.java >--- src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java 10 Oct 2007 19:20:08 -0000 1.58 >+++ src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java 18 Oct 2007 15:24:01 -0000 >@@ -28,6 +28,7 @@ > * Xuan Chen (IBM) - [202670] [Supertransfer] After doing a copy to a directory that contains folders some folders name's display "deleted" > * Xuan Chen (IBM) - [202949] [archives] copy a folder from one connection to an archive file in a different connection does not work > * David McKnight (IBM) - [205819] Need to use input stream copy when EFS files are the src >+ * David McKnight (IBM) - [195285] mount path mapper changes > ********************************************************************************/ > > package org.eclipse.rse.files.ui.resources; >@@ -297,7 +298,7 @@ > } > } > >- protected static void setIFileProperties(IFile tempFile, File remoteFile, String hostname) >+ protected static void setIFileProperties(IFile tempFile, File remoteFile, String hostname, String userId) > { > // set it's properties for use later > SystemIFileProperties properties = new SystemIFileProperties(tempFile); >@@ -322,8 +323,8 @@ > properties.setRemoteFileMounted(isMounted); > if (isMounted) > { >- String actualRemoteHost = getActualHostFor(hostname, remotePath); >- String actualRemotePath = getWorkspaceRemotePath(hostname, remotePath); >+ String actualRemoteHost = getActualHostFor(hostname, remotePath); >+ String actualRemotePath = getWorkspaceRemotePath(hostname, remotePath, null); // no subsystem > properties.setResolvedMountedRemoteFileHost(actualRemoteHost); > properties.setResolvedMountedRemoteFilePath(actualRemotePath); > } >@@ -554,7 +555,7 @@ > { > try > { >- setIFileProperties(tempFile, srcFileOrFolder, "LOCALHOST"); //$NON-NLS-1$ >+ setIFileProperties(tempFile, srcFileOrFolder, "LOCALHOST", System.getProperty("user.name")); //$NON-NLS-1$ //$NON-NLS-2$ > } > catch (Exception e) > { >@@ -1860,7 +1861,7 @@ > > if (srcFileOrFolder.getSystemConnection().getSystemType().isLocal()) > { >- absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath()); >+ absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath(), srcFileOrFolder.getParentRemoteFileSubSystem()); > } > > IPath remote = new Path(absolutePath); >@@ -1932,7 +1933,8 @@ > String actualHost = "LOCALHOST"; //$NON-NLS-1$ > path = path.append(separator + actualHost + separator); > >- String absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath()); >+ // this is only for local, so no remote name required >+ String absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath(), null); // no subsystem > > int colonIndex = absolutePath.indexOf(IPath.DEVICE_SEPARATOR); > >@@ -2097,17 +2099,17 @@ > return false; > } > >- protected static String getWorkspaceRemotePath(ISubSystem subsystem, String remotePath) { >+ protected static String getWorkspaceRemotePath(IRemoteFileSubSystem subsystem, String remotePath) { > >- if (subsystem != null && subsystem.getHost().getSystemType().isLocal()) { >- return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath); >+ if (subsystem != null) { >+ return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath, subsystem); > } > > return remotePath; > } > >- protected static String getWorkspaceRemotePath(String hostname, String remotePath) { >- return SystemRemoteEditManager.getInstance().getWorkspacePathFor(hostname, remotePath); >+ protected static String getWorkspaceRemotePath(String hostname, String remotePath, IRemoteFileSubSystem subsystem) { >+ return SystemRemoteEditManager.getInstance().getWorkspacePathFor(hostname, remotePath, subsystem); > } > > protected static RenameStatus checkForCollision(SystemRemoteResourceSet existingFiles, IRemoteFile targetFolder, String oldName, String oldPath) >Index: src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java,v >retrieving revision 1.22 >diff -u -r1.22 SystemUniversalTempFileListener.java >--- src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java 5 Oct 2007 18:39:36 -0000 1.22 >+++ src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java 18 Oct 2007 15:24:00 -0000 >@@ -18,6 +18,7 @@ > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry > * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core > * David McKnight (IBM) - [205297] Editor upload should not be on main thread >+ * David McKnight (IBM) - [195285] mount path mapper changes > ********************************************************************************/ > > package org.eclipse.rse.files.ui.resources; >@@ -137,7 +138,7 @@ > else > { > // for mounting... >- if (fs.getHost().getSystemType().isLocal()) >+ //if (fs.getHost().getSystemType().isLocal()) > { > boolean isMounted = properties.getRemoteFileMounted(); > if (isMounted) >Index: src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java,v >retrieving revision 1.39 >diff -u -r1.39 SystemEditableRemoteFile.java >--- src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java 18 Oct 2007 13:44:56 -0000 1.39 >+++ src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java 18 Oct 2007 15:24:00 -0000 >@@ -912,9 +912,9 @@ > */ > public String getWorkspaceRemotePath(String remotePath) > { >- if (subsystem != null && subsystem.getHost().getSystemType().isLocal()) >+ if (subsystem != null) > { >- return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath); >+ return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath, subsystem); > } > return remotePath; > } >Index: src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java,v >retrieving revision 1.7 >diff -u -r1.7 SystemRemoteEditManager.java >--- src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java 25 May 2007 13:07:18 -0000 1.7 >+++ src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java 18 Oct 2007 15:24:01 -0000 >@@ -14,6 +14,7 @@ > * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry > * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core >+ * David McKnight (IBM) - [195285] mount path mapper changes > ********************************************************************************/ > > package org.eclipse.rse.internal.files.ui.resources; >@@ -41,6 +42,7 @@ > import org.eclipse.rse.files.ui.resources.ISystemMountPathMapper; > import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants; > import org.eclipse.rse.subsystems.files.core.SystemIFileProperties; >+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; > import org.eclipse.rse.ui.RSEUIPlugin; > import org.eclipse.rse.ui.SystemBasePlugin; > import org.eclipse.rse.ui.view.ISystemEditableRemoteObject; >@@ -113,6 +115,7 @@ > * Return the path to use on the system (i.e. Windows) for saving from the workspace to remote > * @param hostname the remote host > * @param remotePath the file path on the remote host >+ > * @return the system path > */ > public String getMountPathFor(String hostname, String remotePath) >@@ -128,18 +131,20 @@ > } > } > >+ > /** > * Return the path to use relative to the hostname in the RemoteSystemsTempFiles project for saving a local replica > * @param hostname the originating remote host > * @param remotePath the file path on the system (i.e. Windows) >+ * @param subSystem the remote subsystem. The subsystem may be null if none is available. > * @return the relative replica path > */ >- public String getWorkspacePathFor(String hostname, String remotePath) >+ public String getWorkspacePathFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem) > { > ISystemMountPathMapper mapper = getMountPathMapperFor(hostname, remotePath); > if (mapper != null) > { >- return mapper.getWorkspaceMappingFor(hostname, remotePath); >+ return mapper.getWorkspaceMappingFor(hostname, remotePath, subsystem); > } > else > { >Index: src/org/eclipse/rse/internal/files/ui/resources/DefaultMountPathMapper.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/resources/DefaultMountPathMapper.java,v >retrieving revision 1.2 >diff -u -r1.2 DefaultMountPathMapper.java >--- src/org/eclipse/rse/internal/files/ui/resources/DefaultMountPathMapper.java 5 Jun 2007 10:54:41 -0000 1.2 >+++ src/org/eclipse/rse/internal/files/ui/resources/DefaultMountPathMapper.java 18 Oct 2007 15:24:01 -0000 >@@ -13,11 +13,13 @@ > * > * Contributors: > * {Name} (company) - description of contribution. >+ * David McKnight (IBM) - [195285] mount path mapper changes > *******************************************************************************/ > > package org.eclipse.rse.internal.files.ui.resources; > > import org.eclipse.rse.files.ui.resources.ISystemMountPathMapper; >+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; > > public class DefaultMountPathMapper implements ISystemMountPathMapper > { >@@ -32,7 +34,7 @@ > return hostname; > } > >- public String getWorkspaceMappingFor(String hostname, String remotePath) >+ public String getWorkspaceMappingFor(String hostname, String remotePath, IRemoteFileSubSystem subSystem) > { > return remotePath; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 195285
: 80671