mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Remove use of Apache Commons.
This commit is contained in:
@@ -43,13 +43,6 @@
|
|||||||
<version>1.6.1</version>
|
<version>1.6.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Apache Commons -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.0.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@@ -44,7 +44,6 @@ import net.sourceforge.guacamole.GuacamoleException;
|
|||||||
import net.sourceforge.guacamole.GuacamoleServerException;
|
import net.sourceforge.guacamole.GuacamoleServerException;
|
||||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
import net.sourceforge.guacamole.protocol.GuacamoleInstruction;
|
||||||
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
import net.sourceforge.guacamole.protocol.GuacamoleInstruction.Operation;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A GuacamoleReader which wraps a standard Java Reader, using that Reader as
|
* A GuacamoleReader which wraps a standard Java Reader, using that Reader as
|
||||||
@@ -202,8 +201,19 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
|||||||
LinkedList<String> elements = new LinkedList<String>();
|
LinkedList<String> elements = new LinkedList<String>();
|
||||||
while (elementStart < instructionBuffer.length) {
|
while (elementStart < instructionBuffer.length) {
|
||||||
|
|
||||||
// Find end of length
|
// Find end of length
|
||||||
int lengthEnd = ArrayUtils.indexOf(instructionBuffer, '.', elementStart);
|
int lengthEnd = -1;
|
||||||
|
for (int i=elementStart; i<instructionBuffer.length; i++) {
|
||||||
|
if (instructionBuffer[i] == '.') {
|
||||||
|
lengthEnd = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// read() is required to return a complete instruction. If it does
|
||||||
|
// not, this is a severe internal error.
|
||||||
|
if (lengthEnd == -1)
|
||||||
|
throw new GuacamoleServerException("Read returned incomplete instruction.");
|
||||||
|
|
||||||
// Parse length
|
// Parse length
|
||||||
int length = Integer.parseInt(new String(
|
int length = Integer.parseInt(new String(
|
||||||
|
Reference in New Issue
Block a user