Class GassClientHandler
java.lang.Object
org.globus.io.gass.server.GassClientHandler
- All Implemented Interfaces:
Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final booleanprivate static final Stringprivate static final Stringprivate static final Stringprivate static org.apache.commons.logging.Logprivate static final Stringprivate static final Stringprivate intprivate GassServerprivate static final Stringprivate Socketprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate StringdecodeUrlPath(String path) private longConvert a String representing a hex number to a long.private OutputStreampickOutputStream(String path, String str, OutputStream def) private StringreadLine(InputStream in) Read a line of text from the given Stream and return it as a String.voidrun()Listen on the server socket for a client, start another thread to keep listening on the server socket, then deal with the client.private voidtransfer(InputStream is, String path, boolean append, OutputStream outs) Transfer from the given InputStream to a file, given its path.private voidtransfer(OutputStream os, String path) Transfer from a file, given its path, to the given OutputStream.private voidwrite(OutputStream out, String msg) private voidwriteln(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
-
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
-