Changeset 1267:ec093465c1ff

Show
Ignore:
Timestamp:
06/17/10 16:12:55 (3 years ago)
Author:
Thomas Gambet <tgambet@…>
Branch:
default
Message:

fixed: no initialization failed exception if uploaded or temporary files directories exist

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/org/w3c/unicorn/Framework.java

    r1262 r1267  
    166166                 
    167167                // creating uploaded and temporary files directories 
    168                 if ((new File(Property.get("UPLOADED_FILES_REPOSITORY"))).mkdir()) 
     168                File upload_repo = new File(Property.get("UPLOADED_FILES_REPOSITORY")); 
     169                File temporary_repo = new File(Property.get("UPLOADED_FILES_REPOSITORY")); 
     170                if (upload_repo.mkdir() || upload_repo.exists()) 
    169171                        logger.debug("> Created uploaded files directory: \n\t"  
    170172                                + Property.get("UPLOADED_FILES_REPOSITORY")); 
     
    172174                        throw new InitializationFailedException("Unable to create uploaded files directory: \n\t" 
    173175                                + Property.get("UPLOADED_FILES_REPOSITORY")); 
    174                 if ((new File(Property.get("PATH_TO_TEMPORARY_FILES"))).mkdir()) 
     176                if (temporary_repo.mkdir() || temporary_repo.exists()) 
    175177                        logger.debug("> Created temporary files directory: \n\t"  
    176178                                + Property.get("PATH_TO_TEMPORARY_FILES")); 
    177                 else  
     179                else 
    178180                        throw new InitializationFailedException("Unable to create temporary files directory: \n\t" 
    179181                                + Property.get("PATH_TO_TEMPORARY_FILES"));