1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[216252] removing IService.getMessage

This commit is contained in:
David McKnight 2008-02-25 16:32:48 +00:00
parent bee7836a48
commit b5795bd71b
17 changed files with 204 additions and 90 deletions

View file

@ -44,6 +44,7 @@ public class Activator extends AbstractUIPlugin
private static SystemUniversalTempFileListener _tempFileListener;
public final static String PLUGIN_ID = "org.eclipse.rse.files.ui"; //$NON-NLS-1$
public static final String HELPPREFIX = "org.eclipse.rse.files.ui."; //$NON-NLS-1$
/**
* The constructor.

View file

@ -19,6 +19,7 @@
package org.eclipse.rse.internal.files.ui.wizards;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.rse.internal.files.ui.Activator;
import org.eclipse.rse.internal.files.ui.FileResources;
import org.eclipse.rse.internal.files.ui.ISystemFileConstants;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
@ -104,7 +105,7 @@ public class SystemNewFileWizardMainPage
}
);
SystemWidgetHelpers.setCompositeHelp(composite_prompts, RSEUIPlugin.HELPPREFIX+ISystemFileConstants.NEW_FILE_WIZARD);
SystemWidgetHelpers.setCompositeHelp(composite_prompts, Activator.HELPPREFIX+ISystemFileConstants.NEW_FILE_WIZARD);
return composite_prompts;

View file

@ -19,13 +19,13 @@
package org.eclipse.rse.internal.files.ui.wizards;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.rse.internal.files.ui.Activator;
import org.eclipse.rse.internal.files.ui.FileResources;
import org.eclipse.rse.internal.files.ui.ISystemFileConstants;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.messages.ISystemMessageLine;
import org.eclipse.rse.ui.validators.ISystemValidator;
@ -108,7 +108,7 @@ public class SystemNewFolderWizardMainPage
}
);
SystemWidgetHelpers.setCompositeHelp(composite_prompts, RSEUIPlugin.HELPPREFIX+ISystemFileConstants.NEW_FOLDER_WIZARD);
SystemWidgetHelpers.setCompositeHelp(composite_prompts, Activator.HELPPREFIX+ISystemFileConstants.NEW_FOLDER_WIZARD);
return composite_prompts;

View file

@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
*******************************************************************************/
package org.eclipse.rse.internal.services.dstore;
@ -27,6 +27,7 @@ public class Activator extends Plugin {
//The shared instance.
private static Activator plugin;
public static final String PLUGIN_ID = "org.eclipse.rse.services.dstore"; //$NON-NLS-1$
/**
* The constructor.

View file

@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
*******************************************************************************/
package org.eclipse.rse.internal.services.dstore;
@ -36,6 +36,40 @@ public class ServiceResources extends NLS
public static String DStore_Service_ProgMon_Initializing_Message;
public static String DStore_Service_Percent_Complete_Message;
public static String MSG_OPERATION_CANCELED;
// Remote File Exception Messages
public static String FILEMSG_SECURITY_ERROR;
public static String FILEMSG_IO_ERROR;
public static String FILEMSG_FOLDER_NOTEMPTY;
public static String FILEMSG_FOLDER_NOTFOUND;
public static String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE;
public static String FILEMSG_FILE_NOTFOUND;
public static String FILEMSG_SECURITY_ERROR_DETAILS;
public static String FILEMSG_IO_ERROR_DETAILS;
public static String FILEMSG_FOLDER_NOTEMPTY_DETAILS;
public static String FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE_DETAILS;
// --------------------------
// UNIVERSAL FILE MESSAGES...
// --------------------------
public static String FILEMSG_DELETE_FILE_FAILED;
public static String FILEMSG_RENAME_FILE_FAILED;
public static String FILEMSG_CREATE_FILE_FAILED;
public static String FILEMSG_CREATE_FILE_FAILED_EXIST;
public static String FILEMSG_CREATE_FOLDER_FAILED;
public static String FILEMSG_CREATE_FOLDER_FAILED_EXIST;
public static String FILEMSG_COPY_FILE_FAILED;
public static String FILEMSG_DELETE_FILE_FAILED_DETAILS;
public static String FILEMSG_RENAME_FILE_FAILED_DETAILS;
public static String FILEMSG_CREATE_FILE_FAILED_DETAILS;
public static String FILEMSG_CREATE_FILE_FAILED_EXIST_DETAILS;
public static String FILEMSG_CREATE_FOLDER_FAILED_DETAILS;
public static String FILEMSG_CREATE_FOLDER_FAILED_EXIST_DETAILS;
public static String FILEMSG_COPY_FILE_FAILED_DETAILS;
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, ServiceResources.class);

