Changeset 1225


Ignore:
Timestamp:
May 5, 2010, 1:25:24 PM (11 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #264: Investigate and fix issues with external files introduced in BASE 2.16

External files will show up as read-only for the FTP program. Files with an unknown size are reported to have size=0. This is not allowed in all cases by the FTP protocol. It is most likely only an issue when appending to a partly uploaded file and since we don't allow uploading there shouldn't be any problem.

Location:
extensions/net.sf.basedb.ftp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.ftp/trunk/README

    r985 r1225  
    11== Requirements ==
    22
    3  1. BASE 2.10.0 or later.
     3 1. BASE 2.16.0 or later.
    44 
    55== Introduction ==
     
    4141   FTP clients since that is normally not allowed. The result for certain
    4242   operations is undefined for files and directories that has the same name.
    43 
     43 * BASE 2.16 introduced an option to register files as a link to an external URL.
     44   Such files-will show up as read-only in the FTP server. If the file size of an
     45   external file is not known it is shown as 0 in the FTP server.
     46 
    4447== Tips and tricks ==
    4548
  • extensions/net.sf.basedb.ftp/trunk/build.xml

    r1025 r1225  
    4646  <property name="javac.target" value="1.5" />
    4747  <property name="javac.encoding" value="UTF-8" />
    48   <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.10.0" />
     48  <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.16.0" />
    4949
    5050  <!-- set up classpath for compiling -->
  • extensions/net.sf.basedb.ftp/trunk/src/net/sf/basedb/clients/ftp/BaseFtpFile.java

    r985 r1225  
    3737import net.sf.basedb.core.Item;
    3838import net.sf.basedb.core.ItemQuery;
     39import net.sf.basedb.core.Location;
    3940import net.sf.basedb.core.OwnedItem;
    4041import net.sf.basedb.core.Path;
     
    171172  public long getSize()
    172173  {
    173     return file == null ? 0 : file.getSize();
     174    return file == null || file.getSize() < 0 ? 0 : file.getSize();
    174175  }
    175176
     
    260261    if (file != null)
    261262    {
    262       permission = file.hasPermission(Permission.WRITE);
     263      permission = file.hasPermission(Permission.WRITE) &&
     264        file.getLocation() != Location.EXTERNAL;
    263265    }
    264266    else if (directory != null)
     
    503505      {
    504506        // Upload to an existing file
    505         dc.reattachItem(file);
     507        dc.reattachItem(file, false);
    506508      }
    507509      else
Note: See TracChangeset for help on using the changeset viewer.