mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Fix for read() vs. readInstruction() issue. Consistency with placement of import vs. license
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -22,6 +19,9 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/**
|
||||
* Provides abstract and raw character read access to a stream of Guacamole
|
||||
* instructions.
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -22,6 +19,9 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/**
|
||||
* Provides abstract and raw character write access to a stream of Guacamole
|
||||
* instructions.
|
||||
|
@@ -1,12 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -25,6 +19,12 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
|
||||
/**
|
||||
* A GuacamoleReader which wraps a standard Java Reader, using that Reader as
|
||||
* the Guacamole instruction stream.
|
||||
@@ -54,6 +54,17 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
@Override
|
||||
public char[] read() throws GuacamoleException {
|
||||
|
||||
// If data was previously read via readInstruction(), return remaining
|
||||
// data instead of reading more.
|
||||
if (instructionBuffer != null) {
|
||||
|
||||
char[] chunk = new char[instructionBuffer.length - instructionStart];
|
||||
System.arraycopy(instructionBuffer, instructionStart, chunk, 0, chunk.length);
|
||||
instructionBuffer = null;
|
||||
|
||||
return chunk;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
// While we're blocking, or input is available
|
||||
|
@@ -1,11 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -24,6 +19,11 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/**
|
||||
* A GuacamoleWriter which wraps a standard Java Writer, using that Writer as
|
||||
* the Guacamole instruction stream.
|
||||
|
@@ -1,10 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.net;
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.io.GuacamoleReader;
|
||||
import net.sourceforge.guacamole.io.GuacamoleWriter;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -23,6 +19,10 @@ import net.sourceforge.guacamole.io.GuacamoleWriter;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.io.GuacamoleReader;
|
||||
import net.sourceforge.guacamole.io.GuacamoleWriter;
|
||||
|
||||
/**
|
||||
* Provides abstract socket-like access to a Guacamole connection.
|
||||
*
|
||||
|
@@ -1,8 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.properties;
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -21,6 +19,8 @@ import net.sourceforge.guacamole.GuacamoleException;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
|
||||
/**
|
||||
* An abstract representation of a property in the guacamole.properties file,
|
||||
* which parses into a specific type.
|
||||
|
@@ -1,12 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.protocol;
|
||||
|
||||
import net.sourceforge.guacamole.io.GuacamoleReader;
|
||||
import net.sourceforge.guacamole.io.GuacamoleWriter;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.net.GuacamoleSocket;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -25,6 +19,12 @@ import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import net.sourceforge.guacamole.io.GuacamoleReader;
|
||||
import net.sourceforge.guacamole.io.GuacamoleWriter;
|
||||
import net.sourceforge.guacamole.GuacamoleException;
|
||||
import net.sourceforge.guacamole.net.GuacamoleSocket;
|
||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||
|
||||
/**
|
||||
* A GuacamoleSocket which pre-configures the connection based on a given
|
||||
* GuacamoleConfiguration, completing the initial protocol handshake before
|
||||
|
@@ -1,8 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.protocol;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -21,6 +19,8 @@ import java.util.HashMap;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* All information necessary to complete the initial protocol handshake of a
|
||||
* Guacamole session.
|
||||
|
@@ -1,8 +1,6 @@
|
||||
|
||||
package net.sourceforge.guacamole.protocol;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/*
|
||||
* Guacamole - Clientless Remote Desktop
|
||||
* Copyright (C) 2010 Michael Jumper
|
||||
@@ -21,6 +19,8 @@ import java.util.HashMap;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* An abstract representation of a Guacamole instruction, as defined by the
|
||||
* Guacamole protocol.
|
||||
|
Reference in New Issue
Block a user