Skip to content

Commit

Permalink
*) Bugfix for recursive translation problem with file separators
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1352 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
theli committed Jan 16, 2006
1 parent 1f9ff68 commit 99031b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/de/anomic/data/translator.java
Expand Up @@ -181,12 +181,13 @@ public static boolean translateFiles(File sourceDir, File destDir, File baseDir,
if(rightExtension){
try{
relativePath=sourceFiles[i].getAbsolutePath().substring(baseDir.getAbsolutePath().length()+1, sourceFiles[i].getAbsolutePath().length()); //+1 to get the "/"
relativePath = relativePath.replace(File.separatorChar, '/');
}catch(IndexOutOfBoundsException e){
serverLog.logSevere("Translator", "Error creating relative Path for "+sourceFiles[i].getAbsolutePath());
relativePath="wrong path"; //not in translationLists
}
if(translationLists.containsKey(relativePath)){
if( translateFile(sourceFiles[i], new File(destDir, sourceFiles[i].getName()), (Hashtable)translationLists.get(relativePath))){
}
if(translationLists.containsKey(relativePath)){
if( translateFile(sourceFiles[i], new File(destDir, sourceFiles[i].getName().replace('/', File.separatorChar)), (Hashtable)translationLists.get(relativePath))){
serverLog.logInfo("Translator", "Translated file: "+ relativePath);
}else{
serverLog.logSevere("Translator", "File error while translating file "+relativePath);
Expand Down

0 comments on commit 99031b1

Please sign in to comment.