mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
[271831] Set the readonly file attribute when download the file
This commit is contained in:
parent
d524000937
commit
1e29d7ac84
1 changed files with 16 additions and 13 deletions
|
@ -52,6 +52,7 @@
|
|||
* David McKnight (IBM) - [236723] UniversalFileTransferUtility..uploadResourcesFromWorkspace should query remote folder encoding
|
||||
* Radoslav Gerganov (ProSyst) - [231428] [files] NPE on canceling copy operation from remote host
|
||||
* David McKnight (IBM) - [262092] Special characters are missing when pasting a file on a different connection
|
||||
* David McKnight (IBM) - [271831] Set the readonly file attribute when download the file
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.files.ui.resources;
|
||||
|
@ -266,12 +267,9 @@ public class UniversalFileTransferUtility {
|
|||
}
|
||||
if (tempFile.exists())
|
||||
{
|
||||
// if the file is virtual, set read only if necessary
|
||||
// TODO: why set this here? And why for virtual only??
|
||||
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
||||
{
|
||||
setReadOnly(tempFile, srcFileOrFolder.canWrite());
|
||||
}
|
||||
// set the appropriate readonly flag
|
||||
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||
setReadOnly(tempFile, readOnly);
|
||||
|
||||
if (remoteEncoding != null)
|
||||
{
|
||||
|
@ -577,13 +575,10 @@ public class UniversalFileTransferUtility {
|
|||
{
|
||||
if (tempFile.exists())
|
||||
{
|
||||
// if the file is virtual, set read only if necessary
|
||||
// TODO: why set this here? And why for virtual only??
|
||||
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
||||
{
|
||||
setReadOnly(tempFile, srcFileOrFolder.canWrite());
|
||||
}
|
||||
|
||||
// set the appropriate readonly flag
|
||||
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||
setReadOnly(tempFile, readOnly);
|
||||
|
||||
try
|
||||
{
|
||||
if (remoteEncoding != null)
|
||||
|
@ -978,6 +973,10 @@ public class UniversalFileTransferUtility {
|
|||
boolean shouldUseBin = RemoteFileUtility.getSystemFileTransferModeRegistry().isBinary(srcFileOrFolder);
|
||||
if (storedModifiedStamp == remoteModifiedStamp && (usedBin == shouldUseBin))
|
||||
{
|
||||
// set the appropriate readonly flag
|
||||
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||
setReadOnly(tempFile, readOnly);
|
||||
|
||||
return tempFile;
|
||||
}
|
||||
}
|
||||
|
@ -1006,6 +1005,10 @@ public class UniversalFileTransferUtility {
|
|||
}
|
||||
if (tempFile.exists())
|
||||
{
|
||||
// set the appropriate readonly flag
|
||||
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||
setReadOnly(tempFile, readOnly);
|
||||
|
||||
if (RemoteFileUtility.getSystemFileTransferModeRegistry().isText(srcFileOrFolder))
|
||||
{
|
||||
try
|
||||
|
|
Loading…
Add table
Reference in a new issue