private String mapLocal(String localPath) {
        if (localFoldersInfo == null || localFolders.size() == 0)
            return localPath; // nothing to do
        
        File f = new File(localPath);
        if (f.exists())
            return localPath; // it's fine
        
        String testedPath;
        for (Path p : localFolders) {
            testedPath = p.localDirectory + File.separator + localPath;
            f = new File(testedPath);
            if (f.exists())
                return testedPath;
            
            // the name of the localDir could also be the first 
            //  item of localPath
            int lastSepPos = p.localDirectory.lastIndexOf(File.separatorChar);
            if (localPath.startsWith(
                    p.localDirectory.substring(lastSepPos))) {
                testedPath = p.localDirectory.substring(0, lastSepPos) + localPath;
                f = new File(testedPath);
                if (f.exists())
                    return testedPath;
            }
        }
        
        // oh well
        return localPath;
    }