Bug 226481 - The GEclipseFileStore should implement the toLocalFile(...) method
Summary: The GEclipseFileStore should implement the toLocalFile(...) method
Status: ASSIGNED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Geclipse (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ariel Garcia CLA
QA Contact:
URL:
Whiteboard:
Keywords: core, polish
Depends on:
Blocks:
 
Reported: 2008-04-10 07:40 EDT by Moritz Post CLA
Modified: 2014-01-09 16:14 EST (History)
3 users (show)

See Also:


Attachments
Implementation of the IFileStore.toLocalFile(...) method (1.42 KB, patch)
2008-04-10 07:40 EDT, Moritz Post CLA
no flags Details | Diff
Implementation of the IFileStore.toLocalFile(...) method (keeping CACHE mechanism) (1.59 KB, patch)
2008-04-10 08:41 EDT, Moritz Post CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Post CLA 2008-04-10 07:40:46 EDT
Created attachment 95501 [details]
Implementation of the IFileStore.toLocalFile(...) method

While developing some testcode for an IVirtualOrganization i needed to test the loading mechanisem from the GEclipseFileSystem and thereby required to create temporary objects to work upon. Since the API of the GEclipseFileStore is limited to internal use, it is not possible to get ahold of the information embedded in the slave, which contains a reference to the location of the data on the local disc. 

Therefore the currently unimplemented method IFileStore.toLocalFile(...) should be implemented to make such testing scenarios possible. The patch provided exposes the local location via a File object if the scheme of the GEclipseFileSystem is local (aka uses "file").
Comment 1 Mathias Stümpert CLA 2008-04-10 08:22:46 EDT
Your provided implementation does only cover parts of the method specification. The specification says:

1) return only null if fs is not local and EFS.CACHE is not specified.
2) return a File with the same state as the original file.

So in fact to make a proper implementation you should support also the CACHE option and you should take care of providing a copy with the same state. If this functionality is really needed at the moment we may accept the patch. Nevertheless I would prefer to have an implementation that fully follows the specification.
Comment 2 Moritz Post CLA 2008-04-10 08:41:06 EDT
Created attachment 95511 [details]
Implementation of the IFileStore.toLocalFile(...) method (keeping CACHE mechanism)
Comment 3 Moritz Post CLA 2008-04-10 08:41:33 EDT
As the CACHE Flag is described as being the default implementation, i did not see the immediate necessity to carry this functionality over. On a second thought... Sure, why not? It is easy to implement and maybe useful in the future.

A second patch is appended incorporating these changes.