### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.files.ui Index: src/org/eclipse/rse/internal/files/ui/FileResources.properties =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties,v retrieving revision 1.30 diff -u -r1.30 FileResources.properties --- src/org/eclipse/rse/internal/files/ui/FileResources.properties 11 Nov 2008 02:08:28 -0000 1.30 +++ src/org/eclipse/rse/internal/files/ui/FileResources.properties 12 Jan 2009 15:48:50 -0000 @@ -24,6 +24,7 @@ # Rupen Mardirossian (IBM) - [227213] Added RESID_CONFLICT_COPY_PATTERN to be used for copying resources to parent folder. # David Dykstal (IBM) [231841] Correcting messages for folder creation # Kevin Doyle (IBM) - [242389] [usability] RSE Save Conflict dialog should indicate which file is in conflict +# David McKnight (IBM) - [245260] Different user's connections on a single host are mapped to the same temp files cache ############################################################################### # NLS_MESSAGEFORMAT_VAR @@ -80,6 +81,8 @@ RESID_PREF_UNIVERSAL_PRESERVE_TIMESTAMPS_LABEL=Copy timestamps during file transfer +RESID_PREF_UNIVERSAL_SHARE_CACHED_FILES_LABEL=Share cached files between different connections to the same host + RESID_PREF_UNIVERSAL_FILES_FILETYPES_TYPE_LABEL=File types: RESID_PREF_UNIVERSAL_FILES_FILETYPES_TYPE_TOOLTIP=List of file types Index: src/org/eclipse/rse/internal/files/ui/FileResources.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java,v retrieving revision 1.23 diff -u -r1.23 FileResources.java --- src/org/eclipse/rse/internal/files/ui/FileResources.java 20 May 2008 12:12:50 -0000 1.23 +++ src/org/eclipse/rse/internal/files/ui/FileResources.java 12 Jan 2009 15:48:49 -0000 @@ -22,6 +22,7 @@ * David McKnight (IBM) - [224377] "open with" menu does not have "other" option * Rupen Mardirossian (IBM) - [227213] Added RESID_CONFLICT_COPY_PATTERN to be used for copying resources to parent folder. * David Dykstal (IBM) [231841] Correcting messages for folder creation + * David McKnight (IBM) - [245260] Different user's connections on a single host are mapped to the same temp files cache *******************************************************************************/ package org.eclipse.rse.internal.files.ui; @@ -82,6 +83,8 @@ public static String RESID_PREF_UNIVERSAL_SHOWHIDDEN_LABEL; public static String RESID_PREF_UNIVERSAL_PRESERVE_TIMESTAMPS_LABEL; + + public static String RESID_PREF_UNIVERSAL_SHARE_CACHED_FILES_LABEL; public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_TYPE_LABEL; public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_TYPE_TOOLTIP; Index: src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java,v retrieving revision 1.17 diff -u -r1.17 UniversalPreferencePage.java --- src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java 19 Mar 2008 16:08:46 -0000 1.17 +++ src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java 12 Jan 2009 15:48:50 -0000 @@ -19,6 +19,7 @@ * Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared * David McKnight (IBM) - [223204] [cleanup] fix broken nls strings in files.ui and others + * David McKnight (IBM) - [245260] Different user's connections on a single host are mapped to the same temp files cache ********************************************************************************/ package org.eclipse.rse.internal.files.ui.propertypages; @@ -299,6 +300,16 @@ store.setDefault(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS, true); + // field to indicate whether or not to share cached files between different connections + // to the same remote host + BooleanFieldEditor shareCachedFiles = new BooleanFieldEditor ( + ISystemFilePreferencesConstants.SHARECACHEDFILES, + FileResources.RESID_PREF_UNIVERSAL_SHARE_CACHED_FILES_LABEL, + propertiesComposite); + + addField(shareCachedFiles); + + store.setDefault(ISystemFilePreferencesConstants.SHARECACHEDFILES, ISystemFilePreferencesConstants.DEFAULT_SHARECACHEDFILES); // download and upload buffer size Group transferGroup = new Group(parent, SWT.NULL); @@ -418,6 +429,7 @@ { store.setDefault(ISystemFilePreferencesConstants.SHOWHIDDEN, false); store.setDefault(ISystemFilePreferencesConstants.PRESERVETIMESTAMPS, ISystemFilePreferencesConstants.DEFAULT_PRESERVETIMESTAMPS); + store.setDefault(ISystemFilePreferencesConstants.SHARECACHEDFILES, ISystemFilePreferencesConstants.DEFAULT_SHARECACHEDFILES); store.setDefault(ISystemFilePreferencesConstants.DOSUPERTRANSFER, ISystemFilePreferencesConstants.DEFAULT_DOSUPERTRANSFER); store.setDefault(ISystemFilePreferencesConstants.SUPERTRANSFER_ARC_TYPE, ISystemFilePreferencesConstants.DEFAULT_SUPERTRANSFER_ARCHIVE_TYPE); store.setDefault(ISystemFilePreferencesConstants.DOWNLOAD_BUFFER_SIZE, ISystemFilePreferencesConstants.DEFAULT_DOWNLOAD_BUFFER_SIZE); 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.13 diff -u -r1.13 SystemRemoteEditManager.java --- src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java 3 Nov 2008 19:55:52 -0000 1.13 +++ src/org/eclipse/rse/internal/files/ui/resources/SystemRemoteEditManager.java 12 Jan 2009 15:48:50 -0000 @@ -18,6 +18,7 @@ * David McKnight (IBM) - [195285] mount path mapper changes * David McKnight (IBM) - [228343] RSE unable to recover after RemoteSystemsTempfiles deletion * David McKnight (IBM) - [253262] Cache Cleanup is removing .settings directory + * David McKnight (IBM) - [245260] Different user's connections on a single host are mapped to the same temp files cache *******************************************************************************/ package org.eclipse.rse.internal.files.ui.resources; @@ -151,6 +152,7 @@ public String getWorkspacePathFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem) { ISystemMountPathMapper mapper = getMountPathMapperFor(hostname, remotePath, subsystem); + if (mapper != null) { return mapper.getWorkspaceMappingFor(hostname, remotePath, subsystem); @@ -189,6 +191,12 @@ } } } + + // no result - fall back to the default + if (result == null){ + return new DefaultMountPathMapper(); + } + return result; } 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.4 diff -u -r1.4 DefaultMountPathMapper.java --- src/org/eclipse/rse/internal/files/ui/resources/DefaultMountPathMapper.java 13 Dec 2007 16:10:12 -0000 1.4 +++ src/org/eclipse/rse/internal/files/ui/resources/DefaultMountPathMapper.java 12 Jan 2009 15:48:50 -0000 @@ -14,12 +14,18 @@ * Contributors: * {Name} (company) - description of contribution. * David McKnight (IBM) - [195285] mount path mapper changes + * David McKnight (IBM) - [245260] Different user's connections on a single host are mapped to the same temp files cache *******************************************************************************/ package org.eclipse.rse.internal.files.ui.resources; +import java.io.File; + +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.rse.files.ui.resources.ISystemMountPathMapper; +import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; +import org.eclipse.rse.ui.RSEUIPlugin; public class DefaultMountPathMapper implements ISystemMountPathMapper { @@ -36,7 +42,18 @@ public String getWorkspaceMappingFor(String hostname, String remotePath, IRemoteFileSubSystem subSystem) { - return remotePath; + IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore(); + boolean shareCachedFiles = store.getBoolean(ISystemFilePreferencesConstants.SHARECACHEDFILES); + + // if we're not sharing cached files, then we need a unique path for each connection + if (!shareCachedFiles){ + // prefix with the connection alias + String alias = subSystem.getHostAliasName(); + return alias + File.separatorChar + remotePath; + } + else { + return remotePath; + } } /** #P org.eclipse.rse.subsystems.files.core Index: src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java,v retrieving revision 1.6 diff -u -r1.6 ISystemFilePreferencesConstants.java --- src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java 12 Sep 2007 22:34:39 -0000 1.6 +++ src/org/eclipse/rse/internal/subsystems/files/core/ISystemFilePreferencesConstants.java 12 Jan 2009 15:48:51 -0000 @@ -16,6 +16,7 @@ * David McKnight (IBM) - [191367] setting supertransfer to be disabled by default * Xuan Chen (IBM) - [191367] setting supertransfer back to enabled by default * Xuan Chen (IBM) - [202686] Supertransfer should be disabled by default for 2.0.1 + * David McKnight (IBM) - [245260] Different user's connections on a single host are mapped to the same temp files cache *******************************************************************************/ package org.eclipse.rse.internal.subsystems.files.core; @@ -31,6 +32,8 @@ public static final String PRESERVETIMESTAMPS = ROOT + "preservetimestamps"; //$NON-NLS-1$ + public static final String SHARECACHEDFILES = ROOT + "sharecachedfiles";//$NON-NLS-1$ + public static final String LIMIT_CACHE = ROOT + "limit.cache"; //$NON-NLS-1$ public static final String MAX_CACHE_SIZE = ROOT + "max.cache.size"; //$NON-NLS-1$ @@ -42,6 +45,7 @@ public static final boolean DEFAULT_SHOW_HIDDEN = true; public static final boolean DEFAULT_PRESERVETIMESTAMPS = true; + public static final boolean DEFAULT_SHARECACHEDFILES = true; public static final int DEFAULT_FILETRANSFERMODE = 0; public static final int FILETRANSFERMODE_BINARY = 0;