greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 17897

Show
Ignore:
Timestamp:
2008-11-20 10:51:46 (2 months ago)
Author:
oranfry
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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