Changeset 2569


Ignore:
Timestamp:
Aug 11, 2014, 2:36:42 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #616: External files with a file server can't be downloaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.ftp/trunk/src/net/sf/basedb/clients/ftp/BaseFtpFile.java

    r1381 r2569  
    480480      throw new IOException("Not a file: " + this);
    481481    }
    482     return file.getDownloadStream(offset);
     482    DbControl dc = null;
     483    InputStream in = null;
     484    try
     485    {
     486      if (file.getLocation() == Location.EXTERNAL)
     487      {
     488        dc = user.sc.newDbControl();
     489        dc.reattachItem(file, false);
     490      }
     491      in = file.getDownloadStream(offset);
     492    }
     493    finally
     494    {
     495      if (dc != null) dc.close();
     496    }
     497    return in;
    483498  }
    484499 
Note: See TracChangeset for help on using the changeset viewer.