View Javadoc

1   /*
2    * <cvs:source>$Source: /devel/astrogrid/filestore/common/src/java/org/astrogrid/filestore/common/transfer/UrlGetRequest.java,v $</cvs:source>
3    * <cvs:author>$Author: jdt $</cvs:author>
4    * <cvs:date>$Date: 2004/11/25 00:19:20 $</cvs:date>
5    * <cvs:version>$Revision: 1.2 $</cvs:version>
6    * <cvs:log>
7    *   $Log: UrlGetRequest.java,v $
8    *   Revision 1.2  2004/11/25 00:19:20  jdt
9    *   Merge from dave-dev-200410061224-200411221626
10   *
11   *   Revision 1.1.2.1  2004/10/29 15:54:50  dave
12   *   Added exportInit to mock implementation ...
13   *   Added UrlGetRequest to pass into exportInit ...
14   *   Added test for exportInit and UrlGetRequest ...
15   *
16   *   Revision 1.3.30.2  2004/10/26 11:13:11  dave
17   *   Changed transfer properties 'source' to 'location', makes more sense for PUT transfers.
18   *
19   *   Revision 1.3.30.1  2004/10/21 21:00:13  dave
20   *   Added mock://xyz URL handler to enable testing of transfer.
21   *   Implemented importInit to the mock service and created transfer tests.
22   *
23   *   Revision 1.3  2004/09/02 10:25:41  dave
24   *   Updated FileStore and MySpace to handle mime type and file size.
25   *   Updated Community deployment script.
26   *
27   *   Revision 1.2.46.1  2004/09/01 02:58:07  dave
28   *   Updated to use external mime type for imported files.
29   *
30   *   Revision 1.2  2004/07/21 18:11:55  dave
31   *   Merged development branch, dave-dev-200407201059, into HEAD
32   *
33   *   Revision 1.1.2.1  2004/07/20 19:10:40  dave
34   *   Refactored to implement URL import
35   *
36   *   Revision 1.2  2004/07/14 13:50:29  dave
37   *   Merged development branch, dave-dev-200406301228, into HEAD
38   *
39   *   Revision 1.1.2.1  2004/07/05 04:50:29  dave
40   *   Created initial FileStore components
41   *
42   * </cvs:log>
43   *
44   */
45  package org.astrogrid.filestore.common.transfer ;
46  
47  import java.net.URL ;
48  
49  import org.astrogrid.filestore.common.file.FileProperty ;
50  import org.astrogrid.filestore.common.file.FileProperties ;
51  
52  import org.astrogrid.filestore.common.identifier.UniqueIdentifier ;
53  
54  /***
55   * A transfer info to hold data about a URL get transfer.
56   *
57   */
58  public class UrlGetRequest
59  	extends TransferProperties
60  	{
61  
62  	/***
63  	 * The transfer method.
64  	 *
65  	 */
66  	public static final String TRANSFER_METHOD = "GET" ;
67  
68  	/***
69  	 * Create a new request.
70  	 * @param url The transfer source.
71  	 *
72  	 */
73  	public UrlGetRequest()
74  		{
75  		this((FileProperty[]) null) ;
76  		}
77  
78  	/***
79  	 * Create a new request.
80  	 * @param url The transfer source.
81  	 * @param properties The properties for the file to transfer
82  	 *
83  	 */
84  	public UrlGetRequest(FileProperties properties)
85  		{
86  		this(
87  			(null != properties) ? properties.toArray() : (FileProperty[]) null
88  			) ;
89  		}
90  
91  	/***
92  	 * Create a new request.
93  	 * @param url The transfer source.
94  	 * @param properties The properties for the file to transfer
95  	 *
96  	 */
97  	public UrlGetRequest(FileProperty[] properties)
98  		{
99  		//
100 		// Initialise our base class.
101 		super(
102 			UniqueIdentifier.next().toString(),
103 			properties
104 			) ;
105 		//
106 		// Set our transfer properties.
107 		this.setMethod(TRANSFER_METHOD) ;
108 		}
109 	}
110