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 908d6a92359..efa03ce934e 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 @@ -30,6 +30,7 @@ * David McKnight (IBM) - [209704] [api] Ability to override default encoding conversion needed. * Kevin Doyle (IBM) - [208778] [efs][api] RSEFileStore#getOutputStream() does not support EFS#APPEND * David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup + * David McKnight (IBM) - [209704] added supportsEncodingConversion() ********************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -2005,29 +2006,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer this.unixStyle = isUnixStyle; } - - - /** - * Deprecated - */ - public IHostFile[] getFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) - { - return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_FOLDERS, monitor); - } - - /** - * Deprecated - */ - public IHostFile[] getFiles(String remoteParent, String fileFilter, IProgressMonitor monitor) - { - return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_FILES, monitor); - } - - /** - * Deprecated - */ - public IHostFile[] getFilesAndFolders(String remoteParent, String fileFilter, IProgressMonitor monitor) - { - return fetch(remoteParent, fileFilter, IUniversalDataStoreConstants.C_QUERY_VIEW_ALL, monitor); + public boolean supportsEncodingConversion(){ + return true; } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java index 8ce0b0a2b44..13e0923f64a 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/AbstractFileService.java @@ -21,6 +21,7 @@ * David McKnight (IBM) - [209704] [api] Ability to override default encoding conversion needed. * Xuan Chen (IBM) - [210555] [regression] NPE when deleting a file on SSH * Kevin Doyle (IBM) - [208778] [efs][api] RSEFileStore#getOutputStream() does not support EFS#APPEND + * David McKnight (IBM) - [209704] added supportsEncodingConversion() ********************************************************************************/ package org.eclipse.rse.services.files; @@ -211,4 +212,12 @@ public abstract class AbstractFileService implements IFileService public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, int options, IProgressMonitor monitor) throws SystemMessageException { return null; } + + /** + * The default implementation returns false. Clients should override this method if they make use + * of IFileServiceCodePageConverter to do conversion during download and upload. + */ + public boolean supportsEncodingConversion(){ + return false; + } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java index 116e74cda1d..30fdfc3685f 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/files/IFileService.java @@ -20,6 +20,7 @@ * David McKnight (IBM) - [209552] API changes to use multiple and getting rid of deprecated * David McKnight (IBM) - [210109] store constants in IFileService rather than IFileServiceConstants * Kevin Doyle (IBM) - [208778] new API getOutputSteam for getting an output stream in append mode + * David McKnight (IBM) - [209704] added supportsEncodingConversion() ********************************************************************************/ package org.eclipse.rse.services.files; @@ -485,5 +486,14 @@ public interface IFileService extends IService * @since 3.0 */ public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, int options, IProgressMonitor monitor) throws SystemMessageException; - + + /** + * Indicates whether this file service supports code page conversion using + * the IFileServiceCodePageConverter mechanism. Certain extensions, such as + * property pages for encoding conversion can determine whether or not to + * display or enable themselves based on result of this call. + * + * @return whether this service supports encoding conversion + */ + public boolean supportsEncodingConversion(); } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java index 8160fe59dd1..89044daf272 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java @@ -26,6 +26,7 @@ * David McKnight (IBM) - [203114] don't treat XML files specially (no hidden prefs for bin vs text) * David McKnight (IBM) - [209552] API changes to use multiple and getting rid of deprecated * Kevin Doyle (IBM) - [208778] [efs][api] RSEFileStore#getOutputStream() does not support EFS#APPEND + * David McKnight (IBM) - [209704] added supportsEncodingConversion() *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.servicesubsystem; @@ -1033,4 +1034,11 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I return new FileSubSystemOutputStream(getFileService().getOutputStream(remoteParent, remoteFile, isBinary, options, monitor), remoteParent, remoteFile, this); } + /** + * Defers to the file service. + */ + public boolean supportsEncodingConversion(){ + return getFileService().supportsEncodingConversion(); + } + } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileSubSystem.java index 6a53f3cd402..f44255835e9 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/IRemoteFileSubSystem.java @@ -19,6 +19,7 @@ * David McKnight (IBM) - [162195] new APIs for upload multi and download multi * David McKnight (IBM) - [209552] API changes to use multiple and getting rid of deprecated * Kevin Doyle (IBM) - [208778] new API getOutputSteam for getting an output stream in append mode + * David McKnight (IBM) - [209704] added supportsEncodingConversion() *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.subsystems; @@ -675,5 +676,14 @@ public interface IRemoteFileSubSystem extends ISubSystem { * @since 3.0 */ public OutputStream getOutputStream(String remoteParent, String remoteFile, boolean isBinary, int options, IProgressMonitor monitor) throws SystemMessageException; - + + /** + * Indicates whether this file subsystem supports code page conversion using + * the IFileServiceCodePageConverter mechanism. Certain extensions, such as + * property pages for encoding conversion can determine whether or not to + * display or enable themselves based on result of this call. + * + * @return whether this service supports encoding conversion + */ + public boolean supportsEncodingConversion(); } \ No newline at end of file