Changeset 4724


Ignore:
Timestamp:
Jan 13, 2009, 11:56:41 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1230: Using "Browse" in Packed file exporter results in an empty compressed file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9-stable/src/plugins/core/net/sf/basedb/plugins/PackedFileExporter.java

    r4513 r4724  
    126126  private int numFiles;
    127127  private long totalBytes;
     128  private List<Integer> selectedFiles;
     129  private List<Integer> selectedDirs;
    128130  private List<Nameable> selectedFilesAndDirs;
    129131 
     
    305307        storeValue(job, request, ri.getParameter("root"));
    306308        ParameterType<Integer> filesAndDirectories = new IntegerParameterType(null, null, null, true, 0, 0, 0, null);
    307         Set<Integer> selectedFiles = sc.getCurrentContext(Item.FILE).getSelected();
    308         if (selectedFiles.size() > 0)
    309         {
    310           job.setValues("files", filesAndDirectories, new ArrayList<Integer>(selectedFiles));
    311         }
    312         Set<Integer> selectedDirectories = sc.getCurrentContext(Item.DIRECTORY).getSelected();
    313         if (selectedDirectories.size() > 0)
    314         {
    315           job.setValues("directories", filesAndDirectories, new ArrayList<Integer>(selectedDirectories));
     309        if (selectedFiles != null && selectedFiles.size() > 0)
     310        {
     311          job.setValues("files", filesAndDirectories, selectedFiles);
     312        }
     313        if (selectedDirs != null && selectedDirs.size() > 0)
     314        {
     315          job.setValues("directories", filesAndDirectories, selectedDirs);
    316316        }
    317317       
     
    483483       
    484484        selectedFilesAndDirs = new LinkedList<Nameable>();
    485         loadFilesAndDirectories(dc, selectedFilesAndDirs, fileContext.getSelected(), dirContext.getSelected(), false);
     485        selectedFiles = new ArrayList<Integer>(fileContext.getSelected());
     486        selectedDirs = new ArrayList<Integer>(dirContext.getSelected());
     487        loadFilesAndDirectories(dc, selectedFilesAndDirs, selectedFiles, selectedDirs, false);
    486488       
    487489        // Save as and overwrite parameter
Note: See TracChangeset for help on using the changeset viewer.