📄 httpclass.java
字号:
/* * Java Network Programming, Second Edition * Merlin Hughes, Michael Shoffner, Derek Hamner * Manning Publications Company; ISBN 188477749X * * http://nitric.com/jnp/ * * Copyright (c) 1997-1999 Merlin Hughes, Michael Shoffner, Derek Hamner; * all rights reserved; see license.txt for details. */import java.io.*;
public class HttpClass implements HttpProcessor {
protected HttpClassProcessor processor;
public HttpClass (HttpInputStream in) throws IOException,
IllegalAccessException, InstantiationException {
String classPath = in.getPath ().substring (HTTP.CLASS_BIN.length ());
int idx = classPath.indexOf ('/');
String className = (idx < 0) ? classPath : classPath.substring (0, idx);
try {
Class theClass = Class.forName (className);
processor = (HttpClassProcessor) theClass.newInstance ();
} catch (ClassNotFoundException ex) {
throw new HttpException (HTTP.STATUS_NOT_FOUND,
"Class <TT>" + className + "</TT> not found.");
}
processor.initRequest (in);
}
public void processRequest (HttpOutputStream out) throws IOException {
processor.processRequest (out);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -