--- /dev/null
+/*\r
+ * This is the MIT license, see also http://www.opensource.org/licenses/mit-license.html\r
+ *\r
+ * Copyright (c) 2001 Brian Pitcher\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ */\r
+\r
+// $Header: /project/jiss/smhuang/leap/weblech/src/spider/DumbAuthenticator.java,v 1.1 2010/06/30 15:45:27 smhuang Exp $\r
+\r
+package spider;\r
+\r
+import org.apache.log4j.Category;\r
+\r
+import java.net.Authenticator;\r
+import java.net.PasswordAuthentication;\r
+\r
+import weblech.util.Log4j;\r
+\r
+public class DumbAuthenticator extends Authenticator\r
+{\r
+ private final static Category _logClass = Category.getInstance(DumbAuthenticator.class);\r
+\r
+ static\r
+ {\r
+ Log4j.init();\r
+ }\r
+\r
+ private final String user;\r
+ private final String password;\r
+\r
+ public DumbAuthenticator(String user, String password)\r
+ {\r
+ _logClass.debug("DumbAuthenticator(" + user + ", ***)");\r
+ this.user = user;\r
+ this.password = password;\r
+ }\r
+\r
+ public PasswordAuthentication getPasswordAuthentication()\r
+ {\r
+ _logClass.debug("getPasswordAuthentication()");\r
+ return new PasswordAuthentication(user, password.toCharArray());\r
+ }\r
+}\r