commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwins...@apache.org
Subject svn commit: r489397 [5/5] - in /jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java: examples/ examples/nntp/ examples/ntp/ org/apache/commons/net/ org/apache/commons/net/bsd/ org/apache/commons/net/chargen/ org/apache/commons/net/daytime/...
Date Thu, 21 Dec 2006 16:28:56 GMT
Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOption.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOption.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOption.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOption.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.telnet;
 
 /***

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOptionHandler.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2003-2004 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.telnet;
 
 /***

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.telnet;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/TerminalTypeOptionHandler.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2003-2004 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.telnet;
 
 /***

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/telnet/WindowSizeOptionHandler.java Thu Dec 21 08:28:51 2006
@@ -1,182 +1,184 @@
-/*
- * Copyright 2003-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.telnet;
-
-/***
- * Implements the telnet window size option RFC 1073.
- * <p>
- * @author Yuval Kashtan
- * @version $Id$
- ***/
-public class WindowSizeOptionHandler extends TelnetOptionHandler
-{
-    /***
-     * Horizontal Size
-     ***/
-    private int m_nWidth = 80;
-
-    /***
-     * Vertical Size
-     ***/
-    private int m_nHeight = 24;
-
-    /***
-     * Window size option
-     ***/
-    protected static final int WINDOW_SIZE = 31;
-
-    /***
-     * Constructor for the WindowSizeOptionHandler. Allows defining desired
-     * initial setting for local/remote activation of this option and
-     * behaviour in case a local/remote activation request for this
-     * option is received.
-     * <p>
-     * @param nWidth - Window width.
-     * @param nHeight - Window Height
-     * @param initlocal - if set to true, a WILL is sent upon connection.
-     * @param initremote - if set to true, a DO is sent upon connection.
-     * @param acceptlocal - if set to true, any DO request is accepted.
-     * @param acceptremote - if set to true, any WILL request is accepted.
-     ***/
-    public WindowSizeOptionHandler(
-		int nWidth,
-		int nHeight,
-		boolean initlocal,
-		boolean initremote,
-		boolean acceptlocal,
-		boolean acceptremote
-    ) {
-        super (
-			TelnetOption.WINDOW_SIZE,
-			initlocal,
-			initremote,
-			acceptlocal,
-			acceptremote
-		);
-
-		m_nWidth = nWidth;
-		m_nHeight = nHeight;
-	}
-
-    /***
-     * Constructor for the WindowSizeOptionHandler. Initial and accept
-     * behaviour flags are set to false
-     * <p>
-     * @param nWidth - Window width.
-     * @param nHeight - Window Height
-     ***/
-    public WindowSizeOptionHandler(
-		int nWidth,
-		int nHeight
-    ) {
-        super (
-			TelnetOption.WINDOW_SIZE,
-			false,
-			false,
-			false,
-			false
-		);
-
-		m_nWidth = nWidth;
-		m_nHeight = nHeight;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @param suboptionData - the sequence received, whithout IAC SB & IAC SE
-     * @param suboptionLength - the length of data in suboption_data
-     * <p>
-     * @return terminal type information
-     ***/
-    public int[] answerSubnegotiation(int suboptionData[], int suboptionLength)
-    {
-        return null;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * This will send the client Height and Width to the server.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    public int[] startSubnegotiationLocal()
-    {
-		int nCompoundWindowSize = m_nWidth * 0x10000 + m_nHeight;
-		int nResponseSize = 5;
-		int nIndex;
-		int nShift;
-		int nTurnedOnBits;
-
-		if ((m_nWidth % 0x100) == 0xFF) {
-			nResponseSize += 1;
-		}
-
-		if ((m_nWidth / 0x100) == 0xFF) {
-			nResponseSize += 1;
-		}
-
-		if ((m_nHeight % 0x100) == 0xFF) {
-			nResponseSize += 1;
-		}
-
-		if ((m_nHeight / 0x100) == 0xFF) {
-			nResponseSize += 1;
-		}
-
-		//
-		// allocate response array
-		//
-		int response[] = new int[nResponseSize];
-
-		//
-		// Build response array.
-		// ---------------------
-		// 1. put option name.
-		// 2. loop through Window size and fill the values,
-		// 3.    duplicate 'ff' if needed.
-		//
-
-		response[0] = WINDOW_SIZE;							// 1 //
-
-		for (												// 2 //
-			nIndex=1, nShift = 24;
-			nIndex < nResponseSize;
-			nIndex++, nShift -=8
-		) {
-			nTurnedOnBits = 0xFF;
-			nTurnedOnBits <<= nShift;
-			response[nIndex] = ((int)nCompoundWindowSize & nTurnedOnBits) >>> nShift;
-
-			if (response[nIndex] == 0xff) {					// 3 //
-				nIndex++;
-				response[nIndex] = 0xff;
-			}
-		}
-
-		return response;
-    }
-
-    /***
-     * Implements the abstract method of TelnetOptionHandler.
-     * <p>
-     * @return always null (no response to subnegotiation)
-     ***/
-    public int[] startSubnegotiationRemote()
-    {
-        return null;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.telnet;
+
+/***
+ * Implements the telnet window size option RFC 1073.
+ * <p>
+ * @author Yuval Kashtan
+ * @version $Id$
+ ***/
+public class WindowSizeOptionHandler extends TelnetOptionHandler
+{
+    /***
+     * Horizontal Size
+     ***/
+    private int m_nWidth = 80;
+
+    /***
+     * Vertical Size
+     ***/
+    private int m_nHeight = 24;
+
+    /***
+     * Window size option
+     ***/
+    protected static final int WINDOW_SIZE = 31;
+
+    /***
+     * Constructor for the WindowSizeOptionHandler. Allows defining desired
+     * initial setting for local/remote activation of this option and
+     * behaviour in case a local/remote activation request for this
+     * option is received.
+     * <p>
+     * @param nWidth - Window width.
+     * @param nHeight - Window Height
+     * @param initlocal - if set to true, a WILL is sent upon connection.
+     * @param initremote - if set to true, a DO is sent upon connection.
+     * @param acceptlocal - if set to true, any DO request is accepted.
+     * @param acceptremote - if set to true, any WILL request is accepted.
+     ***/
+    public WindowSizeOptionHandler(
+		int nWidth,
+		int nHeight,
+		boolean initlocal,
+		boolean initremote,
+		boolean acceptlocal,
+		boolean acceptremote
+    ) {
+        super (
+			TelnetOption.WINDOW_SIZE,
+			initlocal,
+			initremote,
+			acceptlocal,
+			acceptremote
+		);
+
+		m_nWidth = nWidth;
+		m_nHeight = nHeight;
+	}
+
+    /***
+     * Constructor for the WindowSizeOptionHandler. Initial and accept
+     * behaviour flags are set to false
+     * <p>
+     * @param nWidth - Window width.
+     * @param nHeight - Window Height
+     ***/
+    public WindowSizeOptionHandler(
+		int nWidth,
+		int nHeight
+    ) {
+        super (
+			TelnetOption.WINDOW_SIZE,
+			false,
+			false,
+			false,
+			false
+		);
+
+		m_nWidth = nWidth;
+		m_nHeight = nHeight;
+    }
+
+    /***
+     * Implements the abstract method of TelnetOptionHandler.
+     * <p>
+     * @param suboptionData - the sequence received, whithout IAC SB & IAC SE
+     * @param suboptionLength - the length of data in suboption_data
+     * <p>
+     * @return terminal type information
+     ***/
+    public int[] answerSubnegotiation(int suboptionData[], int suboptionLength)
+    {
+        return null;
+    }
+
+    /***
+     * Implements the abstract method of TelnetOptionHandler.
+     * This will send the client Height and Width to the server.
+     * <p>
+     * @return always null (no response to subnegotiation)
+     ***/
+    public int[] startSubnegotiationLocal()
+    {
+		int nCompoundWindowSize = m_nWidth * 0x10000 + m_nHeight;
+		int nResponseSize = 5;
+		int nIndex;
+		int nShift;
+		int nTurnedOnBits;
+
+		if ((m_nWidth % 0x100) == 0xFF) {
+			nResponseSize += 1;
+		}
+
+		if ((m_nWidth / 0x100) == 0xFF) {
+			nResponseSize += 1;
+		}
+
+		if ((m_nHeight % 0x100) == 0xFF) {
+			nResponseSize += 1;
+		}
+
+		if ((m_nHeight / 0x100) == 0xFF) {
+			nResponseSize += 1;
+		}
+
+		//
+		// allocate response array
+		//
+		int response[] = new int[nResponseSize];
+
+		//
+		// Build response array.
+		// ---------------------
+		// 1. put option name.
+		// 2. loop through Window size and fill the values,
+		// 3.    duplicate 'ff' if needed.
+		//
+
+		response[0] = WINDOW_SIZE;							// 1 //
+
+		for (												// 2 //
+			nIndex=1, nShift = 24;
+			nIndex < nResponseSize;
+			nIndex++, nShift -=8
+		) {
+			nTurnedOnBits = 0xFF;
+			nTurnedOnBits <<= nShift;
+			response[nIndex] = ((int)nCompoundWindowSize & nTurnedOnBits) >>> nShift;
+
+			if (response[nIndex] == 0xff) {					// 3 //
+				nIndex++;
+				response[nIndex] = 0xff;
+			}
+		}
+
+		return response;
+    }
+
+    /***
+     * Implements the abstract method of TelnetOptionHandler.
+     * <p>
+     * @return always null (no response to subnegotiation)
+     ***/
+    public int[] startSubnegotiationRemote()
+    {
+        return null;
+    }
+}

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTP.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTP.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTP.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTP.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.net.DatagramPacket;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.io.IOException;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.net.DatagramPacket;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.net.DatagramPacket;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.net.DatagramPacket;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacketException.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacketException.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacketException.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPPacketException.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 /***

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.net.DatagramPacket;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.net.DatagramPacket;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPWriteRequestPacket.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPWriteRequestPacket.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPWriteRequestPacket.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/tftp/TFTPWriteRequestPacket.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.tftp;
 
 import java.net.DatagramPacket;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeTCPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeTCPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeTCPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeTCPClient.java Thu Dec 21 08:28:51 2006
@@ -1,107 +1,109 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.time;
-
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.util.Date;
-
-import org.apache.commons.net.SocketClient;
-
-/***
- * The TimeTCPClient class is a TCP implementation of a client for the
- * Time protocol described in RFC 868.  To use the class, merely
- * establish a connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call either {@link #getTime  getTime() } or
- * {@link #getDate  getDate() } to retrieve the time, then
- * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to close the connection properly.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see TimeUDPClient
- ***/
-
-public final class TimeTCPClient extends SocketClient
-{
-    /*** The default time port.  It is set to 37 according to RFC 868. ***/
-    public static final int DEFAULT_PORT = 37;
-
-    /***
-     * The number of seconds between 00:00 1 January 1900 and
-     * 00:00 1 January 1970.  This value can be useful for converting
-     * time values to other formats.
-     ***/
-    public static final long SECONDS_1900_TO_1970 = 2208988800L;
-
-    /***
-     * The default TimeTCPClient constructor.  It merely sets the default
-     * port to <code> DEFAULT_PORT </code>.
-     ***/
-    public TimeTCPClient ()
-    {
-        setDefaultPort(DEFAULT_PORT);
-    }
-
-    /***
-     * Retrieves the time from the server and returns it.  The time
-     * is the number of seconds since 00:00 (midnight) 1 January 1900 GMT,
-     * as specified by RFC 868.  This method reads the raw 32-bit big-endian
-     * unsigned integer from the server, converts it to a Java long, and
-     * returns the value.
-     * <p>
-     * The server will have closed the connection at this point, so you should
-     * call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * after calling this method.  To retrieve another time, you must
-     * initiate another connection with
-     * {@link org.apache.commons.net.SocketClient#connect  connect }
-     * before calling <code> getTime() </code> again.
-     * <p>
-     * @return The time value retrieved from the server.
-     * @exception IOException  If an error occurs while fetching the time.
-     ***/
-    public long getTime() throws IOException
-    {
-        DataInputStream input;
-        input = new DataInputStream(_input_);
-        return (long)(input.readInt() & 0xffffffffL);
-    }
-
-    /***
-     * Retrieves the time from the server and returns a Java Date
-     * containing the time converted to the local timezone.
-     * <p>
-     * The server will have closed the connection at this point, so you should
-     * call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * after calling this method.  To retrieve another time, you must
-     * initiate another connection with
-     * {@link org.apache.commons.net.SocketClient#connect  connect }
-     * before calling <code> getDate() </code> again.
-     * <p>
-     * @return A Date value containing the time retrieved from the server
-     *     converted to the local timezone.
-     * @exception IOException  If an error occurs while fetching the time.
-     ***/
-    public Date getDate() throws IOException
-    {
-        return new Date((getTime() - SECONDS_1900_TO_1970)*1000L);
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.time;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.util.Date;
+
+import org.apache.commons.net.SocketClient;
+
+/***
+ * The TimeTCPClient class is a TCP implementation of a client for the
+ * Time protocol described in RFC 868.  To use the class, merely
+ * establish a connection with
+ * {@link org.apache.commons.net.SocketClient#connect  connect }
+ * and call either {@link #getTime  getTime() } or
+ * {@link #getDate  getDate() } to retrieve the time, then
+ * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+ * to close the connection properly.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see TimeUDPClient
+ ***/
+
+public final class TimeTCPClient extends SocketClient
+{
+    /*** The default time port.  It is set to 37 according to RFC 868. ***/
+    public static final int DEFAULT_PORT = 37;
+
+    /***
+     * The number of seconds between 00:00 1 January 1900 and
+     * 00:00 1 January 1970.  This value can be useful for converting
+     * time values to other formats.
+     ***/
+    public static final long SECONDS_1900_TO_1970 = 2208988800L;
+
+    /***
+     * The default TimeTCPClient constructor.  It merely sets the default
+     * port to <code> DEFAULT_PORT </code>.
+     ***/
+    public TimeTCPClient ()
+    {
+        setDefaultPort(DEFAULT_PORT);
+    }
+
+    /***
+     * Retrieves the time from the server and returns it.  The time
+     * is the number of seconds since 00:00 (midnight) 1 January 1900 GMT,
+     * as specified by RFC 868.  This method reads the raw 32-bit big-endian
+     * unsigned integer from the server, converts it to a Java long, and
+     * returns the value.
+     * <p>
+     * The server will have closed the connection at this point, so you should
+     * call
+     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+     * after calling this method.  To retrieve another time, you must
+     * initiate another connection with
+     * {@link org.apache.commons.net.SocketClient#connect  connect }
+     * before calling <code> getTime() </code> again.
+     * <p>
+     * @return The time value retrieved from the server.
+     * @exception IOException  If an error occurs while fetching the time.
+     ***/
+    public long getTime() throws IOException
+    {
+        DataInputStream input;
+        input = new DataInputStream(_input_);
+        return (long)(input.readInt() & 0xffffffffL);
+    }
+
+    /***
+     * Retrieves the time from the server and returns a Java Date
+     * containing the time converted to the local timezone.
+     * <p>
+     * The server will have closed the connection at this point, so you should
+     * call
+     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
+     * after calling this method.  To retrieve another time, you must
+     * initiate another connection with
+     * {@link org.apache.commons.net.SocketClient#connect  connect }
+     * before calling <code> getDate() </code> again.
+     * <p>
+     * @return A Date value containing the time retrieved from the server
+     *     converted to the local timezone.
+     * @exception IOException  If an error occurs while fetching the time.
+     ***/
+    public Date getDate() throws IOException
+    {
+        return new Date((getTime() - SECONDS_1900_TO_1970)*1000L);
+    }
+
+}
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeUDPClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeUDPClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeUDPClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/time/TimeUDPClient.java Thu Dec 21 08:28:51 2006
@@ -1,125 +1,127 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.time;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-import java.util.Date;
-
-import org.apache.commons.net.DatagramSocketClient;
-
-/***
- * The TimeUDPClient class is a UDP implementation of a client for the
- * Time protocol described in RFC 868.  To use the class, merely
- * open a local datagram socket with
- * {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #getTime  getTime } or
- * {@link #getTime  getDate } to retrieve the time. Then call
- * {@link org.apache.commons.net.DatagramSocketClient#close  close }
- * to close the connection properly.  Unlike
- * {@link org.apache.commons.net.time.TimeTCPClient},
- * successive calls to {@link #getTime  getTime } or
- * {@link #getDate  getDate } are permitted
- * without re-establishing a connection.  That is because UDP is a
- * connectionless protocol and the Time protocol is stateless.
- * <p>
- * <p>
- * @author Daniel F. Savarese
- * @see TimeTCPClient
- ***/
-
-public final class TimeUDPClient extends DatagramSocketClient
-{
-    /*** The default time port.  It is set to 37 according to RFC 868. ***/
-    public static final int DEFAULT_PORT = 37;
-
-    /***
-     * The number of seconds between 00:00 1 January 1900 and
-     * 00:00 1 January 1970.  This value can be useful for converting
-     * time values to other formats.
-     ***/
-    public static final long SECONDS_1900_TO_1970 = 2208988800L;
-
-    private byte[] __dummyData = new byte[1];
-    private byte[] __timeData = new byte[4];
-
-    /***
-     * Retrieves the time from the specified server and port and
-     * returns it. The time is the number of seconds since
-     * 00:00 (midnight) 1 January 1900 GMT, as specified by RFC 868.
-     * This method reads the raw 32-bit big-endian
-     * unsigned integer from the server, converts it to a Java long, and
-     * returns the value.
-     * <p>
-     * @param host The address of the server.
-     * @param port The port of the service.
-     * @return The time value retrieved from the server.
-     * @exception IOException If an error occurs while retrieving the time.
-     ***/
-    public long getTime(InetAddress host, int port) throws IOException
-    {
-        long time;
-        DatagramPacket sendPacket, receivePacket;
-
-        sendPacket =
-            new DatagramPacket(__dummyData, __dummyData.length, host, port);
-        receivePacket = new DatagramPacket(__timeData, __timeData.length);
-
-        _socket_.send(sendPacket);
-        _socket_.receive(receivePacket);
-
-        time = 0L;
-        time |= (((__timeData[0] & 0xff) << 24) & 0xffffffffL);
-        time |= (((__timeData[1] & 0xff) << 16) & 0xffffffffL);
-        time |= (((__timeData[2] & 0xff) << 8) & 0xffffffffL);
-        time |= ((__timeData[3] & 0xff) & 0xffffffffL);
-
-        return time;
-    }
-
-    /*** Same as <code> getTime(host, DEFAULT_PORT); </code> ***/
-    public long getTime(InetAddress host) throws IOException
-    {
-        return getTime(host, DEFAULT_PORT);
-    }
-
-
-    /***
-     * Retrieves the time from the server and returns a Java Date
-     * containing the time converted to the local timezone.
-     * <p>
-     * @param host The address of the server.
-     * @param port The port of the service.
-     * @return A Date value containing the time retrieved from the server
-     *     converted to the local timezone.
-     * @exception IOException  If an error occurs while fetching the time.
-     ***/
-    public Date getDate(InetAddress host, int port) throws IOException
-    {
-        return new Date((getTime(host, port) - SECONDS_1900_TO_1970)*1000L);
-    }
-
-
-    /*** Same as <code> getTime(host, DEFAULT_PORT); </code> ***/
-    public Date getDate(InetAddress host) throws IOException
-    {
-        return new Date((getTime(host, DEFAULT_PORT) -
-                         SECONDS_1900_TO_1970)*1000L);
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.time;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetAddress;
+import java.util.Date;
+
+import org.apache.commons.net.DatagramSocketClient;
+
+/***
+ * The TimeUDPClient class is a UDP implementation of a client for the
+ * Time protocol described in RFC 868.  To use the class, merely
+ * open a local datagram socket with
+ * {@link org.apache.commons.net.DatagramSocketClient#open  open }
+ * and call {@link #getTime  getTime } or
+ * {@link #getTime  getDate } to retrieve the time. Then call
+ * {@link org.apache.commons.net.DatagramSocketClient#close  close }
+ * to close the connection properly.  Unlike
+ * {@link org.apache.commons.net.time.TimeTCPClient},
+ * successive calls to {@link #getTime  getTime } or
+ * {@link #getDate  getDate } are permitted
+ * without re-establishing a connection.  That is because UDP is a
+ * connectionless protocol and the Time protocol is stateless.
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ * @see TimeTCPClient
+ ***/
+
+public final class TimeUDPClient extends DatagramSocketClient
+{
+    /*** The default time port.  It is set to 37 according to RFC 868. ***/
+    public static final int DEFAULT_PORT = 37;
+
+    /***
+     * The number of seconds between 00:00 1 January 1900 and
+     * 00:00 1 January 1970.  This value can be useful for converting
+     * time values to other formats.
+     ***/
+    public static final long SECONDS_1900_TO_1970 = 2208988800L;
+
+    private byte[] __dummyData = new byte[1];
+    private byte[] __timeData = new byte[4];
+
+    /***
+     * Retrieves the time from the specified server and port and
+     * returns it. The time is the number of seconds since
+     * 00:00 (midnight) 1 January 1900 GMT, as specified by RFC 868.
+     * This method reads the raw 32-bit big-endian
+     * unsigned integer from the server, converts it to a Java long, and
+     * returns the value.
+     * <p>
+     * @param host The address of the server.
+     * @param port The port of the service.
+     * @return The time value retrieved from the server.
+     * @exception IOException If an error occurs while retrieving the time.
+     ***/
+    public long getTime(InetAddress host, int port) throws IOException
+    {
+        long time;
+        DatagramPacket sendPacket, receivePacket;
+
+        sendPacket =
+            new DatagramPacket(__dummyData, __dummyData.length, host, port);
+        receivePacket = new DatagramPacket(__timeData, __timeData.length);
+
+        _socket_.send(sendPacket);
+        _socket_.receive(receivePacket);
+
+        time = 0L;
+        time |= (((__timeData[0] & 0xff) << 24) & 0xffffffffL);
+        time |= (((__timeData[1] & 0xff) << 16) & 0xffffffffL);
+        time |= (((__timeData[2] & 0xff) << 8) & 0xffffffffL);
+        time |= ((__timeData[3] & 0xff) & 0xffffffffL);
+
+        return time;
+    }
+
+    /*** Same as <code> getTime(host, DEFAULT_PORT); </code> ***/
+    public long getTime(InetAddress host) throws IOException
+    {
+        return getTime(host, DEFAULT_PORT);
+    }
+
+
+    /***
+     * Retrieves the time from the server and returns a Java Date
+     * containing the time converted to the local timezone.
+     * <p>
+     * @param host The address of the server.
+     * @param port The port of the service.
+     * @return A Date value containing the time retrieved from the server
+     *     converted to the local timezone.
+     * @exception IOException  If an error occurs while fetching the time.
+     ***/
+    public Date getDate(InetAddress host, int port) throws IOException
+    {
+        return new Date((getTime(host, port) - SECONDS_1900_TO_1970)*1000L);
+    }
+
+
+    /*** Same as <code> getTime(host, DEFAULT_PORT); </code> ***/
+    public Date getDate(InetAddress host) throws IOException
+    {
+        return new Date((getTime(host, DEFAULT_PORT) -
+                         SECONDS_1900_TO_1970)*1000L);
+    }
+
+}
+

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/util/ListenerList.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/util/ListenerList.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/util/ListenerList.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/util/ListenerList.java Thu Dec 21 08:28:51 2006
@@ -1,11 +1,12 @@
 /*
- * Copyright 2001-2006 The Apache Software Foundation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.net.util;
 
 import java.io.Serializable;

Modified: jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/whois/WhoisClient.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/whois/WhoisClient.java?view=diff&rev=489397&r1=489396&r2=489397
==============================================================================
--- jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/whois/WhoisClient.java (original)
+++ jakarta/commons/proper/net/branches/JDK_1_5_BRANCH/src/main/java/org/apache/commons/net/whois/WhoisClient.java Thu Dec 21 08:28:51 2006
@@ -1,107 +1,109 @@
-/*
- * Copyright 2001-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.net.whois;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.commons.net.finger.FingerClient;
-
-/***
- * The WhoisClient class implements the client side of the Internet Whois
- * Protocol defined in RFC 954.   To query a host you create a
- * WhoisClient instance, connect to the host, query the host, and finally
- * disconnect from the host.  If the whois service you want to query is on
- * a non-standard port, connect to the host at that port.
- * Here's a sample use:
- * <pre>
- *    WhoisClient whois;
- *
- *    whois = new WhoisClient();
- *
- *    try {
- *      whois.connect(WhoisClient.DEFAULT_HOST);
- *      System.out.println(whois.query("foobar"));
- *      whois.disconnect();
- *    } catch(IOException e) {
- *      System.err.println("Error I/O exception: " + e.getMessage());
- *      return;
- *    }
- * </pre>
- *
- * <p>
- * <p>
- * @author Daniel F. Savarese
- ***/
-
-public final class WhoisClient extends FingerClient
-{
-    /***
-     * The default whois host to query.  It is set to whois.internic.net.
-     ***/
-    public static final String DEFAULT_HOST = "whois.internic.net";
-
-    /***
-     * The default whois port.  It is set to 43 according to RFC 954.
-     ***/
-    public static final int DEFAULT_PORT = 43;
-
-
-    /***
-     * The default whois constructor.    Initializes the
-     * default port to <code> DEFAULT_PORT </code>.
-     ***/
-    public WhoisClient()
-    {
-        setDefaultPort(DEFAULT_PORT);
-    }
-
-    /***
-     * Queries the connected whois server for information regarding
-     * the given handle.  It is up to the programmer to be familiar with the
-     * handle syntax of the whois server.  You must first connect to a whois
-     * server before calling this method, and you should disconnect afterward.
-     * <p>
-     * @param handle  The handle to lookup.
-     * @return The result of the whois query.
-     * @exception IOException  If an I/O error occurs during the operation.
-     ***/
-    public String query(String handle) throws IOException
-    {
-        return query(false, handle);
-    }
-
-
-    /***
-     * Queries the connected whois server for information regarding
-     * the given handle and returns the InputStream of the network connection.
-     * It is up to the programmer to be familiar with the handle syntax
-     * of the whois server.  You must first connect to a finger server before
-     * calling this method, and you should disconnect after finishing reading
-     * the stream.
-     * <p>
-     * @param handle  The handle to lookup.
-     * @return The InputStream of the network connection of the whois query.
-     *         Can be read to obtain whois results.
-     * @exception IOException  If an I/O error occurs during the operation.
-     ***/
-    public InputStream getInputStream(String handle) throws IOException
-    {
-        return getInputStream(false, handle);
-    }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.whois;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.net.finger.FingerClient;
+
+/***
+ * The WhoisClient class implements the client side of the Internet Whois
+ * Protocol defined in RFC 954.   To query a host you create a
+ * WhoisClient instance, connect to the host, query the host, and finally
+ * disconnect from the host.  If the whois service you want to query is on
+ * a non-standard port, connect to the host at that port.
+ * Here's a sample use:
+ * <pre>
+ *    WhoisClient whois;
+ *
+ *    whois = new WhoisClient();
+ *
+ *    try {
+ *      whois.connect(WhoisClient.DEFAULT_HOST);
+ *      System.out.println(whois.query("foobar"));
+ *      whois.disconnect();
+ *    } catch(IOException e) {
+ *      System.err.println("Error I/O exception: " + e.getMessage());
+ *      return;
+ *    }
+ * </pre>
+ *
+ * <p>
+ * <p>
+ * @author Daniel F. Savarese
+ ***/
+
+public final class WhoisClient extends FingerClient
+{
+    /***
+     * The default whois host to query.  It is set to whois.internic.net.
+     ***/
+    public static final String DEFAULT_HOST = "whois.internic.net";
+
+    /***
+     * The default whois port.  It is set to 43 according to RFC 954.
+     ***/
+    public static final int DEFAULT_PORT = 43;
+
+
+    /***
+     * The default whois constructor.    Initializes the
+     * default port to <code> DEFAULT_PORT </code>.
+     ***/
+    public WhoisClient()
+    {
+        setDefaultPort(DEFAULT_PORT);
+    }
+
+    /***
+     * Queries the connected whois server for information regarding
+     * the given handle.  It is up to the programmer to be familiar with the
+     * handle syntax of the whois server.  You must first connect to a whois
+     * server before calling this method, and you should disconnect afterward.
+     * <p>
+     * @param handle  The handle to lookup.
+     * @return The result of the whois query.
+     * @exception IOException  If an I/O error occurs during the operation.
+     ***/
+    public String query(String handle) throws IOException
+    {
+        return query(false, handle);
+    }
+
+
+    /***
+     * Queries the connected whois server for information regarding
+     * the given handle and returns the InputStream of the network connection.
+     * It is up to the programmer to be familiar with the handle syntax
+     * of the whois server.  You must first connect to a finger server before
+     * calling this method, and you should disconnect after finishing reading
+     * the stream.
+     * <p>
+     * @param handle  The handle to lookup.
+     * @return The InputStream of the network connection of the whois query.
+     *         Can be read to obtain whois results.
+     * @exception IOException  If an I/O error occurs during the operation.
+     ***/
+    public InputStream getInputStream(String handle) throws IOException
+    {
+        return getInputStream(false, handle);
+    }
+
+}
+



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message