Changeset 10586


Ignore:
Timestamp:
2005-08-31T11:55:37+12:00 (19 years ago)
Author:
mdewsnip
Message:

Now handles mkcol.pl cancels a lot better -- no longer get multiple error dialog boxes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r10564 r10586  
    322322        ProgressMonitor progress = new ProgressMonitor(Gatherer.g_man, Dictionary.get("CollectionManager.Creating_New"), "mkcol.pl", 0, 4);
    323323
    324         // Create the new collection.
     324        // Create the new collection
    325325        makeCollection(name, email);
    326326        progress.setProgress(1);
    327        
    328         // *******************
    329         //check that this creation has worked - simply by checking for the existence of the collect.cfg file
     327
     328        // Check that the collection has been created successfully
    330329        String collection_directory_path = getCollectionDirectoryPath(name);
     330        if (!new File(collection_directory_path).exists()) {
     331        // If there is no collection directory then the creation was unsuccessful, or cancelled
     332        System.err.println("No collection directory...");
     333        progress.close();
     334        return;
     335        }
     336
     337        // Check for the existence of the collect.cfg file
    331338        File collect_cfg_file = new File(collection_directory_path + "etc" + File.separator + "collect.cfg");
    332339        if (!collect_cfg_file.exists()) {
    333         // no point continuing
    334340        System.err.println("Error: no collect.cfg file has been created!");
    335341        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CollectionManager.Cannot_Create_Collection_With_Reason", Dictionary.get("CollectionManager.No_Config_File")), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
Note: See TracChangeset for help on using the changeset viewer.