protected void processGetCommand(String cmd) throws IOException {
  String location=cmd.substring(4);
  int locationEnd=location.indexOf(" ");
  location=location.substring(0,locationEnd);
  String contentType;
  if (location.endsWith(".gif") || location.endsWith(".GIF")) {
    contentType=CONTENT_GIF;
  }
 else   if (location.endsWith(".htm") || location.endsWith(".html") || location.endsWith(".HTM")|| location.endsWith(".HTML")) {
    contentType=CONTENT_HTML;
  }
 else   if (location.endsWith(".jpg") || location.endsWith(".JPG") || location.endsWith(".jpeg")|| location.endsWith(".JPEG")) {
    contentType=CONTENT_JPEG;
  }
 else   if (location.endsWith(".mov") || location.endsWith(".MOV")) {
    contentType=CONTENT_MOV;
  }
 else   if (location.indexOf('?') != -1) {
    contentType=null;
  }
 else {
    contentType=CONTENT_PLAIN;
  }
  HttpRequestEvent event=server.fireHttpRequestEvent(location,out);
  if (event.isWriterUsed()) {
    Writer writer=event.getWriter();
    String result=writer.toString();
    writeHttpResponse(out,contentType,result);
  }
  out.flush();
  close();
}

protected void processGetCommand ( String cmd ) throws IOException { String location = cmd . substring ( 4 ) ; int locationEnd = location . indexOf ( " " ) ; location = location . substring ( 0 , locationEnd ) ; String contentType ; if ( location . endsWith ( ".gif" ) || location . endsWith ( ".GIF" ) ) { contentType = CONTENT_GIF ; } else if ( location . endsWith ( ".htm" ) || location . endsWith ( ".html" ) || location . endsWith ( ".HTM" ) || location . endsWith ( ".HTML" ) ) { contentType = CONTENT_HTML ; } else if ( location . endsWith ( ".jpg" ) || location . endsWith ( ".JPG" ) || location . endsWith ( ".jpeg" ) || location . endsWith ( ".JPEG" ) ) { contentType = CONTENT_JPEG ; } else if ( location . endsWith ( ".mov" ) || location . endsWith ( ".MOV" ) ) { contentType = CONTENT_MOV ; } else if ( location . indexOf ( '?' ) != - 1 ) { contentType = null ; } else { contentType = CONTENT_PLAIN ; } HttpRequestEvent event = server . fireHttpRequestEvent ( location , out ) ; if ( event . isWriterUsed ( ) ) { Writer writer = event . getWriter ( ) ; String result = writer . toString ( ) ; writeHttpResponse ( out , contentType , result ) ; } out . flush ( ) ; close ( ) ; }
process a " get " http command . the leading " get " and the trailing http version information are stripped off and a httprequestevent is fired via the httpserver .
