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

Bug 339140

Summary: Path problems in copy/move implementation
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: John Arthorne <john.arthorne>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: susan
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 334718    

Description John Arthorne CLA 2011-03-07 14:49:25 EST
The server implementation of copy/move assumes source paths are server file system locations:

/A/SomeFolder/SomeFile.txt

In practice clients will always send locations that include the file servlet location:

/file/A/SomeFolder/SomeFile.txt

The client can't be expected to strip off the servlet location. This should be done on the server.

The server JUnit tests for copy/move also make this bad assumption.
Comment 1 John Arthorne CLA 2011-03-07 14:52:46 EST
There are also a couple of path manipulation bugs in the client code:

1) The stripPath function in fileCommands.js strips trailing separators in the case of location with a query:

/file/A/?depth=1 -> /file/A

Trailing separators are important in HTTP URLs because they differentiate files from directories. It should be:

/file/A/?depth=1 -> /file/A/


2) fileImpls.js wasn't properly computing the destination name when the source path has a trailing separator.
Comment 2 John Arthorne CLA 2011-03-07 14:56:29 EST
Fixes for all problems pushed.