Removed spurios throws

This commit is contained in:
Gideon le Grange 2016-02-03 21:43:22 +02:00
parent 2510c1211c
commit d7e058a626
2 changed files with 5 additions and 6 deletions

View File

@ -72,17 +72,16 @@ public abstract class ApiConnection implements AutoCloseable {
* *
* @param username - username of the user on the router * @param username - username of the user on the router
* @param password - password for the user * @param password - password for the user
* @throws me.legrange.mikrotik.MikrotikApiException * @throws me.legrange.mikrotik.MikrotikApiException Thrown if the API encounters an error on login.
* @throws java.lang.InterruptedException
*/ */
public abstract void login(String username, String password) throws MikrotikApiException, InterruptedException; public abstract void login(String username, String password) throws MikrotikApiException;
/** /**
* execute a command and return a list of results. * execute a command and return a list of results.
* *
* @param cmd Command to execute * @param cmd Command to execute
* @return The list of results * @return The list of results
* @throws me.legrange.mikrotik.MikrotikApiException * @throws me.legrange.mikrotik.MikrotikApiException Thrown if the API encounters an error executing a command.
*/ */
public abstract List<Map<String, String>> execute(String cmd) throws MikrotikApiException; public abstract List<Map<String, String>> execute(String cmd) throws MikrotikApiException;
@ -92,7 +91,7 @@ public abstract class ApiConnection implements AutoCloseable {
* @param cmd Command to execute * @param cmd Command to execute
* @param lis ResultListener that will receive the results * @param lis ResultListener that will receive the results
* @return A command object that can be used to cancel the command. * @return A command object that can be used to cancel the command.
* @throws MikrotikApiException * @throws me.legrange.mikrotik.MikrotikApiException Thrown if the API encounters an error executing a command.
*/ */
public abstract String execute(String cmd, ResultListener lis) throws MikrotikApiException; public abstract String execute(String cmd, ResultListener lis) throws MikrotikApiException;

View File

@ -51,7 +51,7 @@ public final class ApiConnectionImpl extends ApiConnection {
} }
@Override @Override
public void login(String username, String password) throws MikrotikApiException, InterruptedException { public void login(String username, String password) throws MikrotikApiException {
if (username.trim().isEmpty()) { if (username.trim().isEmpty()) {
throw new ApiConnectionException("API username cannot be empty"); throw new ApiConnectionException("API username cannot be empty");
} }