View file

@ -12,7 +12,7 @@
# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
#
# Contributors:
# Martin Oberhuber (Wind River) - [219952] Use MessageFormat for download progress message
# David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
###############################################################################
# NLS_MESSAGEFORMAT_VAR
@ -30,3 +30,47 @@ DStore_Shell_Service_Description=The DStore Shell Service uses the RSE DataStore
DStore_Search_Service_Description=The DStore Search Service uses the RSE DataStore to provide service for remote searches. It requires a DataStore server or daemon to be running on the host machine.
DStore_File_Service_Description=The DStore File Service uses the RSE DataStore to provide service for the Files subsystem. It requires a DataStore server or daemon to be running on the host machine.
DStore_Process_Service_Description=The DStore Process Service uses the RSE DataStore to provide service for the Processes subsystem. It requires a DataStore server or daemon to be running on the host machine.
MSG_OPERATION_CANCELED=Operation canceled.
# REMOTE FILE SYSTEM EXCEPTION ERROR MESSAGES
FILEMSG_SECURITY_ERROR=Operation failed. Security violation
FILEMSG_SECURITY_ERROR_DETAILS=Message reported from file system: {0}
FILEMSG_IO_ERROR=Operation failed. File system input or output error
FILEMSG_IO_ERROR_DETAILS=Message reported from file system: {0}
FILEMSG_FOLDER_NOTEMPTY=Folder is not empty. Cannot delete
FILEMSG_FOLDER_NOTEMPTY_DETAILS=The operation failed. One possible reason is that the folder is not empty
FILEMSG_FOLDER_NOTFOUND=Folder '{0}' not found
FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE=Folder '{0}' not found. Would you like to create it?
FILEMSG_FOLDER_NOTFOUND_WANTTOCREATE_DETAILS=The folder you specified does not exist. Select Yes to create it, No to cancel the operation
FILEMSG_FILE_NOTFOUND=File '{0}' not found
# Universal File Messages
FILEMSG_DELETE_FILE_FAILED=Deletion of the object {0} failed
FILEMSG_DELETE_FILE_FAILED_DETAILS=Either the object does not exist or you do not have enough authority to delete the object. If this is a folder, the folder may not be empty
FILEMSG_RENAME_FILE_FAILED=Renaming of the object {0} failed
FILEMSG_RENAME_FILE_FAILED_DETAILS=Rename operation failed because, the object to rename does not exist, or the object with new object name already exists, or the user does not have enough authority to rename the object
FILEMSG_CREATE_FILE_FAILED=No authority or file name not valid
FILEMSG_CREATE_FILE_FAILED_DETAILS=The file could not be created because of one of the following reasons:\n- the user does not have enough authority to create the file \n- the file name is not valid
FILEMSG_CREATE_FILE_FAILED_EXIST=File already exists
FILEMSG_CREATE_FILE_FAILED_EXIST_DETAILS=The new file {0} already exists
FILEMSG_CREATE_FOLDER_FAILED=Creation of the folder failed
FILEMSG_CREATE_FOLDER_FAILED_DETAILS=The folder {0} could not be created because of one of the following reasons:\n- the user does not have enough authority to create the folder \n- the folder name is not valid
FILEMSG_CREATE_FOLDER_FAILED_EXIST= Folder already exists
FILEMSG_CREATE_FOLDER_FAILED_EXIST_DETAILS=The new folder {0} already exists
FILEMSG_COPY_FILE_FAILED=Copy of the file or folder {0} failed
FILEMSG_COPY_FILE_FAILED_DETAILS=The file system reported the copy operation failed. You may not have authority to the target folder, or it may be in use

