Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 398988

Summary: [ftp] FTP Only support to zVM
Product: [Tools] Target Management Reporter: Samuel Wu <samuelwu>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: David Dykstal <ddykstal.eclipse>
Severity: normal    
Priority: P3 CC: dmcknigh
Version: 3.2.2Flags: ddykstal.eclipse: review+
Target Milestone: 3.4.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 399113    
Attachments:
Description Flags
Patch as described
none
updated patch with copyrights ddykstal.eclipse: iplog+

Description Samuel Wu CLA 2013-01-24 11:36:29 EST
zVM file system is a flat list. All the files are listed in the user home. There is no path structure and root is same as the user home.

When trying to use FTP Only connection to access zVM, we ran into the following problem. 

1. The home directory created as FTPHostFile is readonly
In the constructor of the FTPHostFile, _canWrite was set to false and it can't be overridden. This makes the user home readonly and no file can be pasted to it. Wonder whether it can be set to true by default. If a user home is readonly, a message currently pops up and shows the error message, which explains that the target directory is readonly.

2. SystemViewRemoteFileAdapter.doDrop() throws NPE 
The following code in doDrop() tries to refresh the targetFolder. But getRemoteFileObject() assumes the file structure is a hierarchic one and tries to re-get the file from its parent. Since zVM files is a flat list, it returns null and targetFolder.canWrite() throws NPE.
if (target instanceof IRemoteFile)
{
	IRemoteFile targetFolder = (IRemoteFile) target;
	IRemoteFileSubSystem targetFS = targetFolder.getParentRemoteFileSubSystem();

	// make sure properties are uptodate
	try
	{
		//targetFolder.markStale(true);
		targetFolder = targetFS.getRemoteFileObject(targetFolder.getAbsolutePath(), monitor);
	}
	catch (Exception e)
	{
	}

	if (!targetFolder.canWrite())

Wonder whether we can add a null check and reuse the current one if it fails to get a new one.
Comment 1 Samuel Wu CLA 2013-01-24 11:40:07 EST
Created attachment 226054 [details]
Patch as described

A patch was created for your reference
Comment 2 David McKnight CLA 2013-01-25 11:13:37 EST
(In reply to comment #1)
> Created attachment 226054 [details]
> Patch as described
> 
> A patch was created for your reference

Samuel, could you please put your legal disclaimer here?
Comment 3 David McKnight CLA 2013-01-25 11:23:49 EST
Created attachment 226114 [details]
updated patch with copyrights
Comment 4 David McKnight CLA 2013-01-25 11:26:58 EST
The patch looks okay to me.  Dave, can you review the patch?
Comment 5 Samuel Wu CLA 2013-01-25 11:27:41 EST
(In reply to comment #2)
> (In reply to comment #1)
> Created attachment 226054 [details]
> Patch as
> described
> 
> A patch was created for your reference

Samuel, could you
> please put your legal disclaimer here?

I, Samuel Wu, declare that I developed the attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer to make this contribution under the EPL.
Comment 6 David McKnight CLA 2013-01-25 13:01:58 EST
Thanks for the review, Dave.  I've committed the change.
Comment 7 David Dykstal CLA 2013-05-21 14:13:17 EDT
Comment on attachment 226114 [details]
updated patch with copyrights

adding iplog+ to this patch