lyt23 / filesync4eclipse

Automatically exported from code.google.com/p/filesync4eclipse
1 stars 0 forks source link

Error syncing linked file that uses variable path #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a linked file on the project (not a linked folder, a linked file 
using File>New>File Advanced>> Link to file in the file system). Use a variable 
2. Create a sync mapping which will copy the linked file
3. Observe errors in the error log
Errors during sync of the resource 'sites/default/favicon.ico' in project 'Ovi 
- drupal'
Failed to copy to external resource 
'/data/Dev/Ovi/www/sites/default/favicon.ico', mapped in project 'Ovi - drupal'
Could not copy file 'OVI_PROJECT_LOC/drupal/config/sites/default/favicon.ico' 
to '/data/Dev/Ovi/www/sites/default/favicon.ico'

What is the expected output? What do you see instead?
The destination folder should have a copy of the file.
Instead, no file is present or a file of size 0 is created (observed for binary 
file .ico)
What version of the product are you using? On what operating system?
Eclipse 3.6
FileSync 1.3.6.201005301956

Original issue reported on code.google.com by fmjrey on 24 Aug 2010 at 8:48

GoogleCodeExporter commented 8 years ago
Through debugging: SyncWizard.getSourceFile(IResource source) is using a 
deprecated function IPathManager.resolvePath(rawPath) which for some reasons 
does not resolve well linked files while working fine with linked folders. 
Using the newer api seems to resolve the issue, and even simplify the code:
<code>
    protected File getSourceFile(IResource source) {
        // linked resources will be resolved here!
        URI uri = source.getLocationURI();
        return uri == null ? null : new File(uri);
    }
</code>

Original comment by fmjrey on 25 Aug 2010 at 1:52

GoogleCodeExporter commented 8 years ago
Committed fix into a clone:
http://code.google.com/a/eclipselabs.org/r/fmjrey-pathvars-rse/source/detail?r=2
5145f658993b97ee338b3937c191b58f057871e

Original comment by fmjrey on 26 Aug 2010 at 8:49