From 9a58014bc69ac06d390cd34ea1ce0577ce10abda Mon Sep 17 00:00:00 2001 From: David McKnight Date: Thu, 10 Mar 2011 16:34:00 +0000 Subject: [PATCH] [339548] [dstore] shouldn't attempt file conversion on empty files --- .../internal/services/dstore/files/DStoreFileService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java index a77653c0b84..efda4770d30 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 IBM Corporation and others. + * Copyright (c) 2006, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,6 +63,7 @@ * David McKnight (IBM) - [284420] nullprogressmonitor is needed * David McKnight (IBM) - [298440] jar files in a directory can't be pasted to another system properly * David McKnight (IBM) - [308770] [dstore] Remote Search using old server fails with NPE + * David McKnight (IBM) - [339548] [dstore] shouldn't attempt file conversion on empty files *******************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -838,7 +839,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_SUCCESS_TYPE)) { - if (!isBinary){ // do standard conversion if this is text! + if (!isBinary && fileLength > 0){ // do standard conversion if this is text! String localEncoding = SystemEncodingUtil.getInstance().getLocalDefaultEncoding(); IFileServiceCodePageConverter codePageConverter = CodePageConverterManager.getCodePageConverter(encoding, this); @@ -1089,7 +1090,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_SUCCESS_TYPE)) { // do standard conversion if this is text! - if (!isBinaries[j]){ // do standard conversion if this is text! + if (!isBinaries[j] && fileLength > 0){ // do standard conversion if this is text! or if the file is empty String localEncoding = SystemEncodingUtil.getInstance().getLocalDefaultEncoding(); IFileServiceCodePageConverter codePageConverter = CodePageConverterManager.getCodePageConverter(hostEncodings[j], this);