1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-13 03:55:22 +02:00

[228743] [usability][dnd] Paste into read-only folder fails silently

This commit is contained in:
David McKnight 2010-11-25 16:34:10 +00:00
parent abe73a7152
commit 86c93fa076
2 changed files with 19 additions and 9 deletions

View file

@ -61,6 +61,7 @@
* David McKnight (IBM) - [299140] Local Readonly file can't be copied/pasted twice * David McKnight (IBM) - [299140] Local Readonly file can't be copied/pasted twice
* David McKnight (IBM) - [298440] jar files in a directory can't be pasted to another system properly * David McKnight (IBM) - [298440] jar files in a directory can't be pasted to another system properly
* David McKnight (IBM) - [311218] Content conflict dialog pops up when it should not * David McKnight (IBM) - [311218] Content conflict dialog pops up when it should not
* David McKnight (IBM) - [228743] [usability][dnd] Paste into read-only folder fails silently
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.files.ui.resources; package org.eclipse.rse.files.ui.resources;
@ -1537,7 +1538,7 @@ public class UniversalFileTransferUtility {
IRemoteFileSubSystem targetFS = targetFolder.getParentRemoteFileSubSystem(); IRemoteFileSubSystem targetFS = targetFolder.getParentRemoteFileSubSystem();
boolean isWindows = !targetFS.getParentRemoteFileSubSystemConfiguration().isUnixStyle();
boolean doSuperTransferPreference = doSuperTransfer(targetFS); boolean doSuperTransferPreference = doSuperTransfer(targetFS);
SystemRemoteResourceSet resultSet = new SystemRemoteResourceSet(targetFS); SystemRemoteResourceSet resultSet = new SystemRemoteResourceSet(targetFS);
@ -1552,7 +1553,7 @@ public class UniversalFileTransferUtility {
} }
} }
if (!targetFolder.canWrite()) if (!targetFolder.canWrite() && !isWindows) // windows check for bug 228743
{ {
String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; String msgTxt = FileResources.FILEMSG_SECURITY_ERROR;
String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName());

View file

@ -69,6 +69,7 @@
* David McKnight (IBM) - [317541] Show blank as the last modified for a file with no last modified * David McKnight (IBM) - [317541] Show blank as the last modified for a file with no last modified
* David McKnight (IBM) - [323299] [files] remote file view adapter needs to use the latest version of IRemoteFile * David McKnight (IBM) - [323299] [files] remote file view adapter needs to use the latest version of IRemoteFile
* David McKnight (IBM) - [324192] Cannot open a renamed file * David McKnight (IBM) - [324192] Cannot open a renamed file
* David McKnight (IBM) - [228743] [usability][dnd] Paste into read-only folder fails silently
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.files.ui.view; package org.eclipse.rse.internal.files.ui.view;
@ -1554,9 +1555,13 @@ public class SystemViewRemoteFileAdapter
if (element instanceof IRemoteFile) if (element instanceof IRemoteFile)
{ {
IRemoteFile file = (IRemoteFile) element; IRemoteFile file = (IRemoteFile) element;
boolean offline = file.getParentRemoteFileSubSystem().isOffline(); IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem();
boolean supportsArchiveManagement = file.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement(); IRemoteFileSubSystemConfiguration config = ss.getParentRemoteFileSubSystemConfiguration();
return !offline && file.canRead() && file.canWrite() && (file.isDirectory() || file.isRoot() || (file.isArchive() && supportsArchiveManagement)); boolean offline = ss.isOffline();
boolean isWindows = !config.isUnixStyle(); // windows check for bug 228743
boolean supportsArchiveManagement = config.supportsArchiveManagement();
return !offline && file.canRead() && (file.canWrite() || isWindows) && (file.isDirectory() || file.isRoot() || (file.isArchive() && supportsArchiveManagement));
} }
return false; return false;
@ -1574,10 +1579,12 @@ public class SystemViewRemoteFileAdapter
if (target instanceof IRemoteFile) if (target instanceof IRemoteFile)
{ {
IRemoteFile targetFile = (IRemoteFile) target; IRemoteFile targetFile = (IRemoteFile) target;
boolean supportsArchiveManagement = targetFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement(); IRemoteFileSubSystemConfiguration config = targetFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration();
boolean supportsArchiveManagement = config.supportsArchiveManagement();
if (!targetFile.isFile() || (targetFile.isArchive() && supportsArchiveManagement)) if (!targetFile.isFile() || (targetFile.isArchive() && supportsArchiveManagement))
{ {
targetFile.canWrite(); boolean isWindows = !config.isUnixStyle();
return targetFile.canWrite() || isWindows; // windows check for bug 228743
} }
// all objects are of same type, so we only need to use first to validate // all objects are of same type, so we only need to use first to validate
Object first = srcSet.get(0); Object first = srcSet.get(0);
@ -1615,7 +1622,8 @@ public class SystemViewRemoteFileAdapter
if (target instanceof IRemoteFile) if (target instanceof IRemoteFile)
{ {
IRemoteFile targetFile = (IRemoteFile) target; IRemoteFile targetFile = (IRemoteFile) target;
boolean supportsArchiveManagement = targetFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement(); IRemoteFileSubSystemConfiguration config = targetFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration();
boolean supportsArchiveManagement = config.supportsArchiveManagement();
if (!targetFile.isFile() || (targetFile.isArchive() && supportsArchiveManagement)) if (!targetFile.isFile() || (targetFile.isArchive() && supportsArchiveManagement))
{ {
// get properties // get properties
@ -2028,6 +2036,7 @@ public class SystemViewRemoteFileAdapter
{ {
IRemoteFile targetFolder = (IRemoteFile) target; IRemoteFile targetFolder = (IRemoteFile) target;
IRemoteFileSubSystem targetFS = targetFolder.getParentRemoteFileSubSystem(); IRemoteFileSubSystem targetFS = targetFolder.getParentRemoteFileSubSystem();
boolean isWindows = !targetFS.getParentRemoteFileSubSystemConfiguration().isUnixStyle();
// make sure properties are uptodate // make sure properties are uptodate
try try
@ -2039,7 +2048,7 @@ public class SystemViewRemoteFileAdapter
{ {
} }
if (!targetFolder.canWrite()) if (!targetFolder.canWrite() && !isWindows) // windows check for bug 228743
{ {
String msgTxt = FileResources.FILEMSG_SECURITY_ERROR; String msgTxt = FileResources.FILEMSG_SECURITY_ERROR;
String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName()); String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, targetFS.getHostAliasName());