From 211348c82f3d4d2e0cf212848693e168c9fac994 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 9 Aug 2012 11:43:33 -0700 Subject: [PATCH] Removed trailing whitespace. --- .../guacamole/io/GuacamoleReader.java | 4 ++-- .../guacamole/io/ReaderGuacamoleReader.java | 22 +++++++++---------- .../guacamole/net/GuacamoleSocket.java | 2 +- .../guacamole/net/GuacamoleTunnel.java | 8 +++---- .../guacamole/net/InetGuacamoleSocket.java | 6 ++--- .../properties/FileGuacamoleProperty.java | 2 +- .../properties/GuacamoleProperties.java | 2 +- .../protocol/ConfiguredGuacamoleSocket.java | 4 ++-- .../protocol/GuacamoleConfiguration.java | 2 +- .../servlet/GuacamoleHTTPTunnelServlet.java | 20 ++++++++--------- .../guacamole/servlet/GuacamoleSession.java | 2 +- 11 files changed, 37 insertions(+), 37 deletions(-) diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/io/GuacamoleReader.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/io/GuacamoleReader.java index db2c1c1ff..c77e186fc 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/io/GuacamoleReader.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/io/GuacamoleReader.java @@ -53,14 +53,14 @@ public interface GuacamoleReader { * this does not guarantee an entire instruction is available. If a full * instruction is not available, this function can return true, and a call * to read() will still block. - * + * * @return true if instruction data is available for reading, false * otherwise. * @throws GuacamoleException If an error occurs while checking for * available data. */ public boolean available() throws GuacamoleException; - + /** * Reads at least one complete Guacamole instruction, returning a buffer * containing one or more complete Guacamole instructions and no diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java index cb35a4ac2..cb57eaaec 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/io/ReaderGuacamoleReader.java @@ -93,7 +93,7 @@ public class ReaderGuacamoleReader implements GuacamoleReader { // Length of element int elementLength = 0; - + // Resume where we left off int i = parseStart; @@ -115,7 +115,7 @@ public class ReaderGuacamoleReader implements GuacamoleReader { // Get terminator char terminator = buffer[i + elementLength]; - + // Move to character after terminator i += elementLength + 1; @@ -139,19 +139,19 @@ public class ReaderGuacamoleReader implements GuacamoleReader { System.arraycopy(buffer, i, buffer, 0, usedLength); return instruction; - + } // Handle invalid terminator characters else if (terminator != ',') throw new GuacamoleServerException("Element terminator of instruction was not ';' nor ','"); - + } // Otherwise, read more data else break; - + } // Otherwise, parse error @@ -189,14 +189,14 @@ public class ReaderGuacamoleReader implements GuacamoleReader { // Get instruction char[] instructionBuffer = read(); - + // If EOF, return EOF if (instructionBuffer == null) return null; - + // Start of element int elementStart = 0; - + // Build list of elements LinkedList elements = new LinkedList(); while (elementStart < instructionBuffer.length) { @@ -232,14 +232,14 @@ public class ReaderGuacamoleReader implements GuacamoleReader { // Append element to list of elements elements.addLast(element); - + // Read terminator after element elementStart += length; char terminator = instructionBuffer[elementStart]; // Continue reading instructions after terminator elementStart++; - + // If we've reached the end of the instruction if (terminator == ';') break; @@ -248,7 +248,7 @@ public class ReaderGuacamoleReader implements GuacamoleReader { // Pull opcode off elements list String opcode = elements.removeFirst(); - + // Create instruction GuacamoleInstruction instruction = new GuacamoleInstruction( Operation.fromOpcode(opcode), diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleSocket.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleSocket.java index 2aa8da52a..2d800fc0e 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleSocket.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleSocket.java @@ -79,7 +79,7 @@ public interface GuacamoleSocket { /** * Returns whether this GuacamoleSocket is open and can be used for reading * and writing. - * + * * @return true if this GuacamoleSocket is open, false otherwise. */ public boolean isOpen(); diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java index 3ed3f1677..134ac07d8 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/GuacamoleTunnel.java @@ -149,7 +149,7 @@ public class GuacamoleTunnel { /** * Returns the GuacamoleSocket used by this GuacamoleTunnel for reading * and writing. - * + * * @return The GuacamoleSocket used by this GuacamoleTunnel. */ public GuacamoleSocket getSocket() { @@ -158,7 +158,7 @@ public class GuacamoleTunnel { /** * Release all resources allocated to this GuacamoleTunnel. - * + * * @throws GuacamoleException if an error occurs while releasing * resources. */ @@ -168,11 +168,11 @@ public class GuacamoleTunnel { /** * Returns whether this GuacamoleTunnel is open, or has been closed. - * + * * @return true if this GuacamoleTunnel is open, false if it is closed. */ public boolean isOpen() { return socket.isOpen(); } - + } diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java index d31e149bf..37e42e8e2 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/net/InetGuacamoleSocket.java @@ -64,7 +64,7 @@ import org.slf4j.LoggerFactory; public class InetGuacamoleSocket implements GuacamoleSocket { private Logger logger = LoggerFactory.getLogger(InetGuacamoleSocket.class); - + private GuacamoleReader reader; private GuacamoleWriter writer; @@ -86,7 +86,7 @@ public class InetGuacamoleSocket implements GuacamoleSocket { try { logger.debug("Connecting to guacd at {}:{}.", hostname, port); - + // Get address SocketAddress address = new InetSocketAddress( InetAddress.getByName(hostname), @@ -136,6 +136,6 @@ public class InetGuacamoleSocket implements GuacamoleSocket { public boolean isOpen() { return !sock.isClosed(); } - + } diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java index 58b3c6626..360cd6b59 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/FileGuacamoleProperty.java @@ -49,7 +49,7 @@ public abstract class FileGuacamoleProperty implements GuacamoleProperty { @Override public File parseValue(String value) throws GuacamoleException { - + // If no property provided, return null. if (value == null) return null; diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java index cb626d54a..a0e98b667 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/properties/GuacamoleProperties.java @@ -141,6 +141,6 @@ public class GuacamoleProperties { throw new GuacamoleServerException("Property " + property.getName() + " is required."); return value; - + } } diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java index d546bc4e3..d361d5040 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/ConfiguredGuacamoleSocket.java @@ -100,7 +100,7 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket { args[i] = value; else args[i] = ""; - + } // Send args @@ -111,7 +111,7 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket { /** * Returns the GuacamoleConfiguration used to configure this * ConfiguredGuacamoleSocket. - * + * * @return The GuacamoleConfiguration used to configure this * ConfiguredGuacamoleSocket. */ diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java index 17096ec02..d199ef0bd 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/protocol/GuacamoleConfiguration.java @@ -49,7 +49,7 @@ import java.util.HashMap; public class GuacamoleConfiguration implements Serializable { private static final long serialVersionUID = 1L; - + private String protocol; private HashMap parameters = new HashMap(); diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java index 626a42e82..1bfc61dbb 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleHTTPTunnelServlet.java @@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory; public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { private Logger logger = LoggerFactory.getLogger(GuacamoleHTTPTunnelServlet.class); - + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException { handleTunnelRequest(request, response); @@ -72,7 +72,7 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { /** * Sends an error on the given HTTP response with the given integer error * code. - * + * * @param response The HTTP response to use to send the error. * @param code The HTTP status code of the error. * @throws ServletException If an error prevents sending of the error @@ -98,7 +98,7 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { } - + /** * Dispatches every HTTP GET and POST request to the appropriate handler * function based on the query string. @@ -132,7 +132,7 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { session.attachTunnel(tunnel); logger.info("Connection from {} succeeded.", request.getRemoteAddr()); - + try { // Send UUID to client response.getWriter().print(tunnel.getUUID().toString()); @@ -140,7 +140,7 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { catch (IOException e) { throw new GuacamoleServerException(e); } - + } // Failed to connect @@ -233,7 +233,7 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { // Ensure tunnel is open if (!tunnel.isOpen()) throw new GuacamoleResourceNotFoundException("Tunnel is closed."); - + // Obtain exclusive read access GuacamoleReader reader = tunnel.acquireReader(); @@ -273,7 +273,7 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { // Close tunnel immediately upon EOF if (message == null) tunnel.close(); - + // End-of-instructions marker out.write("0.;"); out.flush(); @@ -292,11 +292,11 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { // Log typically frequent I/O error if desired logger.debug("Error writing to servlet output stream", e); - + // Detach and close session.detachTunnel(tunnel); tunnel.close(); - + } finally { tunnel.releaseReader(); @@ -345,7 +345,7 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet { char[] buffer = new char[8192]; int length; - while (tunnel.isOpen() && + while (tunnel.isOpen() && (length = input.read(buffer, 0, buffer.length)) != -1) writer.write(buffer, 0, length); diff --git a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java index 808bd0ee0..f89e44bef 100644 --- a/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java +++ b/guacamole-common/src/main/java/net/sourceforge/guacamole/servlet/GuacamoleSession.java @@ -54,7 +54,7 @@ import org.slf4j.LoggerFactory; public class GuacamoleSession { private Logger logger = LoggerFactory.getLogger(GuacamoleSession.class); - + private ConcurrentMap tunnels; /**