From aa98dd9091d657fdf3d219f627bfd88a2e2ec8e6 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Mon, 28 Aug 2006 15:31:45 +0000 Subject: [PATCH] fixes for 154302 - relaying exceptions back from fetch operations --- .../servicesubsystem/FileServiceSubSystem.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 7098e4e3a1d..4b0be5b3339 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 @@ -352,7 +352,7 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I * @param fileNameFilter The name pattern to subset the list by, or null to return all files. * @param context The holder of state information */ - public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context) + public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context) throws SystemMessageException { String parentPath = null; if (parent != null) { @@ -360,6 +360,13 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I } else { parentPath = "/"; } + + if (!parent.canRead()) + { + SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath); + throw new SystemMessageException(msg); + } + IHostFile[] results = null; try { @@ -381,7 +388,7 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded * @param context The holder of state information */ - public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context) + public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IRemoteFileContext context) throws SystemMessageException { String parentPath = null; if (parent != null) { @@ -389,6 +396,13 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I } else { parentPath = "/"; } + + if (!parent.canRead()) + { + SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath); + throw new SystemMessageException(msg); + } + IHostFile[] results = null; try {