Changeset 5169


Ignore:
Timestamp:
Oct 29, 2009, 12:15:44 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1376: Remove the working directory (in the BASE file system) that Base1PluginExecuter creates if it is empty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java

    r5159 r5169  
    721721      {
    722722        // Cleanup stdin and stdout
    723         if (workingDirectory != null)
     723        if (workingDirectory != null && workingDirectory.isInDatabase())
    724724        {
    725725          try
     
    737737            }
    738738            dc.commit();
     739            dc = sc.newDbControl();
     740            // Remove the working directory if the plug-in didn't create
     741            // any files that should be saved
     742            workingDirectory = Directory.getById(dc, workingDirectory.getId());
     743            if (!workingDirectory.isUsed())
     744            {
     745              dc.deleteItem(workingDirectory);
     746            }
     747            dc.commit();
    739748          }
    740749          catch (Exception ex)
    741750          {
    742             response.setError("Plug-in completed successfully, but stdin and/or stdout could not be removed: " +
    743                   ex.getMessage(), Arrays.asList(ex));
     751            response.setError("Plug-in completed successfully, but working directory" +
     752                " and/or stdin.txt/stdout.txt could not be removed: " +
     753                ex.getMessage(), Arrays.asList(ex));
    744754            return;
    745755          }
Note: See TracChangeset for help on using the changeset viewer.