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

Bug 387909

Summary: Stop using serviceRegistry.getService("orion.core.file") in multiple file systems.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: grant_gayed, mamacdon, simon_kaegi, Szymon.Brandys
Version: 0.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description libing wang CLA 2012-08-23 11:22:18 EDT
Found this when implementing bug 381438. 
We have several places trying to use file service like this:
var fileService = serviceRegistry.getService("orion.core.file");
fileService.read(fileLocation).then...

When I tested comparing a file in Orion project against html5/webDav, it failed at  the place where fileService.read() is called on the html5/webDav file system.

This was because serviceRegistry.getService("orion.core.file") always picked up Orion file service.

In a multiple file system we should always use: 
var fileClient = new mFileClient.FileClient(serviceRegistry);
fileClient.read(fileLocation).then...

I've already fixed this in the compare widget but we still have somewhere else using the getService("orion.core.file") pattern.
Comment 1 Grant Gayed CLA 2012-08-27 10:25:09 EDT
I assume the Target Milestone should have been 1.0M2.
Comment 2 libing wang CLA 2012-10-04 16:47:56 EDT
Triage in 2.0M1.
Comment 3 libing wang CLA 2013-02-08 13:09:45 EST
I searched again, only siteCommands and gitRepositoryExplorer are using this pattern. But they always work on orion file systems.
It will not cause issues but for consistency, I will ask Mark and Szymon in 3.0M1.
Comment 4 John Arthorne CLA 2015-05-05 14:42:50 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html