View file

@ -35,7 +35,7 @@
* Xuan Chen (IBM) - [209827] Update DStore command implementation to enable cancelation of archive operations
* David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files
* David McKnight (IBM) - [216252] MessageFormat.format -> NLS.bind
* Martin Oberhuber (Wind River) - [219952] Use MessageFormat for download progress message
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
*******************************************************************************/
package org.eclipse.rse.internal.services.dstore.files;
@ -55,14 +55,17 @@ import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.dstore.core.model.DE;
import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.core.model.DataStoreAttributes;
import org.eclipse.dstore.core.model.DataStoreResources;
import org.eclipse.dstore.core.model.IDataStoreProvider;
import org.eclipse.osgi.util.NLS;
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
import org.eclipse.rse.dstore.universal.miners.UniversalByteStreamHandler;
import org.eclipse.rse.internal.services.dstore.Activator;
import org.eclipse.rse.internal.services.dstore.ServiceResources;
import org.eclipse.rse.services.clientserver.FileTypeMatcher;
import org.eclipse.rse.services.clientserver.IMatcher;
@ -71,7 +74,7 @@ import org.eclipse.rse.services.clientserver.ISystemFileTypes;
import org.eclipse.rse.services.clientserver.NamePatternMatcher;
import org.eclipse.rse.services.clientserver.PathUtility;
import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.dstore.AbstractDStoreService;
@ -99,6 +102,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
private int _bufferDownloadSize = IUniversalDataStoreConstants.BUFFER_SIZE;
protected ISystemFileTypes _fileTypeRegistry;
private String remoteEncoding;
protected boolean unixStyle = false;
@ -112,9 +116,9 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
DataStoreResources.FALSE,
"2"}; //$NON-NLS-1$
public DStoreFileService(IDataStoreProvider dataStoreProvider, ISystemFileTypes fileTypeRegistry, ISystemMessageProvider msgProvider)
public DStoreFileService(IDataStoreProvider dataStoreProvider, ISystemFileTypes fileTypeRegistry)
{
super(dataStoreProvider, msgProvider);
super(dataStoreProvider);
_fileElementMap = new HashMap();
_dstoreFileMap = new HashMap();
_fileTypeRegistry = fileTypeRegistry;
@ -797,7 +801,10 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION))
{
localFile.delete();
SystemMessage msg = getMessage("RSEF1001").makeSubstitution(IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION); //$NON-NLS-1$
String msgTxt = ServiceResources.FILEMSG_SECURITY_ERROR;
String msgDetails = NLS.bind(ServiceResources.FILEMSG_SECURITY_ERROR_DETAILS, IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION);
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION))
@ -812,7 +819,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION))
{
localFile.delete();
SystemMessage msg = getMessage("RSEF1001").makeSubstitution(IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION); //$NON-NLS-1$
String msgTxt = ServiceResources.FILEMSG_SECURITY_ERROR;
String msgDetails = NLS.bind(ServiceResources.FILEMSG_SECURITY_ERROR_DETAILS, IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION);
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
//IOException e = new IOException(resultChild.getName());
//UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e);
@ -1026,7 +1037,10 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION))
{
localFile.delete();
SystemMessage msg = getMessage("RSEF1001").makeSubstitution(IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION); //$NON-NLS-1$
String msgTxt = ServiceResources.FILEMSG_SECURITY_ERROR;
String msgDetails = NLS.bind(ServiceResources.FILEMSG_SECURITY_ERROR_DETAILS, IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION);
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_UNSUPPORTED_ENCODING_EXCEPTION))
@ -1042,7 +1056,9 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION))
{
localFile.delete();
SystemMessage msg = getMessage("RSEF1001").makeSubstitution(IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION); //$NON-NLS-1$
String msgTxt = ServiceResources.FILEMSG_SECURITY_ERROR;
String msgDetails = NLS.bind(ServiceResources.FILEMSG_SECURITY_ERROR_DETAILS, IUniversalDataStoreConstants.DOWNLOAD_RESULT_IO_EXCEPTION);
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
//IOException e = new IOException(resultChild.getName());
//UniversalSystemPlugin.logError(CLASSNAME + "." + "copy: " + "error reading file " + remotePath, e);
@ -1272,23 +1288,31 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (null != monitor && monitor.isCanceled())
{
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, ServiceResources.MSG_OPERATION_CANCELED);
//This operation has been canceled by the user.
throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
throw new SystemMessageException(msg);
}
if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS))
return new DStoreHostFile(de);
else if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.FAILED_WITH_EXIST))
{
throw new SystemMessageException(getMessage("RSEF1303").makeSubstitution(remotePath)); //$NON-NLS-1$
{
String msgTxt = ServiceResources.FILEMSG_CREATE_FILE_FAILED_EXIST;
String msgDetails = NLS.bind(ServiceResources.FILEMSG_CREATE_FILE_FAILED_EXIST_DETAILS, remotePath);
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
else
{
{
// for 196035 - throwing security exception instead of message exception
Exception e= new SystemMessageException(getMessage("RSEF1302").makeSubstitution(remotePath)); //$NON-NLS-1$
String msgTxt = ServiceResources.FILEMSG_CREATE_FILE_FAILED;
String msgDetails = ServiceResources.FILEMSG_CREATE_FILE_FAILED_DETAILS;
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
Exception e= new SystemMessageException(msg);
RemoteFileSecurityException messageException = new RemoteFileSecurityException(e);
throw messageException;
//throw new SystemMessageException(getMessage("RSEF1302").makeSubstitution(remotePath)); //$NON-NLS-1$
}
}
@ -1304,19 +1328,26 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (null != monitor && monitor.isCanceled())
{
//This operation has been canceled by the user.
throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, ServiceResources.MSG_OPERATION_CANCELED));
}
if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS))
return new DStoreHostFile(de);
else if(FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.FAILED_WITH_EXIST))
{
throw new SystemMessageException(getMessage("RSEF1309").makeSubstitution(remotePath)); //$NON-NLS-1$
String msgTxt = ServiceResources.FILEMSG_CREATE_FOLDER_FAILED_EXIST;
String msgDetails = NLS.bind(ServiceResources.FILEMSG_CREATE_FOLDER_FAILED_EXIST_DETAILS, remotePath);
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
else
{
String msgTxt = ServiceResources.FILEMSG_CREATE_FILE_FAILED;
String msgDetails = NLS.bind(ServiceResources.FILEMSG_CREATE_FILE_FAILED_DETAILS, remotePath);
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
// for 196035 - throwing security exception instead of message exception
Exception e= new SystemMessageException(getMessage("RSEF1304").makeSubstitution(remotePath)); //$NON-NLS-1$
Exception e= new SystemMessageException(msg);
RemoteFileSecurityException messageException = new RemoteFileSecurityException(e);
throw messageException;
//throw new SystemMessageException(getMessage("RSEF1304").makeSubstitution(remotePath)); //$NON-NLS-1$
@ -1333,7 +1364,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (null != monitor && monitor.isCanceled())
{
//This operation has been canceled by the user.
throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, ServiceResources.MSG_OPERATION_CANCELED));
}
String sourceMsg = FileSystemMessageUtil.getSourceMessage(status);
// When running a server older than 2.0.1 success is not set for directories, so we must
@ -1341,7 +1372,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (sourceMsg.equals(IServiceConstants.SUCCESS) || sourceMsg.equals("")) { //$NON-NLS-1$
return true;
} else {
throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$
String msgTxt = NLS.bind(ServiceResources.FILEMSG_DELETE_FILE_FAILED, FileSystemMessageUtil.getSourceLocation(status));
String msgDetails = ServiceResources.FILEMSG_DELETE_FILE_FAILED_DETAILS;
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
}
@ -1361,7 +1396,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (null != monitor && monitor.isCanceled())
{
//This operation has been canceled by the user.
throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, ServiceResources.MSG_OPERATION_CANCELED));
}
String sourceMsg = FileSystemMessageUtil.getSourceMessage(status);
// When running a server older than 2.0.1 success is not set for directories, so we must
@ -1369,7 +1404,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (sourceMsg.equals(IServiceConstants.SUCCESS) || sourceMsg.equals("")) { //$NON-NLS-1$
return true;
} else {
throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$
String msgTxt = NLS.bind(ServiceResources.FILEMSG_DELETE_FILE_FAILED, FileSystemMessageUtil.getSourceLocation(status));
String msgDetails = ServiceResources.FILEMSG_DELETE_FILE_FAILED_DETAILS;
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
}
@ -1396,14 +1435,19 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (status == null) return false;
if (null != monitor && monitor.isCanceled())
{
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, ServiceResources.MSG_OPERATION_CANCELED);
//This operation has been canceled by the user.
throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
throw new SystemMessageException(msg);
}
if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS))
return true;
else
{
throw new SystemMessageException(getMessage("RSEF1301").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$
String msgTxt = NLS.bind(ServiceResources.FILEMSG_RENAME_FILE_FAILED, FileSystemMessageUtil.getSourceLocation(status));
String msgDetails = ServiceResources.FILEMSG_RENAME_FILE_FAILED_DETAILS;
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
}
@ -1593,20 +1637,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (status.getAttribute(DE.A_SOURCE).equals(IServiceConstants.FAILED)) {
throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcName)); //$NON-NLS-1$
/*
// for an unexpected error, we don't have an error message from the server
if (errMsg.equals(UNEXPECTED_ERROR)) {
msg = SystemPlugin.getPluginMessage(MSG_ERROR_UNEXPECTED).getLevelOneText();
}
else {
msg = errMsg;
}
String msgTxt = NLS.bind(ServiceResources.FILEMSG_COPY_FILE_FAILED, srcName);
String msgDetails = ServiceResources.FILEMSG_COPY_FILE_FAILED_DETAILS;
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new RemoteFileIOException(new Exception(msg));
/*/
throw new SystemMessageException(msg);
}
}
catch (InterruptedException e)
@ -1614,7 +1649,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (monitor != null && monitor.isCanceled())
{
//This operation has been canceled by the user.
throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, ServiceResources.MSG_OPERATION_CANCELED));
}
// cancel monitor if it's still not canceled
if (monitor != null && !monitor.isCanceled())
@ -1655,7 +1690,12 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
getStatusMonitor(ds).waitForUpdate(status, monitor);
if (status.getAttribute(DE.A_SOURCE).equals(IServiceConstants.FAILED)) {
throw new SystemMessageException(getMessage("RSEF1306").makeSubstitution(srcNames[0])); //$NON-NLS-1$
String msgTxt = NLS.bind(ServiceResources.FILEMSG_COPY_FILE_FAILED, srcNames[0]);
String msgDetails = ServiceResources.FILEMSG_COPY_FILE_FAILED_DETAILS;
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt, msgDetails);
throw new SystemMessageException(msg);
}
}
catch (InterruptedException e)
@ -1663,7 +1703,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
if (monitor != null && monitor.isCanceled())
{
//This operation has been canceled by the user.
throw new SystemMessageException(getMessage("RSEG1067")); //$NON-NLS-1$
throw new SystemMessageException(new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.CANCEL, ServiceResources.MSG_OPERATION_CANCELED));
}
// cancel monitor if it's still not canceled
if (monitor != null && !monitor.isCanceled())

