1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-24 16:53:50 +02:00

fixes for 154302 - relaying exceptions back from fetch operations

This commit is contained in:
David McKnight 2006-08-28 15:31:45 +00:00
parent 3479b29549
commit aa98dd9091

View file

@ -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 fileNameFilter The name pattern to subset the list by, or null to return all files.
* @param context The holder of state information * @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; String parentPath = null;
if (parent != null) { if (parent != null) {
@ -360,6 +360,13 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
} else { } else {
parentPath = "/"; parentPath = "/";
} }
if (!parent.canRead())
{
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
throw new SystemMessageException(msg);
}
IHostFile[] results = null; IHostFile[] results = null;
try 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 fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded
* @param context The holder of state information * @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; String parentPath = null;
if (parent != null) { if (parent != null) {
@ -389,6 +396,13 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
} else { } else {
parentPath = "/"; parentPath = "/";
} }
if (!parent.canRead())
{
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_FOLDER_UNREADABLE).makeSubstitution(parentPath);
throw new SystemMessageException(msg);
}
IHostFile[] results = null; IHostFile[] results = null;
try try
{ {