From 89b8ef036d9c2579be8032ffd3b10211be73b156 Mon Sep 17 00:00:00 2001 From: zhou-hao Date: Sat, 6 Jan 2018 11:27:58 +0800 Subject: [PATCH] rename --- ...reEvent.java => AuthorizingHandleBeforeEvent.java} | 4 ++-- .../basic/handler/DefaultAuthorizingHandler.java | 4 ++-- .../web/service/file/oauth2/OAuth2FileService.java | 10 ++++++---- pom.xml | 11 +++++------ 4 files changed, 15 insertions(+), 14 deletions(-) rename hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/{AuthorizationHandleBeforeEvent.java => AuthorizingHandleBeforeEvent.java} (84%) diff --git a/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AuthorizationHandleBeforeEvent.java b/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AuthorizingHandleBeforeEvent.java similarity index 84% rename from hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AuthorizationHandleBeforeEvent.java rename to hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AuthorizingHandleBeforeEvent.java index 13d943e6d..1b6767567 100644 --- a/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AuthorizationHandleBeforeEvent.java +++ b/hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/listener/event/AuthorizingHandleBeforeEvent.java @@ -4,7 +4,7 @@ import org.hswebframework.web.authorization.define.AuthorizingContext; import org.hswebframework.web.authorization.define.HandleType; import org.springframework.context.ApplicationEvent; -public class AuthorizationHandleBeforeEvent extends ApplicationEvent implements AuthorizationEvent { +public class AuthorizingHandleBeforeEvent extends ApplicationEvent implements AuthorizationEvent { private static final long serialVersionUID = -1095765748533721998L; @@ -16,7 +16,7 @@ public class AuthorizationHandleBeforeEvent extends ApplicationEvent implements private HandleType handleType; - public AuthorizationHandleBeforeEvent(AuthorizingContext context, HandleType handleType) { + public AuthorizingHandleBeforeEvent(AuthorizingContext context, HandleType handleType) { super(context); this.handleType = handleType; } diff --git a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/DefaultAuthorizingHandler.java b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/DefaultAuthorizingHandler.java index 871496861..61126537f 100644 --- a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/DefaultAuthorizingHandler.java +++ b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/handler/DefaultAuthorizingHandler.java @@ -13,7 +13,7 @@ import org.hswebframework.web.authorization.define.AuthorizeDefinition; import org.hswebframework.web.authorization.define.AuthorizingContext; import org.hswebframework.web.authorization.define.HandleType; import org.hswebframework.web.authorization.exception.AccessDenyException; -import org.hswebframework.web.authorization.listener.event.AuthorizationHandleBeforeEvent; +import org.hswebframework.web.authorization.listener.event.AuthorizingHandleBeforeEvent; import org.hswebframework.web.boost.aop.context.MethodInterceptorContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,7 +65,7 @@ public class DefaultAuthorizingHandler implements AuthorizingHandler { } private boolean handleEvent(AuthorizingContext context,HandleType type){ if(null!=eventPublisher) { - AuthorizationHandleBeforeEvent event = new AuthorizationHandleBeforeEvent(context, type); + AuthorizingHandleBeforeEvent event = new AuthorizingHandleBeforeEvent(context, type); eventPublisher.publishEvent(event); if (!event.isExecute()) { if (event.isAllow()) { diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-service/hsweb-system-file-service-oauth2/src/main/java/org/hswebframework/web/service/file/oauth2/OAuth2FileService.java b/hsweb-system/hsweb-system-file/hsweb-system-file-service/hsweb-system-file-service-oauth2/src/main/java/org/hswebframework/web/service/file/oauth2/OAuth2FileService.java index e671907db..3775287fc 100644 --- a/hsweb-system/hsweb-system-file/hsweb-system-file-service/hsweb-system-file-service-oauth2/src/main/java/org/hswebframework/web/service/file/oauth2/OAuth2FileService.java +++ b/hsweb-system/hsweb-system-file/hsweb-system-file-service/hsweb-system-file-service-oauth2/src/main/java/org/hswebframework/web/service/file/oauth2/OAuth2FileService.java @@ -37,22 +37,24 @@ public class OAuth2FileService implements FileService, OAuth2ServiceSupport { @Override public FileInfoEntity saveFile(InputStream fileStream, String fileName, String type, String creatorId) throws IOException { return createRequest("/upload") - .upload("file", fileStream,fileName) + .upload("file", fileStream, fileName) .as(getEntityType()); } @Override public String saveStaticFile(InputStream fileStream, String fileName) throws IOException { return createRequest("/upload-static") - .upload("file", fileStream,fileName) + .upload("file", fileStream, fileName) .as(String.class); } @Override public void writeFile(String fileId, OutputStream out, long skip) throws IOException { - StreamUtils.copy(createRequest("/download/" + fileId) + try (InputStream stream = createRequest("/download/" + fileId) .header("Range", "bytes=" + skip) - .get().asStream(), out); + .get().asStream()) { + StreamUtils.copy(stream, out); + } } @Override diff --git a/pom.xml b/pom.xml index 1a57faf7d..f794f4e64 100644 --- a/pom.xml +++ b/pom.xml @@ -249,11 +249,10 @@ - - io.reactivex.rxjava2 - rxjava - 2.1.8 - + + + + org.projectlombok lombok @@ -288,7 +287,7 @@ io.reactivex.rxjava2 rxjava - 2.1.6 + 2.1.8 junit