|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object PageBoxLib.HTTPLog
Data formatting and trace for raw HTTP troubleshooting. Traces only if httplog.txt exists in temporary directory
alexis.grandemange@pagebox.net
Copyright (c) 2002-2004 Alexis Grandemange
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License lesser.txt should be included in the distribution.
Field Summary | |
private java.io.DataInputStream |
in
Network input handle |
private java.io.DataOutputStream |
out
Network output handle |
private java.io.PrintWriter |
pw
Log file handle |
private java.text.SimpleDateFormat |
sdf
SimpleDateFormat used to build log entries |
private java.lang.String |
to
Target or source URL |
Constructor Summary | |
HTTPLog(java.io.DataInputStream in,
java.io.DataOutputStream out,
java.lang.String to)
Constructor. |
Method Summary | |
void |
close()
Close both network output and log. |
void |
closeIn()
Close network input. |
void |
closeOut()
Close network output. |
void |
log(java.lang.String msg)
Write an entry on the trace. |
boolean |
readBoolean()
Read a boolean from the network input and log it. |
byte[] |
readBytes()
Read a buffer from the network input and log it. |
int |
readInt()
Read a int from the network input and log it. |
java.lang.String |
readString()
Read a string from the network input and log it. |
void |
setIn(java.io.DataInputStream in)
Set the network output stream. |
void |
setOut(java.io.DataOutputStream out)
Set the network output stream. |
void |
write(boolean val)
Write on both network and log. |
void |
write(byte[] buf)
Write on both network and log. |
void |
write(int val)
Write on both network and log. |
void |
write(java.lang.String msg)
Write on both network and log. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.io.PrintWriter pw
private java.io.DataInputStream in
private java.io.DataOutputStream out
private java.lang.String to
private final java.text.SimpleDateFormat sdf
Constructor Detail |
public HTTPLog(java.io.DataInputStream in, java.io.DataOutputStream out, java.lang.String to) throws java.io.IOException
in
- network input streamout
- network output streamto
- target or source URLMethod Detail |
public void setOut(java.io.DataOutputStream out)
out
- network output streampublic void setIn(java.io.DataInputStream in)
public final void write(java.lang.String msg) throws java.io.IOException
msg
- message to write
java.io.IOException
public final void write(int val) throws java.io.IOException
val
- int to write
java.io.IOException
public final void write(boolean val) throws java.io.IOException
val
- boolean to write
java.io.IOException
public final void write(byte[] buf) throws java.io.IOException
buf
- buffer to write
java.io.IOException
public final java.lang.String readString() throws java.io.IOException
java.io.IOException
public final int readInt() throws java.io.IOException
java.io.IOException
public final boolean readBoolean() throws java.io.IOException
java.io.IOException
public final byte[] readBytes() throws java.io.IOException
java.io.IOException
public final void log(java.lang.String msg)
msg
- message to writepublic final void closeIn() throws java.io.IOException
java.io.IOException
public final void closeOut() throws java.io.IOException
java.io.IOException
public final void close() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |