Ignore:
Timestamp:
Oct 18, 2011, 2:50:36 PM (11 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #327: Update web service examples to BASE 3

Location:
webservices/net.sf.basedb.examples/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • webservices/net.sf.basedb.examples/trunk

    • Property svn:ignore
      •  

        old new  
        33build
        44dist
         5build.properties
         6.settings
  • webservices/net.sf.basedb.examples/trunk/src/net/sf/basedb/ws/example/Main.java

    r651 r1407  
    44  Copyright (C) Authors contributing to this file.
    55
    6   This file is part of BASE - BioArray Software Environment.
    7   Available at http://base.thep.lu.se/
    8 
    9   BASE is free software; you can redistribute it and/or
     6  This is free software; you can redistribute it and/or
    107  modify it under the terms of the GNU General Public License
    11   as published by the Free Software Foundation; either version 2
     8  as published by the Free Software Foundation; either version 3
    129  of the License, or (at your option) any later version.
    13 
    14   BASE is distributed in the hope that it will be useful,
     10 
     11  The software is distributed in the hope that it will be useful,
    1512  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1613  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1714  GNU General Public License for more details.
    18 
     15 
    1916  You should have received a copy of the GNU General Public License
    20   along with this program; if not, write to the Free Software
    21   Foundation, Inc., 59 Temple Place - Suite 330,
    22   Boston, MA  02111-1307, USA.
     17  along with BASE. If not, see <http://www.gnu.org/licenses/>.
    2318*/
    2419package net.sf.basedb.ws.example;
     
    3530import net.sf.basedb.info.DataFileTypeInfo;
    3631import net.sf.basedb.info.ExperimentInfo;
     32import net.sf.basedb.info.FileInfo;
     33import net.sf.basedb.info.FileSetMemberInfo;
    3734import net.sf.basedb.info.ProjectInfo;
    3835import net.sf.basedb.info.QueryOptions;
     
    254251    throws AxisFault
    255252  {
    256     DataFileTypeInfo[] files = rc.getDataFileTypes(info.getId(), new QueryOptions());
     253    FileSetMemberInfo[] files = rc.getDataFiles(info.getId(), new QueryOptions());
    257254    if (files == null || files.length == 0)
    258255    {
     
    261258    else
    262259    {
    263       for (DataFileTypeInfo fileType : files)
    264       {
    265         System.out.print("   " + fileType.getName());
     260      for (FileSetMemberInfo member : files)
     261      {
     262        DataFileTypeInfo fileType = member.getDataFileTypeInfo();
     263        FileInfo file = member.getFileInfo();
     264       
     265        System.out.println("   " + fileType.getName() + ": " +
     266          file.getName() + " [id=" + file.getId() + "] " + file.getSize() + " bytes");
    266267        if (downloadDir != null)
    267268        {
    268           String extension = fileType.getExtension() == null ? "" : "." + fileType.getExtension();
    269           File downloadTo = new File(downloadDir, info.getName() + extension);
     269          File downloadTo = new File(downloadDir, info.getName() + "." + file.getName());
    270270          try
    271271          {
     
    275275            out.close();
    276276            in.close();
    277             System.out.print("; Download --> " + downloadTo);
     277            System.out.print("  Download --> " + downloadTo);
    278278          }
    279279          catch (IOException ex)
    280280          {
    281             System.out.print("; Download failed: " + ex.getMessage());
     281            System.out.print("  Download failed: " + ex.getMessage());
    282282          }
    283283        }
Note: See TracChangeset for help on using the changeset viewer.