From 0d7576ecb1097a075fb3f864f8bc61238e31b2ac Mon Sep 17 00:00:00 2001 From: wentch <22250530@qq.com> Date: Tue, 19 Jan 2016 09:23:20 +0800 Subject: [PATCH] --- src/org/redkale/net/http/HttpRequest.java | 12 ++++++++---- src/org/redkale/net/http/HttpResponse.java | 12 ++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/org/redkale/net/http/HttpRequest.java b/src/org/redkale/net/http/HttpRequest.java index 5d3ed4b37..7a1ef1e03 100644 --- a/src/org/redkale/net/http/HttpRequest.java +++ b/src/org/redkale/net/http/HttpRequest.java @@ -245,7 +245,7 @@ public class HttpRequest extends Request { * 获取请求内容指定的编码字符串 * * @param charset 编码 - * @return + * @return 内容 */ public String getBody(final Charset charset) { return charset == null ? array.toString() : array.toString(charset); @@ -254,7 +254,7 @@ public class HttpRequest extends Request { /** * 获取请求内容的UTF-8编码字符串 * - * @return + * @return 内容 */ public String getBodyUTF8() { return array.toString(UTF8); @@ -282,7 +282,7 @@ public class HttpRequest extends Request { * 获取文件上传信息列表 * * @return 文件上传对象集合 - * @throws IOException + * @throws IOException IO异常 */ public final Iterable multiParts() throws IOException { return getMultiContext().parts(); @@ -342,7 +342,7 @@ public class HttpRequest extends Request { /** * 更新sessionid * - * @return + * @return 新的sessionid值 */ public String changeSessionid() { this.newsessionid = context.createSessionid(); @@ -575,6 +575,7 @@ public class HttpRequest extends Request { /** * 获取指定的header的json值 * + * @param 泛型 * @param clazz 反序列化的类名 * @param name header名 * @return header值 @@ -587,6 +588,7 @@ public class HttpRequest extends Request { /** * 获取指定的header的json值 * + * @param 泛型 * @param convert JsonConvert对象 * @param clazz 反序列化的类名 * @param name header名 @@ -699,6 +701,7 @@ public class HttpRequest extends Request { /** * 获取指定的参数json值 * + * @param 泛型 * @param clazz 反序列化的类名 * @param name 参数名 * @return 参数值 @@ -711,6 +714,7 @@ public class HttpRequest extends Request { /** * 获取指定的参数json值 * + * @param 泛型 * @param convert JsonConvert对象 * @param clazz 反序列化的类名 * @param name 参数名 diff --git a/src/org/redkale/net/http/HttpResponse.java b/src/org/redkale/net/http/HttpResponse.java index b753746f2..37bb246a6 100644 --- a/src/org/redkale/net/http/HttpResponse.java +++ b/src/org/redkale/net/http/HttpResponse.java @@ -29,8 +29,6 @@ import org.redkale.util.*; * 详情见: http://www.redkale.org * * @author zhangjx - * - * @param HttpRequest的子类型 */ public class HttpResponse extends Response { @@ -182,7 +180,7 @@ public class HttpResponse extends Response { /** * 增加Cookie值 * - * @param cookies + * @param cookies cookie */ public void addCookie(HttpCookie... cookies) { if (this.cookies == null) { @@ -419,8 +417,9 @@ public class HttpResponse extends Response { * 将指定文件按响应结果输出 * * @param file 输出文件 + * @throws IOException IO异常 */ - public void finish(File file) throws IOException { + public void finish(File file) throws IOException { finishFile(file, null); } @@ -429,8 +428,9 @@ public class HttpResponse extends Response { * * @param file 输出文件 * @param fileBody 文件内容, 没有则输出file + * @throws IOException IO异常 */ - protected void finishFile(final File file, ByteBuffer fileBody) throws IOException { + protected void finishFile(final File file, ByteBuffer fileBody) throws IOException { if (file == null || !file.isFile() || !file.canRead()) { finish404(); return; @@ -475,7 +475,7 @@ public class HttpResponse extends Response { } } - private void finishFile(ByteBuffer hbuffer, File file, long offset, long length) throws IOException { + private void finishFile(ByteBuffer hbuffer, File file, long offset, long length) throws IOException { this.channel.write(hbuffer, hbuffer, new TransferFileHandler(AsynchronousFileChannel.open(file.toPath(), options, ((HttpContext) context).getExecutor()), offset, length)); }