Changeset 3780


Ignore:
Timestamp:
Sep 25, 2007, 1:20:55 PM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #784: PackedFileExporter? chews first character from file and directory names in the root directory

File:
1 edited

Legend:

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

    r3675 r3780  
    376376    // Prepare for compression
    377377    String rootPath = rootDir.getPath().toString();
     378    if (!rootPath.endsWith("/")) rootPath += "/";
    378379    out.setMimeType(packer.getMimeType());
    379380    out.setFilename(generateDefaultName(packer, rootDir, itemsToPack));
     
    405406     
    406407      // Remove rootPath from entryPath
    407       entryPath = entryPath.substring(rootPath.length()+1);
     408      entryPath = entryPath.substring(rootPath.length());
    408409     
    409410      // Update progress
     
    657658  private String generateDefaultPath(FilePacker packer, Directory rootDir, Collection<Nameable> selectedItems)
    658659  {
    659     String defaultPath = rootDir == null ? "~/" : rootDir.getPath().toString() + "/";
     660    String defaultPath = rootDir == null ? "~/" : rootDir.getPath().toString();
     661    if (!defaultPath.endsWith("/")) defaultPath += "/";
    660662    defaultPath +=  generateDefaultName(packer, rootDir, selectedItems);
    661663    return defaultPath;
Note: See TracChangeset for help on using the changeset viewer.