Package org.globus.io.gass.server
Class GassClientHandler
java.lang.Object
org.globus.io.gass.server.GassClientHandler
- All Implemented Interfaces:
Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final boolean
private static final String
private static final String
private static final String
private static org.apache.commons.logging.Log
private static final String
private static final String
private int
private GassServer
private static final String
private Socket
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private String
decodeUrlPath
(String path) private long
Convert a String representing a hex number to a long.private OutputStream
pickOutputStream
(String path, String str, OutputStream def) private String
readLine
(InputStream in) Read a line of text from the given Stream and return it as a String.void
run()
Listen on the server socket for a client, start another thread to keep listening on the server socket, then deal with the client.private void
transfer
(InputStream is, String path, boolean append, OutputStream outs) Transfer from the given InputStream to a file, given its path.private void
transfer
(OutputStream os, String path) Transfer from a file, given its path, to the given OutputStream.private void
write
(OutputStream out, String msg) private void
writeln
(OutputStream out, String msg)
-
Field Details
-
logger
private static org.apache.commons.logging.Log logger -
DEBUG_ON
private static final boolean DEBUG_ON- See Also:
-
CRLF
- See Also:
-
OKHEADER
- See Also:
-
SERVER
- See Also:
-
CONTENT_LENGTH
- See Also:
-
TRANSFER_ENCODING
- See Also:
-
JAVA_CLIENT
- See Also:
-
HTTP_CONTINUE
- See Also:
-
CONTENT_BINARY
- See Also:
-
CONTENT_HTML
- See Also:
-
CONTENT_TEXT
- See Also:
-
CONNECTION_CLOSE
- See Also:
-
HEADER404
- See Also:
-
MSG404
- See Also:
-
BUFFER_SIZE
private int BUFFER_SIZE -
server
-
socket
-
options
private int options
-
-
Constructor Details
-
GassClientHandler
-
-
Method Details
-
write
- Throws:
IOException
-
writeln
- Throws:
IOException
-
run
public void run()Listen on the server socket for a client, start another thread to keep listening on the server socket, then deal with the client. -
decodeUrlPath
-
transfer
Transfer from a file, given its path, to the given OutputStream. The BufferedWriter points to the same stream but is used to write HTTP header information.- Throws:
IOException
-
pickOutputStream
-
transfer
private void transfer(InputStream is, String path, boolean append, OutputStream outs) throws IOException Transfer from the given InputStream to a file, given its path. The Reader points to the same stream but is used to read the HTTP header information.- Throws:
IOException
-
readLine
Read a line of text from the given Stream and return it as a String. Assumes lines end in CRLF.- Throws:
IOException
-
fromHex
Convert a String representing a hex number to a long. -
debug
-