From 97b069a9ecc1f53b5f2c929ed14ac1c001bcc8da Mon Sep 17 00:00:00 2001 From: Xuan Chen Date: Wed, 2 Jan 2008 15:22:17 +0000 Subject: [PATCH] [210816] fix: Archive testcases throw ResourceException if they are run in batch --- .../ui/resources/SystemEditableRemoteFile.java | 5 +++++ .../ui/resources/UniversalFileTransferUtility.java | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java index 1f9f58ef249..0e79cc28d52 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java @@ -23,6 +23,7 @@ * David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect() * David McKnight (IBM) - [209660] check for changed encoding before using cached file * David McKnight (IBM) - [210812] for text transfer, need to tell editor to use local encoding + * Xuan Chen (IBM) - [210816] Archive testcases throw ResourceException if they are run in batch ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -1484,6 +1485,10 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP if (encoding != null) { if (remoteFile.isBinary()){ + if (!file.isSynchronized(IResource.DEPTH_ZERO)) + { + file.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/); + } if (!file.getCharset().equals(encoding)) { file.setCharset(encoding, null); diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java index 7716ba23ff4..7e9f224cb12 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/UniversalFileTransferUtility.java @@ -38,6 +38,7 @@ * David McKnight (IBM) - [209552] get rid of copy APIs to be clearer with download and upload * David McKnight (IBM) - [143503] encoding and isBinary needs to be stored in the IFile properties * Xuan Chen (IBM) - [191370] [dstore] Supertransfer zip not deleted when cancelling copy + * Xuan Chen (IBM) - [210816] Archive testcases throw ResourceException if they are run in batch ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -246,6 +247,10 @@ public class UniversalFileTransferUtility { try { + if (!tempFile.isSynchronized(IResource.DEPTH_ZERO)) + { + tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/); + } String cset = tempFile.getCharset(); if (!cset.equals(remoteEncoding)) { @@ -517,6 +522,10 @@ public class UniversalFileTransferUtility { try { + if (!tempFile.isSynchronized(IResource.DEPTH_ZERO)) + { + tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/); + } String cset = tempFile.getCharset(); if (!cset.equals(remoteEncoding)) { @@ -843,6 +852,10 @@ public class UniversalFileTransferUtility { try { + if (!tempFile.isSynchronized(IResource.DEPTH_ZERO)) + { + tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/); + } String cset = tempFile.getCharset(); if (!cset.equals(encoding)) {