View file

@ -19,15 +19,14 @@ package org.eclipse.rse.internal.services.dstore.rmtservice;
import org.eclipse.dstore.core.java.IRemoteClassInstance;
import org.eclipse.dstore.core.model.IDataStoreProvider;
import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
import org.eclipse.rse.services.dstore.AbstractDStoreService;
public class DStoreRemoteServiceService extends AbstractDStoreService
{
public DStoreRemoteServiceService(IDataStoreProvider dataStoreProvider, ISystemMessageProvider msgProvider)
public DStoreRemoteServiceService(IDataStoreProvider dataStoreProvider)
{
super(dataStoreProvider, msgProvider);
super(dataStoreProvider);
}
protected String getMinerId()

View file

@ -17,6 +17,7 @@
* David McKnight [190010] Set the status to finish or canceled depending on dstore status.
* David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup
* David McKnight (IBM) - [214378] don't mark as finished until we have the results - sleep instead of wait
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
*******************************************************************************/
package org.eclipse.rse.internal.services.dstore.search;
@ -31,7 +32,6 @@ import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
import org.eclipse.rse.internal.services.dstore.ServiceResources;
import org.eclipse.rse.internal.services.dstore.files.DStoreHostFile;
import org.eclipse.rse.services.clientserver.SystemSearchString;
import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
import org.eclipse.rse.services.dstore.AbstractDStoreService;
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.services.search.IHostSearchConstants;
@ -42,9 +42,9 @@ import org.eclipse.rse.services.search.ISearchService;
public class DStoreSearchService extends AbstractDStoreService implements ISearchService
{
public DStoreSearchService(IDataStoreProvider provider, ISystemMessageProvider msgProvider)
public DStoreSearchService(IDataStoreProvider provider)
{
super(provider, msgProvider);
super(provider);
}
public String getName()

View file

@ -14,6 +14,7 @@
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout
* David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
********************************************************************************/
package org.eclipse.rse.internal.services.dstore.shells;
@ -28,7 +29,6 @@ import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.core.model.IDataStoreProvider;
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
import org.eclipse.rse.internal.services.dstore.ServiceResources;
import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.services.dstore.AbstractDStoreService;
import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor;
@ -41,9 +41,9 @@ public class DStoreShellService extends AbstractDStoreService implements IShellS
protected DataElement _envMinerElement;
protected DataElement _envMinerStatus;
public DStoreShellService(IDataStoreProvider dataStoreProvider, ISystemMessageProvider msgProvider)
public DStoreShellService(IDataStoreProvider dataStoreProvider)
{
super(dataStoreProvider, msgProvider);
super(dataStoreProvider);
}

View file

@ -16,6 +16,7 @@
* David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout
* David McKnight (IBM) - [207095] check for null datastore
* David McKnight (IBM) - [209593] [api] check for existing query to avoid duplicates
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
*******************************************************************************/
package org.eclipse.rse.services.dstore;
@ -30,23 +31,20 @@ import org.eclipse.dstore.core.model.DataElement;
import org.eclipse.dstore.core.model.DataStore;
import org.eclipse.dstore.core.model.IDataStoreProvider;
import org.eclipse.rse.internal.services.dstore.ServiceResources;
import org.eclipse.rse.services.clientserver.messages.ISystemMessageProvider;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor;
public abstract class AbstractDStoreService implements IDStoreService
{
protected IDataStoreProvider _dataStoreProvider;
protected ISystemMessageProvider _msgProvider;
protected DataElement _minerElement;
protected DStoreStatusMonitor _statusMonitor;
protected Map _cmdDescriptorMap;
protected DataElement _initializeStatus;
public AbstractDStoreService(IDataStoreProvider dataStoreProvider, ISystemMessageProvider msgProvider)
public AbstractDStoreService(IDataStoreProvider dataStoreProvider)
{
_dataStoreProvider = dataStoreProvider;
_msgProvider = msgProvider;
_cmdDescriptorMap = new HashMap();
}
@ -455,14 +453,5 @@ public abstract class AbstractDStoreService implements IDStoreService
}
protected abstract String getMinerId();
/**
* For now just a dummy method
* @param messageID
* @return the message
*/
public SystemMessage getMessage(String messageID)
{
return _msgProvider.getMessage(messageID);
}
}

View file

@ -17,7 +17,6 @@
package org.eclipse.rse.services;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
public interface IService
{
@ -25,5 +24,4 @@ public interface IService
public String getDescription();
public void initService(IProgressMonitor monitor);
public void uninitService(IProgressMonitor monitor);
public SystemMessage getMessage(String messageID);
}

View file

@ -33,7 +33,7 @@ public class Activator extends AbstractUIPlugin {
//The shared instance.
private static Activator plugin;
public static final String PLUGIN_ID = "org.eclipse.rse.subsystems.files.core";
public static final String PLUGIN_ID = "org.eclipse.rse.subsystems.files.core"; //$NON-NLS-1$
/**
* The constructor.

View file

@ -37,8 +37,8 @@ import org.eclipse.rse.ui.RSEUIPlugin;
public class RemoteFileEncodingManager {
private static RemoteFileEncodingManager instance;
private static final String ENCODINGS_DIR = "encodings";
private static final String ENCODINGS_PROPERTIES_FILE = "encodings.properties";
private static final String ENCODINGS_DIR = "encodings"; //$NON-NLS-1$
private static final String ENCODINGS_PROPERTIES_FILE = "encodings.properties"; //$NON-NLS-1$
private boolean isLoaded;
private HashMap hostMap;
@ -193,11 +193,11 @@ public class RemoteFileEncodingManager {
hostMap.put(hosts[i].getName(), props);
}
catch (FileNotFoundException e) {
RSEUIPlugin.logError("File " + encodingsFilePath.toOSString() + " could not be found", e);
RSEUIPlugin.logError("File " + encodingsFilePath.toOSString() + " could not be found", e); //$NON-NLS-1$ //$NON-NLS-2$
continue;
}
catch (IOException e) {
RSEUIPlugin.logError("I/O problems reading file " + encodingsFilePath.toOSString(), e);
RSEUIPlugin.logError("I/O problems reading file " + encodingsFilePath.toOSString(), e); //$NON-NLS-1$
continue;
}
}
@ -270,7 +270,7 @@ public class RemoteFileEncodingManager {
created = encodingsFile.createNewFile();
}
catch (IOException e) {
RSEUIPlugin.logError("I/O error when trying to create encodings file " + encodingsFilePath.toOSString(), e);
RSEUIPlugin.logError("I/O error when trying to create encodings file " + encodingsFilePath.toOSString(), e); //$NON-NLS-1$
created = false;
}
@ -286,11 +286,11 @@ public class RemoteFileEncodingManager {
props.store(outStream, null);
}
catch (FileNotFoundException e) {
RSEUIPlugin.logError("File " + encodingsFilePath + " could not be found", e);
RSEUIPlugin.logError("File " + encodingsFilePath + " could not be found", e); //$NON-NLS-1$ //$NON-NLS-2$
continue;
}
catch (IOException e) {
RSEUIPlugin.logError("I/O problems writing to file " + encodingsFilePath, e);
RSEUIPlugin.logError("I/O problems writing to file " + encodingsFilePath, e); //$NON-NLS-1$
continue;
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others.
* Copyright (c) 2006, 2007 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
@ -15,7 +15,7 @@
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Kushal Munir (IBM) - [189352] Set whether file service is Unix-style system or not
* David McKnight (IBM) - [206755] upload and download buffer should be in kbytes, not bytes
* Martin Oberhuber (Wind River) - [220020][api][breaking] SystemFileTransferModeRegistry should be internal
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
*******************************************************************************/
package org.eclipse.rse.subsystems.files.dstore;
@ -47,11 +47,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAda
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.ui.RSEUIPlugin;
/**
* Provides a factory for generating instances of the class
* SampleFileSubSystem.
*/
public class DStoreFileSubSystemConfiguration extends FileServiceSubSystemConfiguration
{
protected boolean _isWindows;
@ -137,7 +132,7 @@ public class DStoreFileSubSystemConfiguration extends FileServiceSubSystemConfig
public IFileService createFileService(IHost host)
{
DStoreConnectorService connectorService = (DStoreConnectorService)getConnectorService(host);
DStoreFileService service = new DStoreFileService(connectorService, RemoteFileUtility.getSystemFileTransferModeRegistry(), RSEUIPlugin.getDefault());
DStoreFileService service = new DStoreFileService(connectorService, RemoteFileUtility.getSystemFileTransferModeRegistry());
service.setIsUnixStyle(isUnixStyle());
IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
@ -157,7 +152,7 @@ public class DStoreFileSubSystemConfiguration extends FileServiceSubSystemConfig
public ISearchService createSearchService(IHost host)
{
DStoreConnectorService connectorService = (DStoreConnectorService)getConnectorService(host);
return new DStoreSearchService(connectorService, RSEUIPlugin.getDefault());
return new DStoreSearchService(connectorService);
}
public IHostFileToRemoteFileAdapter getHostFileAdapter()

View file

@ -32,7 +32,6 @@ import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IServiceCommandShell;
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.ShellServiceSubSystem;
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.ShellServiceSubSystemConfiguration;
import org.eclipse.rse.ui.RSEUIPlugin;
/**
* Provides a factory for generating instances of the class
@ -64,7 +63,7 @@ public class DStoreShellSubSystemConfiguration extends ShellServiceSubSystemConf
public ISubSystem createSubSystemInternal(IHost host)
{
DStoreConnectorService connectorService = (DStoreConnectorService)getConnectorService(host);
ISubSystem subsys = new ShellServiceSubSystem(host, connectorService, new DStoreShellService(connectorService, RSEUIPlugin.getDefault()));
ISubSystem subsys = new ShellServiceSubSystem(host, connectorService, new DStoreShellService(connectorService));
return subsys;
}
@ -88,7 +87,7 @@ public class DStoreShellSubSystemConfiguration extends ShellServiceSubSystemConf
public IShellService createShellService(IHost host)
{
return new DStoreShellService((IDataStoreProvider)getConnectorService(host), RSEUIPlugin.getDefault());
return new DStoreShellService((IDataStoreProvider)getConnectorService(host));
}
public boolean supportsCommands()

View file

@ -42,6 +42,19 @@ Kevin Doyle (IBM) - [160769] Added message for invalid filter when moving files
<LevelOne>Enter name</LevelOne>
<LevelTwo>You must enter a name in the field where the cursor is positioned.</LevelTwo>
</Message>
<Message ID="1007" Indicator="E">
<LevelOne>Name in use</LevelOne>
<LevelTwo>This name is already used by another resource. Enter a unique name.</LevelTwo>
</Message>
<Message ID="1008" Indicator="E">
<LevelOne>Name not valid</LevelOne>
<LevelTwo>The name entered does not have valid syntax</LevelTwo>
</Message>
<Message ID="1009" Indicator="E">
<LevelOne>You must rename %1</LevelOne>
<LevelTwo>You have left the new name the same as the old name. Enter a new name that is different from the old name.</LevelTwo>
</Message>
<Message ID="1010" Indicator="E">
<LevelOne>Name %1 is specified more than once</LevelOne>