Bug 162949 - [api] generic up/downlad that works with files and directories
Summary: [api] generic up/downlad that works with files and directories
Status: ASSIGNED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: Future   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2006-10-31 12:28 EST by Lothar Werzinger CLA
Modified: 2007-05-30 06:35 EDT (History)
1 user (show)

See Also:


Attachments
sample upload implementation (1.79 KB, text/plain)
2006-10-31 12:28 EST, Lothar Werzinger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lothar Werzinger CLA 2006-10-31 12:28:07 EST
There should be a generic up/downlad that works with files and directories.

I wrote my own one (and every other user of RSE is likely to the same).
Sample code for upload is attached.

I, Lothar Werzinger, declare that I developed 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 1 Lothar Werzinger CLA 2006-10-31 12:28:52 EST
Created attachment 53009 [details]
sample upload implementation
Comment 2 Martin Oberhuber CLA 2006-10-31 12:30:50 EST
I believe that enhanced up/download will be added to RSE 2.0 as part of putting the IBM Import/Export wizards into Open Source.
Correct, Dave?
Comment 3 Lothar Werzinger CLA 2006-10-31 12:52:42 EST
To clarify. I was thinking to extend IFileServiceSubSystem and IFileService to have generic methods for up/download. This could live in an abstract base class that Service implementations derive from to avoid code duplication.

I'm not sure if that would be covered by the IBM Import/Export wizard contribution.
Comment 4 David Dykstal CLA 2006-11-06 16:02:52 EST
This would not be covered by the import/export contribution, but the idea is a good one. Dave McKnight should review after R1.
Comment 5 David Dykstal CLA 2006-11-17 15:30:37 EST
Dave -- I'm assigning to you. Seems like your area.
Comment 6 David McKnight CLA 2006-11-17 15:40:28 EST
This looks similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=162195.  I agree that we should do this but due to the API change it has to wait until 2.0.
Comment 7 Martin Oberhuber CLA 2006-11-23 12:07:34 EST
As per my comment on bug 162195, I'm not so sure that bulk upload/download should really go into the service.

The idea of IFileService is that it provides the most basic functionality and is easy to implement. I do not think that implementing a bulk upload in the service would give a lot of performance improvement over a bulk upload at a higher level - provided that the implementation at a higher level is optimized well, which will benefit all services immediately.
Comment 8 Lothar Werzinger CLA 2006-11-23 15:14:05 EST
As pointed out in https://bugs.eclipse.org/bugs/show_bug.cgi?id=162949#c3 I expect that there would be a common implementation that all implementations would benefit from.
The higher levels of RSE seem always to do some user interaction (e.g. Dialog on failure, etc.) and that may not what the user/application wants. So a generic solution at this level that just throws an exception so that the app code can handle it how he likes it may have its benefits, too. That does not mean that there can not be a higher level call that wraps this low level one with nice user interactions. On the contrary I'd expect to have such a call, too.
Comment 9 David McKnight CLA 2007-04-02 11:53:11 EDT
Any changed opinions on this now that we have methods for getting input and output streams at the IFileService layer?
Comment 10 Martin Oberhuber CLA 2007-04-02 12:06:01 EDT
What's the difference between the contribution suggested here, and the existing UniversalFileTransferUtility which we explained in our EclipseCon tutorial?
Comment 11 David McKnight CLA 2007-04-02 12:28:06 EDT
UniversalTransferUtility does provide the facility to do transfers on directories and files via the subsystem layer and using temp files.  At this layer file transfers are done between IResources and IRemoteFiles, timestamps and other temp file properties are handled here as well as conflict checking.  
Comment 12 Martin Oberhuber CLA 2007-04-24 10:50:43 EDT
When I get comment #8 right, the request is for a UniversalFileTransferUtility that has the following characteristics:

1. It works for any files and directories but is not tied to IResource
2. It throws exceptions in case of failure, no dialogs or user interaction

Does such a utility exist already, or can we refactor the existing one such that there is a low-end service part (as requested here) plus the hi-end driver doing user interaction and IResource mapping like the current UniversalFileTransferUtility?
Comment 13 David McKnight CLA 2007-04-24 11:03:20 EDT
We don't have a utility class right now that is not tied to IResource.  The next layer down is the subsystem layer, itself.  The reason I created this class in the first place was just to help take care of some of the temp file stuff that we do with IResource (such as setting timestamps in IFile properties).  I suppose we could split this into a low and high end service although we'd have to be careful that people don't use the low end when they should be using the higher end.
Comment 14 Martin Oberhuber CLA 2007-05-18 16:05:26 EDT
Not for 2.0