View Javadoc

1   /*
2    * $HeadURL: $
3    * $Date: $
4    * $Revision: $
5    * $Author: $
6    * 
7    * Copyright (c) 2005 MindTree Consulting Ltd. 
8    * 
9    * This file is part of Insight.
10   * 
11   * Insight is free software: you can redistribute it and/or modify it under the 
12   * terms of the GNU General Public License as published by the Free Software 
13   * Foundation, either version 3 of the License, or (at your option) any later 
14   * version.
15   * 
16   * Insight is distributed in the hope that it will be useful, but 
17   * WITHOUT ANY WARRANTY; without even the implied warranty of 
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
19   * Public License for more details.
20   * 
21   * You should have received a copy of the GNU General Public License along with 
22   * Insight.  If not, see <http://www.gnu.org/licenses/>.
23   */
24  
25  package com.mindtree.techworks.insight.download;
26  
27  
28  /**
29   * This is a specialization of the <code>Fileset</code> class to contain
30   * information such as the URL, authentication, etc., about a HTTPFileset.
31   * 
32   * @see com.mindtree.techworks.insight.download.Fileset Fileset
33   * @author Bindul Bhowmik
34   * @version $Revision: 27 $ $Date: 2007-12-16 04:58:03 -0700 (Sun, 16 Dec 2007) $
35   */
36  public class HTTPFileset extends Fileset {
37  
38  	//
39  	// Instance variables
40  	//
41  
42  	/**
43  	 * Specifies if authentication is required to connect to FTP location
44  	 */
45  	private boolean isAuthenticationRequired;
46  
47  	/**
48  	 * The user name that will be used when connecting to the specified FTP
49  	 * location
50  	 */
51  	private String userName;
52  
53  	/**
54  	 * The password that will be used when connecting to the specified FTP
55  	 * location
56  	 */
57  	private String password;
58  
59  	/**
60  	 * Specifies if the FTP location is to be accessed over the Proxy
61  	 */
62  	private boolean ignoreProxy;
63  
64  	//
65  	// Constructors
66  	//
67  
68  	/**
69  	 * Constructs a new FTPFileset object with just the name of the fileset.
70  	 * 
71  	 * @param filesetName The name of the fileset.
72  	 */
73  	public HTTPFileset (String filesetName) {
74  
75  		super(filesetName, Fileset.HTTP_FILESET, "HTTP_CLIENT");
76  	}
77  
78  
79  	/**
80  	 * Constructs a new FTPFileset object with just the name of the fileset.
81  	 * 
82  	 * @param filesetName The name of the fileset
83  	 * @param isAuthenticationRequired If authentication is required on the Host
84  	 * @param userName The username for authentication
85  	 * @param password Password for authentication
86  	 * @param ignoreProxy If the connection is to be made ignoring proxy
87  	 */
88  	public HTTPFileset (String filesetName, boolean isAuthenticationRequired,
89  			String userName, String password, boolean ignoreProxy) {
90  
91  		super(filesetName, Fileset.HTTP_FILESET, "HTTP_CLIENT");
92  		this.isAuthenticationRequired = isAuthenticationRequired;
93  		this.userName = userName;
94  		this.password = password;
95  		this.ignoreProxy = ignoreProxy;
96  	}
97  
98  	//
99  	// Accessors
100 	//
101 
102 	/**
103 	 * @return Returns the ignoreProxy.
104 	 */
105 	public boolean isIgnoreProxy () {
106 
107 		return ignoreProxy;
108 	}
109 
110 	/**
111 	 * @param ignoreProxy The ignoreProxy to set.
112 	 */
113 	public void setIgnoreProxy (boolean ignoreProxy) {
114 
115 		this.ignoreProxy = ignoreProxy;
116 	}
117 
118 	/**
119 	 * @return Returns the isAuthenticationRequired.
120 	 */
121 	public boolean isAuthenticationRequired () {
122 
123 		return isAuthenticationRequired;
124 	}
125 
126 	/**
127 	 * @param isAuthenticationRequired The isAuthenticationRequired to set.
128 	 */
129 	public void setAuthenticationRequired (boolean isAuthenticationRequired) {
130 
131 		this.isAuthenticationRequired = isAuthenticationRequired;
132 	}
133 
134 	/**
135 	 * @return Returns the password.
136 	 */
137 	public String getPassword () {
138 
139 		return password;
140 	}
141 
142 	/**
143 	 * @param password The password to set.
144 	 */
145 	public void setPassword (String password) {
146 
147 		this.password = password;
148 	}
149 
150 	/**
151 	 * @return Returns the userName.
152 	 */
153 	public String getUserName () {
154 
155 		return userName;
156 	}
157 
158 	/**
159 	 * @param userName The userName to set.
160 	 */
161 	public void setUserName (String userName) {
162 
163 		this.userName = userName;
164 	}
165 }