mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 15:25:49 +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
|
* David McKnight (IBM) - [236723] UniversalFileTransferUtility..uploadResourcesFromWorkspace should query remote folder encoding
|
||||||
* Radoslav Gerganov (ProSyst) - [231428] [files] NPE on canceling copy operation from remote host
|
* 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) - [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;
|
package org.eclipse.rse.files.ui.resources;
|
||||||
|
@ -266,12 +267,9 @@ public class UniversalFileTransferUtility {
|
||||||
}
|
}
|
||||||
if (tempFile.exists())
|
if (tempFile.exists())
|
||||||
{
|
{
|
||||||
// if the file is virtual, set read only if necessary
|
// set the appropriate readonly flag
|
||||||
// TODO: why set this here? And why for virtual only??
|
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||||
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
setReadOnly(tempFile, readOnly);
|
||||||
{
|
|
||||||
setReadOnly(tempFile, srcFileOrFolder.canWrite());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (remoteEncoding != null)
|
if (remoteEncoding != null)
|
||||||
{
|
{
|
||||||
|
@ -577,12 +575,9 @@ public class UniversalFileTransferUtility {
|
||||||
{
|
{
|
||||||
if (tempFile.exists())
|
if (tempFile.exists())
|
||||||
{
|
{
|
||||||
// if the file is virtual, set read only if necessary
|
// set the appropriate readonly flag
|
||||||
// TODO: why set this here? And why for virtual only??
|
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||||
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
setReadOnly(tempFile, readOnly);
|
||||||
{
|
|
||||||
setReadOnly(tempFile, srcFileOrFolder.canWrite());
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -978,6 +973,10 @@ public class UniversalFileTransferUtility {
|
||||||
boolean shouldUseBin = RemoteFileUtility.getSystemFileTransferModeRegistry().isBinary(srcFileOrFolder);
|
boolean shouldUseBin = RemoteFileUtility.getSystemFileTransferModeRegistry().isBinary(srcFileOrFolder);
|
||||||
if (storedModifiedStamp == remoteModifiedStamp && (usedBin == shouldUseBin))
|
if (storedModifiedStamp == remoteModifiedStamp && (usedBin == shouldUseBin))
|
||||||
{
|
{
|
||||||
|
// set the appropriate readonly flag
|
||||||
|
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||||
|
setReadOnly(tempFile, readOnly);
|
||||||
|
|
||||||
return tempFile;
|
return tempFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1006,6 +1005,10 @@ public class UniversalFileTransferUtility {
|
||||||
}
|
}
|
||||||
if (tempFile.exists())
|
if (tempFile.exists())
|
||||||
{
|
{
|
||||||
|
// set the appropriate readonly flag
|
||||||
|
boolean readOnly = !srcFileOrFolder.canWrite();
|
||||||
|
setReadOnly(tempFile, readOnly);
|
||||||
|
|
||||||
if (RemoteFileUtility.getSystemFileTransferModeRegistry().isText(srcFileOrFolder))
|
if (RemoteFileUtility.getSystemFileTransferModeRegistry().isText(srcFileOrFolder))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Add table
Reference in a new issue