javatools.http
Class FileHttpResponseHandler

java.lang.Object
  |
  +--javatools.http.HttpResponseHandler
        |
        +--javatools.http.AbstractHttpResponseHandler
              |
              +--javatools.http.FileHttpResponseHandler

public class FileHttpResponseHandler
extends AbstractHttpResponseHandler


Field Summary
(package private)  byte[] buf
           
(package private) static int BUF_SIZE
           
(package private) static byte[] EOL
           
(package private)  java.io.File file
           
(package private) static javax.activation.MimetypesFileTypeMap mimeMap
           
(package private)  java.io.File root
           
 
Fields inherited from class javatools.http.AbstractHttpResponseHandler
socket, url
 
Constructor Summary
FileHttpResponseHandler(java.net.URL url, java.net.Socket s)
           
 
Method Summary
 boolean exists()
           
 long getLength()
           
 java.lang.String getMimeType()
           
 long lastModified()
           
(package private)  void listDirectory(java.io.PrintStream ps)
           
 void sendFile(java.io.PrintStream ps)
           
(package private)  java.io.File urlToFile()
           
 
Methods inherited from class javatools.http.AbstractHttpResponseHandler
getSocket, getUrl, print, printBody, printHeaders, processURL, send404
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

java.io.File file

root

java.io.File root

mimeMap

static javax.activation.MimetypesFileTypeMap mimeMap

EOL

static final byte[] EOL

BUF_SIZE

static final int BUF_SIZE
See Also:
Constant Field Values

buf

byte[] buf
Constructor Detail

FileHttpResponseHandler

public FileHttpResponseHandler(java.net.URL url,
                               java.net.Socket s)
Method Detail

exists

public boolean exists()
Specified by:
exists in class AbstractHttpResponseHandler

lastModified

public long lastModified()
Specified by:
lastModified in class AbstractHttpResponseHandler

getLength

public long getLength()
Specified by:
getLength in class AbstractHttpResponseHandler

urlToFile

java.io.File urlToFile()

getMimeType

public java.lang.String getMimeType()
Specified by:
getMimeType in class AbstractHttpResponseHandler

sendFile

public void sendFile(java.io.PrintStream ps)
              throws java.io.IOException
Specified by:
sendFile in class AbstractHttpResponseHandler
java.io.IOException

listDirectory

void listDirectory(java.io.PrintStream ps)
             throws java.io.IOException
java.io.IOException