Changeset 17897 for release-kits

Show
Ignore:
Timestamp:
20.11.2008 10:51:46 (11 years ago)
Author:
oranfry
Message:

a patched ant-installer which can handle being run in paths with foreign characters

Location:
release-kits/shared/ant-installer
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/selfextract/SelfExtractor.java

    r15311 r17897  
    7373        //String fileForm = jarUrl.getFile(); 
    7474 
     75 
     76/* 
     77        File file = new File( fileForm ); 
     78        if ( !file.exists() ) { 
     79            throw new RuntimeException( "Failed expanding Jar.\n File: '" + file.getAbsolutePath() + "'\nString: '" + stringForm + "'" ); 
     80        } 
     81        return file; 
     82*/ 
     83 
    7584        File file = null; 
    7685        int endIdx = stringForm.indexOf("!/"); 
    77         if(endIdx != -1){ 
    78             String unescaped = null; 
    79             String fileNamePart = stringForm.substring("jar:file:".length(), endIdx); 
    80             file = new File(fileNamePart); 
    81             if ( ! file.exists()) { 
    82                 // try to unescape encase the URL Handler has escaped the " " to %20 
    83                 unescaped = unescape(fileNamePart); 
    84                 file = new File(unescaped); 
    85             } 
    86             return file; 
    87         } 
    88         throw new RuntimeException("Failed expanding Jar."); 
     86        if( endIdx == -1 ) { 
     87            throw new RuntimeException("Failed expanding Jar."); 
     88        } 
     89        String unescaped = null; 
     90        String fileNamePart = stringForm.substring("jar:file:".length(), endIdx); 
     91        file = new File(fileNamePart); 
     92        file = new File( file.getName() ); 
     93 
     94/* 
     95        if ( !file.exists()) { 
     96            // try to unescape encase the URL Handler has escaped the " " to %20 
     97            unescaped = unescape(fileNamePart); 
     98            file = new File(unescaped); 
     99        } 
     100*/ 
     101        return file; 
     102 
    89103    } 
    90104