home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wsgatsam.zip / FileService.java < prev    next >
Text File  |  2003-02-24  |  1KB  |  59 lines

  1. /**
  2.  * %wsgw_sample_start%
  3.  * Licensed Materials - Property of IBM
  4.  *
  5.  * (c) Copyright IBM Corp. 2001, 2002 All Rights Reserved.
  6.  *
  7.  * US Government Users Restricted Rights - Use, duplication or
  8.  * disclosure restricted by GSA ADP Schedule Contract with
  9.  * IBM Corp.
  10.  * %wsgw_sample_end%
  11.  */
  12. package services.lftfileservice;
  13.  
  14. import com.ibm.httpr.lft.LargeFileURLUtil;
  15.  
  16. public class FileService
  17. {
  18.   public String checkIn( String fileId, String changeDesc, String fileReference )
  19.   {
  20.     System.out.println( "FileService : fileId" + fileId );
  21.     System.out.println( "FileService : changeDesc" + changeDesc );
  22.  
  23.     try
  24.     {
  25.       System.out.println( "FileService : fileReference" + fileReference );
  26.       System.out.println( "FileService : fileReferenceURL" + LargeFileURLUtil.getURLFromFileReference( fileReference ) );
  27.     }
  28.     catch ( Exception e )
  29.     {
  30.       e.printStackTrace();
  31.     }
  32.  
  33.     return "File Checked in fine";
  34.   }
  35.  
  36.   public String checkOut( String fileId )
  37.   {
  38.     System.out.println( "FileService : fileId" + fileId );
  39.  
  40.     String osName = System.getProperty( "os.name" );
  41.     String response;
  42.  
  43.     if ( osName.startsWith( "Windows" ) )
  44.     {
  45.        response = "file:/C:/IBM/lft/client/files/demo.gif";
  46.     }
  47.     else if ( osName.equals( "AIX" ) )
  48.     {
  49.        response = "file:/usr/IBM/lft/client/files/demo.gif";
  50.     }
  51.     else
  52.     {
  53.        response = "file:/opt/IBM/lft/client/files/demo.gif";
  54.     }
  55.  
  56.     return response;
  57.   }
  58. }
  59.