Author: sebb
Date: Fri May 16 16:01:51 2008
New Revision: 657245
URL: http://svn.apache.org/viewvc?rev=657245&view=rev
Log:
NET-194 - replace Exception with IOException
Also fixup Javadoc formatting
Modified:
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/Telnet.java
Modified:
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/Telnet.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/Telnet.java?rev=657245&r1=657244&r2=657245&view=diff
==============================================================================
---
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/Telnet.java
(original)
+++
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/telnet/Telnet.java
Fri May 16 16:01:51 2008
@@ -19,9 +19,8 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
-import java.io.IOException;
import java.io.OutputStream;
-
+import java.io.IOException;
import org.apache.commons.net.SocketClient;
/**
@@ -284,7 +283,7 @@
{
_sendSubnegotiation(subneg);
}
- catch (Exception e)
+ catch (IOException e)
{
System.err.println(
"Exception in option subnegotiation"
@@ -321,7 +320,7 @@
{
_sendSubnegotiation(subneg);
}
- catch (Exception e)
+ catch (IOException e)
{
System.err.println("Exception in option subnegotiation"
+ e.getMessage());
@@ -406,13 +405,12 @@
_options[option] &= ~_REQUESTED_DO_MASK;
}
- /***
+ /**
* Processes a DO request.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - option code to be set.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
void _processDo(int option) throws IOException
{
if (debugoptions)
@@ -504,13 +502,12 @@
_setWill(option);
}
- /***
+ /**
* Processes a DONT request.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - option code to be set.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
void _processDont(int option) throws IOException
{
if (debugoptions)
@@ -558,13 +555,12 @@
}
- /***
+ /**
* Processes a WILL request.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - option code to be set.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
void _processWill(int option) throws IOException
{
if (debugoptions)
@@ -625,13 +621,12 @@
_setDo(option);
}
- /***
+ /**
* Processes a WONT request.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - option code to be set.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
void _processWont(int option) throws IOException
{
if (debugoptions)
@@ -681,14 +676,13 @@
}
/* TERMINAL-TYPE option (start)*/
- /***
+ /**
* Processes a suboption negotiation.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param suboption - subnegotiation data received
* @param suboptionLength - length of data received
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
void _processSuboption(int suboption[], int suboptionLength)
throws IOException
{
@@ -755,13 +749,12 @@
/* TERMINAL-TYPE option (end)*/
/* open TelnetOptionHandler functionality (start)*/
- /***
+ /**
* Manages subnegotiation for Terminal Type.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param subn - subnegotiation data to be sent
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _sendSubnegotiation(int subn[])
throws IOException
{
@@ -810,7 +803,7 @@
{
aytMonitor.notifyAll();
}
- catch (Exception e)
+ catch (IllegalMonitorStateException e)
{
System.err.println("Exception notifying:" +
e.getMessage());
}
@@ -882,13 +875,12 @@
/* open TelnetOptionHandler functionality (end)*/
}
- /***
+ /**
* Sends a DO.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _sendDo(int option)
throws IOException
{
@@ -904,13 +896,12 @@
/* Code Section added for sending the negotiation ASAP (end)*/
}
- /***
+ /**
* Requests a DO.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _requestDo(int option)
throws IOException
{
@@ -924,13 +915,12 @@
_sendDo(option);
}
- /***
+ /**
* Sends a DONT.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _sendDont(int option)
throws IOException
{
@@ -946,13 +936,12 @@
/* Code Section added for sending the negotiation ASAP (end)*/
}
- /***
+ /**
* Requests a DONT.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _requestDont(int option)
throws IOException
{
@@ -967,13 +956,12 @@
}
- /***
+ /**
* Sends a WILL.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _sendWill(int option)
throws IOException
{
@@ -989,13 +977,12 @@
/* Code Section added for sending the negotiation ASAP (end)*/
}
- /***
+ /**
* Requests a WILL.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _requestWill(int option)
throws IOException
{
@@ -1009,13 +996,12 @@
_sendWill(option);
}
- /***
+ /**
* Sends a WONT.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _sendWont(int option)
throws IOException
{
@@ -1031,13 +1017,12 @@
/* Code Section added for sending the negotiation ASAP (end)*/
}
- /***
+ /**
* Requests a WONT.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param option - Option code.
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _requestWont(int option)
throws IOException
{
@@ -1051,13 +1036,12 @@
_sendWont(option);
}
- /***
+ /**
* Sends a byte.
- * <p>
- * @throws IOException - Exception in I/O.
- * <p>
+ *
* @param b - byte to send
- ***/
+ * @throws IOException - Exception in I/O.
+ **/
final synchronized void _sendByte(int b)
throws IOException
{
@@ -1070,17 +1054,15 @@
}
/* Code Section added for supporting AYT (start)*/
- /***
+ /**
* Sends an Are You There sequence and waits for the result.
- * <p>
+ *
+ * @param timeout - Time to wait for a response (millis.)
* @throws IOException - Exception in I/O.
* @throws IllegalArgumentException - Illegal argument
* @throws InterruptedException - Interrupted during wait.
- * <p>
- * @param timeout - Time to wait for a response (millis.)
- * <p>
* @return true if AYT received a response, false otherwise
- ***/
+ **/
final boolean _sendAYT(long timeout)
throws IOException, IllegalArgumentException, InterruptedException
{
@@ -1120,13 +1102,12 @@
/* open TelnetOptionHandler functionality (start)*/
- /***
+ /**
* Registers a new TelnetOptionHandler for this telnet to use.
- * <p>
- * @throws InvalidTelnetOptionException - The option code is invalid.
- * <p>
+ *
* @param opthand - option handler to be registered.
- ***/
+ * @throws InvalidTelnetOptionException - The option code is invalid.
+ **/
void addOptionHandler(TelnetOptionHandler opthand)
throws InvalidTelnetOptionException
{
@@ -1180,13 +1161,12 @@
}
}
- /***
+ /**
* Unregisters a TelnetOptionHandler.
- * <p>
- * @throws InvalidTelnetOptionException - The option code is invalid.
- * <p>
+ *
* @param optcode - Code of the option to be unregistered.
- ***/
+ * @throws InvalidTelnetOptionException - The option code is invalid.
+ **/
void deleteOptionHandler(int optcode)
throws InvalidTelnetOptionException
{
@@ -1282,7 +1262,7 @@
spyStream.flush();
}
}
- catch (Exception e)
+ catch (IOException e)
{
spyStream = null;
}
@@ -1306,7 +1286,7 @@
spyStream.write(ch);
spyStream.flush();
}
- catch (Exception e)
+ catch (IOException e)
{
spyStream = null;
}