Changeset 4033


Ignore:
Timestamp:
Dec 4, 2007, 4:45:48 PM (15 years ago)
Author:
Martin Svensson
Message:

Fixes #859 Downloading file from web services fails if the filename in BASE starts with a number.
A test is set up with a cel file in TestWebservices?.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/test/TestFile.java

    r3719 r4033  
    228228  }
    229229 
     230  /**
     231    @since 2.5
     232   */
     233  static void test_rename(int id, String newName)
     234  {
     235    if (id == 0) return;
     236    DbControl dc = null;
     237    File file = null;
     238    String oldName = null;
     239    try
     240    {
     241      dc = TestUtil.getDbControl();
     242      file = File.getById(dc, id);
     243      oldName = file.getName();
     244      file.setName(newName);
     245      dc.commit();
     246      write("--Rename fileId: " + file.getId() + " from " + oldName + " to " + newName + " OK");
     247    }
     248    catch (Throwable ex)
     249    {
     250      write("--Rename file: " + file + " FAILED");
     251      ex.printStackTrace();
     252      ok = false;
     253    }
     254    finally
     255    {
     256      if (dc != null) dc.close();
     257    }
     258  }
     259 
    230260  static void write_header()
    231261  {
  • trunk/src/test/TestWebservices.java

    r4008 r4033  
    141141    test_AnnotationTypes(client);
    142142    test_getRawDataInExperiment(client, experimentId1, rawBioAssayId1);
    143     test_getRawDataInExperiment(client, experimentId2, rawBioAssayId3);   
     143    test_getRawDataInExperiment(client, experimentId2, rawBioAssayId3);
     144
     145    //Test to download a file which name in BASE starts with a number.
     146    TestFile.test_rename(celId, "2rawdataFile.txt");
     147    test_getRawDataInExperiment(client, experimentId2, rawBioAssayId3);
     148   
    144149    test_getArrayDesign(client, rawBioAssayId1, arrayDesignId1);
    145150    test_getArrayDesign(client, rawBioAssayId3, arrayDesignId2);   
  • trunk/src/webservices/server/net/sf/basedb/ws/server/ArrayDesignService.java

    r3983 r4033  
    2828import net.sf.basedb.core.DataFileType;
    2929import net.sf.basedb.core.DbControl;
    30 import net.sf.basedb.core.File;
    3130import net.sf.basedb.core.FileSet;
    3231import net.sf.basedb.core.FileSetMember;
     
    126125        {
    127126          FileSetMember member = fileSet.getMember(type);
    128           File file = member.getFile();
    129127          BaseFileDataSource source = new BaseFileDataSource(member.getFile());
    130           toDownload = attachFile(source, file.getName());
     128          toDownload = attachFile(source, "downloadFile");
    131129        }
    132130      }
  • trunk/src/webservices/server/net/sf/basedb/ws/server/BioAssaySetService.java

    r4011 r4033  
    103103    if (format == null) return null;
    104104   
    105     String elementName = "exportFile";
     105    String elementName = "downloadFile";
    106106    OMElement elementWithAttachment = null;
    107107   
  • trunk/src/webservices/server/net/sf/basedb/ws/server/RawBioAssayService.java

    r3983 r4033  
    2727import net.sf.basedb.core.DataFileType;
    2828import net.sf.basedb.core.DbControl;
    29 import net.sf.basedb.core.File;
    3029import net.sf.basedb.core.FileSet;
    3130import net.sf.basedb.core.FileSetMember;
     
    3938import net.sf.basedb.info.RawBioAssayInfo;
    4039
    41 
    4240import org.apache.axiom.om.OMElement;
    4341
     
    150148        {
    151149          FileSetMember member = fileSet.getMember(type);
    152           File file = member.getFile();
    153150          BaseFileDataSource source = new BaseFileDataSource(member.getFile());
    154           toDownload = attachFile(source, file.getName());
     151          toDownload = attachFile(source, "downloadFile");
    155152        }
    156153      }
  • trunk/src/webservices/server/net/sf/basedb/ws/server/ReporterService.java

    r3993 r4033  
    105105    File exportFile = null;   
    106106    OMElement elementWithAttachment = null;
    107     String elementName = "exportFile";
     107    String elementName = "downloadFile";
    108108    String format = "text";
    109109    Item itemType = Item.REPORTERSCORE;
     
    170170    File exportFile = null;   
    171171    OMElement elementWithAttachment = null;
    172     String elementName = "exportFile";
     172    String elementName = "downloadFile";
    173173    String format = "text";
    174174    Item itemType = Item.REPORTER;
Note: See TracChangeset for help on using the changeset viewer.