mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
[412571] Truncate file when compare file in workspace by Remote System
Explorer
This commit is contained in:
parent
cf510d447e
commit
53f07d052c
1 changed files with 11 additions and 1 deletions
|
@ -51,6 +51,7 @@
|
||||||
* David McKnight (IBM) - [390609] Cached file opened twice in case of eclipse linked resource..
|
* David McKnight (IBM) - [390609] Cached file opened twice in case of eclipse linked resource..
|
||||||
* Xuan Chen (IBM) - [399101] RSE edit actions on local files that map to actually workspace resources should not use temp files
|
* Xuan Chen (IBM) - [399101] RSE edit actions on local files that map to actually workspace resources should not use temp files
|
||||||
* Xuan Chen (IBM) - [399752] Cannot download remote file due to scoping rule
|
* Xuan Chen (IBM) - [399752] Cannot download remote file due to scoping rule
|
||||||
|
* David McKnight (IBM) - [412571] Truncate file when compare file in workspace by Remote System Explorer
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.files.ui.resources;
|
package org.eclipse.rse.files.ui.resources;
|
||||||
|
@ -61,6 +62,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IResourceChangeEvent;
|
import org.eclipse.core.resources.IResourceChangeEvent;
|
||||||
import org.eclipse.core.resources.IResourceChangeListener;
|
import org.eclipse.core.resources.IResourceChangeListener;
|
||||||
|
@ -579,10 +581,18 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
|
||||||
*/
|
*/
|
||||||
public boolean download(IProgressMonitor monitor) throws Exception
|
public boolean download(IProgressMonitor monitor) throws Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
// DY: check if the file exists and is read-only (because it was previously opened
|
// DY: check if the file exists and is read-only (because it was previously opened
|
||||||
// in the system editor)
|
// in the system editor)
|
||||||
IFile file = getLocalResource();
|
IFile file = getLocalResource();
|
||||||
|
IProject rseTempFilesProject = SystemRemoteEditManager.getInstance().getRemoteEditProject();
|
||||||
|
|
||||||
|
// Don't download files that are not in temp files project.
|
||||||
|
// With bug 399101, local RSE files that map to workspace project files
|
||||||
|
// no longer get downloaded to the temp files project.
|
||||||
|
if (file.exists() && !file.getProject().equals(rseTempFilesProject)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
SystemIFileProperties properties = new SystemIFileProperties(file);
|
SystemIFileProperties properties = new SystemIFileProperties(file);
|
||||||
boolean newFile = !file.exists();
|
boolean newFile = !file.exists();
|
||||||
if (file.isReadOnly())
|
if (file.isReadOnly())
|
||||||
|
|
Loading…
Add table
Reference in a new issue