Bug 228232 - [ftp][ssh] FTPService and SftpFileService should use SimpleSystemMessage
Summary: [ftp][ssh] FTPService and SftpFileService should use SimpleSystemMessage
Status: NEW
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on: 226773
Blocks:
  Show dependency tree
 
Reported: 2008-04-22 12:52 EDT by Martin Oberhuber CLA
Modified: 2012-11-19 04:41 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2008-04-22 12:52:32 EDT
+++ This bug was initially created as a clone of Bug #228230 +++

FTPService and SftpFileService currently create 
   SystemMessage("RSE", "F","9999"...)
I think that they should use a SimpleSystemMessage Constructor as per the Javadocs of SimpleSystemMessage, including a plug-in ID and plug-in-specific error code.
Comment 1 Martin Oberhuber CLA 2008-04-22 12:53:46 EDT
Dave can you please fix this properly? I guess you're the one who would best know what ID's should go into a SimpleSystemMessage here, thanks.
Comment 2 David McKnight CLA 2008-04-22 13:05:45 EDT
These occurrences are as follows:

In FTPService:

protected String checkEncoding(String s) throws SystemMessageException {
  ...
     catch(UnsupportedEncodingException e) {
			SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
			throw new SystemMessageException(msg);
		}
}


In SFtpFileService:


protected String recodeSafe(String s) throws SystemMessageException {
   ...

		} catch(UnsupportedEncodingException e) {

			//SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),"Please specify a different encoding in host properties."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
			SystemMessage msg = new SystemMessage("RSE","F","9999",'E',e.getMessage(),""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
			//throw new RemoteFileIOException(new SystemMessageException(msg));
			throw new SystemMessageException(msg);
}

I don't think we have any message IDs for unsupported encoding exceptions.

Comment 3 Martin Oberhuber CLA 2008-04-22 13:10:36 EDT
Well it doesn't need to be a globally unique ID, does it? But anything that correctly uses the SimpleSystemMessage API properly would be better than what we have now, wouldn't it? Because the current code creates fake globally unique ID's that are simply incorrect.

That being said, I'm surprised that no message ID exists for unsupported encoding problems, since that should be something quite likely to occur with all the recoding that we're doing for DStore?
Comment 4 Martin Oberhuber CLA 2011-05-31 17:48:33 EDT
Bulk moving 3.3 deferred items to 3.3.1
Comment 5 Martin Oberhuber CLA 2012-11-19 04:41:58 EST
Clearing target milestone