zhou-hao 7 年之前
父节点
当前提交
0cd7f26c0d
共有 20 个文件被更改,包括 66 次插入129 次删除
  1. 0 31
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/GrantType.java
  2. 0 34
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/OAuth2Constants.java
  3. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/request/OAuth2Session.java
  4. 3 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/SimpleOAuth2SessionBuilder.java
  5. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/session/AuthorizationCodeSession.java
  6. 5 5
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/session/DefaultOAuth2Session.java
  7. 1 1
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/session/PasswordSession.java
  8. 1 0
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/src/main/java/org/hswebframework/web/oauth2/core/GrantType.java
  9. 2 2
      hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/src/main/java/org/hswebframework/web/oauth2/core/OAuth2Constants.java
  10. 1 1
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/dynamic/DynamicSqlSessionFactory.java
  11. 5 1
      hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/utils/ResultMapsUtils.java
  12. 4 8
      hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/src/test/java/org/hswebframework/web/service/oauth2/AbstractOAuth2CrudServiceTests.java
  13. 2 1
      hsweb-datasource/hsweb-datasource-api/src/main/java/org/hswebframework/web/datasource/service/DataSourceCache.java
  14. 16 16
      hsweb-datasource/hsweb-datasource-jta/src/main/java/org/hswebframework/web/datasource/jta/AtomikosDataSourceConfig.java
  15. 2 0
      hsweb-datasource/hsweb-datasource-jta/src/main/java/org/hswebframework/web/datasource/jta/JtaDynamicDataSourceService.java
  16. 1 1
      hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/OAuth2SSOAuthorizingListener.java
  17. 6 11
      hsweb-message/hsweb-message-memory/src/main/java/org/hswebframework/web/message/memory/MemoryMessager.java
  18. 2 0
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/UserController.java
  19. 1 3
      hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/UserEntity.java
  20. 12 11
      hsweb-system/hsweb-system-file/hsweb-system-file-service/hsweb-system-file-service-simple/src/main/java/org/hswebframework/web/service/file/simple/LocalFileService.java

+ 0 - 31
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/GrantType.java

@@ -1,31 +0,0 @@
-/*
- *  Copyright 2016 http://www.hswebframework.org
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *
- */
-
-package org.hswebframework.web.authorization.oauth2.client;
-
-/**
- * @author zhouhao
- */
-public interface GrantType {
-    String authorization_code = "authorization_code";
-    String implicit           = "implicit";
-    @SuppressWarnings("all")
-    String password = "password";
-    String client_credentials = "client_credentials";
-    String refresh_token      = "refresh_token";
-}

+ 0 - 34
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/OAuth2Constants.java

@@ -1,34 +0,0 @@
-/*
- *  Copyright 2016 http://www.hswebframework.org
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *
- */
-
-package org.hswebframework.web.authorization.oauth2.client;
-
-/**
- * @author zhouhao
- */
-public interface OAuth2Constants {
-    String access_token  = "access_token";
-    String grant_type    = "grant_type";
-    String scope         = "scope";
-    String client_id     = "client_id";
-    String client_secret = "client_secret";
-    String authorization = "Authorization";
-    String redirect_uri  = "redirect_uri";
-    String response_type = "response_type";
-    String state         = "state";
-}

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/request/OAuth2Session.java

@@ -30,7 +30,7 @@ import java.io.Serializable;
  * @see OAuth2Request
  * @since 3.0
  */
-public interface OAuth2Session extends Serializable {
+public interface OAuth2Session{
     /**
      * 尝试进行认证
      *

+ 3 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/SimpleOAuth2SessionBuilder.java

@@ -25,6 +25,8 @@ import org.hswebframework.web.authorization.oauth2.client.simple.session.Authori
 import org.hswebframework.web.authorization.oauth2.client.simple.session.CachedOAuth2Session;
 import org.hswebframework.web.authorization.oauth2.client.simple.session.DefaultOAuth2Session;
 import org.hswebframework.web.authorization.oauth2.client.simple.session.PasswordSession;
+import org.hswebframework.web.oauth2.core.GrantType;
+import org.hswebframework.web.oauth2.core.OAuth2Constants;
 
 import java.util.List;
 import java.util.concurrent.locks.ReadWriteLock;
@@ -110,7 +112,7 @@ public class SimpleOAuth2SessionBuilder implements OAuth2SessionBuilder {
     }
 
 
-    Supplier<AccessTokenInfo> tokenGetter = () -> {
+   private Supplier<AccessTokenInfo> tokenGetter = () -> {
         readWriteLock.readLock().lock();
         try {
             return getClientCredentialsToken();

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/session/AuthorizationCodeSession.java

@@ -18,10 +18,10 @@
 
 package org.hswebframework.web.authorization.oauth2.client.simple.session;
 
-import org.hswebframework.web.authorization.oauth2.client.GrantType;
 import org.hswebframework.web.authorization.oauth2.client.OAuth2Constants;
 import org.hswebframework.web.authorization.oauth2.client.request.OAuth2Request;
 import org.hswebframework.web.authorization.oauth2.client.request.OAuth2Session;
+import org.hswebframework.web.oauth2.core.GrantType;
 
 /**
  * @author zhouhao

+ 5 - 5
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/session/DefaultOAuth2Session.java

@@ -24,13 +24,13 @@ import org.hswebframework.web.authorization.oauth2.client.request.OAuth2Request;
 import org.hswebframework.web.authorization.oauth2.client.request.OAuth2Session;
 import org.hswebframework.web.authorization.oauth2.client.response.OAuth2Response;
 import org.hswebframework.web.oauth2.core.ErrorType;
+import org.hswebframework.web.oauth2.core.OAuth2Constants;
 import org.springframework.util.Assert;
 
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.function.Consumer;
 
-import static org.hswebframework.web.authorization.oauth2.client.OAuth2Constants.*;
+import static org.hswebframework.web.oauth2.core.OAuth2Constants.*;
+
 
 /**
  * @author zhouhao
@@ -165,8 +165,8 @@ public class DefaultOAuth2Session implements OAuth2Session {
         boolean[] skip = new boolean[1];
         AccessTokenInfo tokenInfo = request
                 .param(OAuth2Constants.scope, scope)
-                .param(OAuth2Constants.grant_type, GrantType.refresh_token)
-                .param(GrantType.refresh_token, accessTokenInfo.getRefreshToken())
+                .param(OAuth2Constants.grant_type, org.hswebframework.web.oauth2.core.GrantType.refresh_token)
+                .param(org.hswebframework.web.oauth2.core.GrantType.refresh_token, accessTokenInfo.getRefreshToken())
                 .post().onError((oAuth2Response, type) -> {
                     if(type== ErrorType.EXPIRED_REFRESH_TOKEN){
                         setAccessTokenInfo(requestAccessToken());

+ 1 - 1
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-client/src/main/java/org/hswebframework/web/authorization/oauth2/client/simple/session/PasswordSession.java

@@ -18,9 +18,9 @@
 
 package org.hswebframework.web.authorization.oauth2.client.simple.session;
 
-import org.hswebframework.web.authorization.oauth2.client.GrantType;
 import org.hswebframework.web.authorization.oauth2.client.OAuth2Constants;
 import org.hswebframework.web.authorization.oauth2.client.request.OAuth2Request;
+import org.hswebframework.web.oauth2.core.GrantType;
 
 /**
  * @author zhouhao

+ 1 - 0
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/src/main/java/org/hswebframework/web/oauth2/core/GrantType.java

@@ -25,6 +25,7 @@ package org.hswebframework.web.oauth2.core;
 public interface GrantType {
     String authorization_code = "authorization_code";
     String implicit           = "implicit";
+    @SuppressWarnings("all")
     String password           = "password";
     String client_credentials = "client_credentials";
     String refresh_token      = "refresh_token";

+ 2 - 2
hsweb-authorization/hsweb-authorization-oauth2/hsweb-authorization-oauth2-core/src/main/java/org/hswebframework/web/oauth2/core/OAuth2Constants.java

@@ -19,8 +19,6 @@
 package org.hswebframework.web.oauth2.core;
 
 /**
- * TODO 完成注释
- *
  * @author zhouhao
  */
 public interface OAuth2Constants {
@@ -36,6 +34,8 @@ public interface OAuth2Constants {
     String state         = "state";
     String code          = "code";
     String username      = "username";
+
+    @SuppressWarnings("all")
     String password      = "password";
 
 }

+ 1 - 1
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/dynamic/DynamicSqlSessionFactory.java

@@ -88,7 +88,7 @@ public class DynamicSqlSessionFactory implements SqlSessionFactory {
         return configuration;
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("all")
     private SqlSession openSessionFromDataSource(ExecutorType execType, TransactionIsolationLevel level, boolean autoCommit) {
         Transaction tx = null;
         try {

+ 5 - 1
hsweb-commons/hsweb-commons-dao/hsweb-commons-dao-mybatis/src/main/java/org/hswebframework/web/dao/mybatis/utils/ResultMapsUtils.java

@@ -37,9 +37,13 @@ public class ResultMapsUtils {
             try {
                 countDownLatch.await();
             } catch (InterruptedException e) {
-                throw new RuntimeException(e);
+                throw new UnsupportedOperationException(e);
+            }
+            if (sqlSession == null) {
+                throw new UnsupportedOperationException("sqlSession is null");
             }
         }
+
         return sqlSession.getConfiguration().getResultMap(id);
     }
 

+ 4 - 8
hsweb-commons/hsweb-commons-service/hsweb-commons-service-oauth2/src/test/java/org/hswebframework/web/service/oauth2/AbstractOAuth2CrudServiceTests.java

@@ -55,23 +55,19 @@ public class AbstractOAuth2CrudServiceTests {
                 createFixedResponseRequest(
                         whenRequest("get", ResponseMessage.ok(entity))
                         , whenRequest("put", ResponseMessage.ok(1))
-                        , whenRequest("delete", ResponseMessage.ok(1)))
-        );
+                        , whenRequest("delete", ResponseMessage.ok(1))));
 
         when(oAuth2Session.request("/test/all")).thenReturn(
                 createFixedResponseRequest(
-                        whenRequest("get", ResponseMessage.ok(Arrays.asList(entity)))
-                ));
+                        whenRequest("get", ResponseMessage.ok(Arrays.asList(entity)))));
 
         when(oAuth2Session.request("/test/ids")).thenReturn(
                 createFixedResponseRequest(
-                        whenRequest("get", ResponseMessage.ok(Arrays.asList(entity)))
-                ));
+                        whenRequest("get", ResponseMessage.ok(Arrays.asList(entity)))));
 
         when(oAuth2Session.request("/test/batch")).thenReturn(
                 createFixedResponseRequest(
-                        whenRequest("put", ResponseMessage.error(400, "名称不能为空"))
-                ));
+                        whenRequest("put", ResponseMessage.error(400, "名称不能为空"))));
 
         when(sessionBuilder.byClientCredentials()).thenReturn(oAuth2Session);
 

+ 2 - 1
hsweb-datasource/hsweb-datasource-api/src/main/java/org/hswebframework/web/datasource/service/DataSourceCache.java

@@ -30,8 +30,9 @@ public class DataSourceCache {
             try {
                 //等待初始化完成
                 initLatch.await();
-            } catch (InterruptedException ignored) {
+            } catch (Exception ignored) {
                 log.warn(ignored.getMessage(),ignored);
+
             } finally {
                 initLatch = null;
             }

+ 16 - 16
hsweb-datasource/hsweb-datasource-jta/src/main/java/org/hswebframework/web/datasource/jta/AtomikosDataSourceConfig.java

@@ -1,30 +1,30 @@
 package org.hswebframework.web.datasource.jta;
 
 import com.atomikos.jdbc.AtomikosDataSourceBean;
+import lombok.extern.slf4j.Slf4j;
 
 import java.sql.SQLException;
 import java.util.Properties;
 
 /**
- * TODO 完成注释
- *
  * @author zhouhao
  */
+@Slf4j
 public class AtomikosDataSourceConfig {
-    private int        minPoolSize             = 5;
-    private int        maxPoolSize             = 200;
-    private int        borrowConnectionTimeout = 60;
-    private int        reapTimeout             = 0;
-    private int        maxIdleTime             = 60;
-    private int        maintenanceInterval     = 60;
-    private int        defaultIsolationLevel   = -1;
-    private String     xaDataSourceClassName   = null;
-    private int        loginTimeout            = 0;
-    private String     testQuery               = null;
-    private int        maxLifetime             = 0;
-    private Properties xaProperties            = null;
+    private int minPoolSize = 5;
+    private int maxPoolSize = 200;
+    private int borrowConnectionTimeout = 60;
+    private int reapTimeout = 0;
+    private int maxIdleTime = 60;
+    private int maintenanceInterval = 60;
+    private int defaultIsolationLevel = -1;
+    private String xaDataSourceClassName = null;
+    private int loginTimeout = 0;
+    private String testQuery = null;
+    private int maxLifetime = 0;
+    private Properties xaProperties = null;
     //初始化超时时间
-    private int        initTimeout             = 10;
+    private int initTimeout = 10;
 
     @Override
     public int hashCode() {
@@ -169,7 +169,7 @@ public class AtomikosDataSourceConfig {
             try {
                 atomikosDataSourceBean.setLoginTimeout(getLoginTimeout());
             } catch (SQLException e) {
-                e.printStackTrace();
+                log.warn(e.getMessage(), e);
             }
         }
         atomikosDataSourceBean.setMaxIdleTime(getMaxIdleTime());

+ 2 - 0
hsweb-datasource/hsweb-datasource-jta/src/main/java/org/hswebframework/web/datasource/jta/JtaDynamicDataSourceService.java

@@ -93,6 +93,7 @@ public class JtaDynamicDataSourceService extends AbstractDynamicDataSourceServic
                     downLatch.countDown();
                 } catch (Exception e) {
                     logger.error("init datasource {} error", id, e);
+
                     //atomikosDataSourceBean.close();
                 }
             });
@@ -102,6 +103,7 @@ public class JtaDynamicDataSourceService extends AbstractDynamicDataSourceServic
                     Thread.sleep(config.getInitTimeout() * 1000L);
                 } catch (InterruptedException ignored) {
                     logger.warn(ignored.getMessage(), ignored);
+                    Thread.currentThread().interrupt();
                 } finally {
                     if (successCounter.get() == 0) {
                         // 初始化超时,认定为失败

+ 1 - 1
hsweb-examples/hsweb-examples-oauth2/hsweb-examples-oauth2-client/src/main/java/org/hswebframework/web/example/oauth2/OAuth2SSOAuthorizingListener.java

@@ -73,7 +73,7 @@ public class OAuth2SSOAuthorizingListener
         HttpSession httpSession = WebUtil.getHttpServletRequest()
                 .getSession();
 
-        userTokenManager.signIn(httpSession.getId(), "sessionId",authentication.getUser().getId(), 60 * 60 * 1000);
+        userTokenManager.signIn(httpSession.getId(), "sessionId",authentication.getUser().getId(), 60 * 60 * 1000L);
 
 
     }

+ 6 - 11
hsweb-message/hsweb-message-memory/src/main/java/org/hswebframework/web/message/memory/MemoryMessager.java

@@ -15,7 +15,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.function.Consumer;
 
 /**
- *
  * @author zhouhao
  */
 
@@ -82,21 +81,17 @@ public class MemoryMessager implements Messager {
 
                 @Override
                 public void cancel() {
-                    boolean lockSuccess = true;
                     try {
                         queue.lock.writeLock().tryLock(5, TimeUnit.SECONDS);
-                    } catch (InterruptedException e) {
-                        lockSuccess = false;
-                        log.warn(e.getMessage(),e);
-                    }
-                    try {
-                        queue.consumers.remove(consumer);
-                    } finally {
                         try {
+                            queue.consumers.remove(consumer);
+                        } finally {
                             queue.lock.writeLock().unlock();
-                        } catch (Exception e) {
                         }
+                    } catch (Exception e) {
+                        log.warn(e.getMessage(), e);
                     }
+
                 }
             };
         } else if (subject instanceof TopicMessageSubject) {
@@ -108,6 +103,6 @@ public class MemoryMessager implements Messager {
 
     class QueueConsumer<M extends Message> {
         final List<Consumer<M>> consumers = new ArrayList<>();
-        final ReadWriteLock     lock      = new ReentrantReadWriteLock();
+        final ReadWriteLock lock = new ReentrantReadWriteLock();
     }
 }

+ 2 - 0
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-controller/src/main/java/org/hswebframework/web/controller/authorization/UserController.java

@@ -70,6 +70,7 @@ public class UserController implements
     }
 
     @Override
+    @SuppressWarnings("all")
     public ResponseMessage<PagerResult<UserEntity>> list(QueryParamEntity param) {
         param.excludes("password", "salt");
         return QueryController.super.list(param)
@@ -77,6 +78,7 @@ public class UserController implements
     }
 
     @Override
+    @SuppressWarnings("all")
     public ResponseMessage<UserEntity> getByPrimaryKey(@PathVariable String id) {
         return QueryController.super.getByPrimaryKey(id)
                 .exclude(UserEntity.class, "password", "salt");

+ 1 - 3
hsweb-system/hsweb-system-authorization/hsweb-system-authorization-entity/src/main/java/org/hswebframework/web/entity/authorization/UserEntity.java

@@ -22,15 +22,13 @@ import org.hswebframework.web.commons.entity.GenericEntity;
 import org.hswebframework.web.commons.entity.RecordCreationEntity;
 
 /**
- * TODO 完成注释
- *
  * @author zhouhao
  */
 public interface UserEntity extends GenericEntity<String>, RecordCreationEntity {
     String name     = "name";
     String username = "username";
     String salt     = "salt";
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("all")
     String password = "password";
     String status = "status";
 

+ 12 - 11
hsweb-system/hsweb-system-file/hsweb-system-file-service/hsweb-system-file-service-simple/src/main/java/org/hswebframework/web/service/file/simple/LocalFileService.java

@@ -138,7 +138,7 @@ public class LocalFileService implements FileService {
         int fileSize;
         MessageDigest digest = DigestUtils.getMd5Digest();
 
-        try (InputStream in =new InputStream() {
+        try (InputStream in = new InputStream() {
             @Override
             public int read(byte[] b, int off, int len) throws IOException {
                 int l = fileStream.read(b, off, len);
@@ -162,17 +162,17 @@ public class LocalFileService implements FileService {
                 return fileStream.read();
             }
         }; FileOutputStream os = new FileOutputStream(fileAbsName)) {
-            int remainBytes=fileSize= in.available();
-            byte[] buff = new byte[remainBytes>1024*10?1024*10:remainBytes];
+            int remainBytes = fileSize = in.available();
+            byte[] buff = new byte[remainBytes > 1024 * 10 ? 1024 * 10 : remainBytes];
             int bytes;
-            logger.info("开始写出文件:{}到:{}, size: {} bytes",fileName,fileAbsName,fileSize);
+            logger.info("开始写出文件:{}到:{}, size: {} bytes", fileName, fileAbsName, fileSize);
             while (remainBytes > 0) {
-                bytes = in.read(buff, 0, remainBytes > buff.length ? buff.length :  remainBytes);
+                bytes = in.read(buff, 0, remainBytes > buff.length ? buff.length : remainBytes);
                 os.write(buff, 0, bytes);
                 remainBytes -= bytes;
-                logger.info("写出文件:{}:{},剩余数据量: {} bytes",fileName,fileAbsName, remainBytes);
+                logger.info("写出文件:{}:{},剩余数据量: {} bytes", fileName, fileAbsName, remainBytes);
             }
-           // StreamUtils.copy(in, os);
+            // StreamUtils.copy(in, os);
         }
 
         String md5 = Hex.encodeHexString(digest.digest());
@@ -182,7 +182,7 @@ public class LocalFileService implements FileService {
         //判断文件是否已经存在
         FileInfoEntity fileInfo = fileInfoService.selectByMd5(md5);
         if (fileInfo != null) {
-            logger.info("文件:{}已上传过",fileAbsName);
+            logger.info("文件:{}已上传过", fileAbsName);
             if (new File(getFilePath() + "/" + fileInfo.getLocation()).exists()) {
                 newFile.delete();//文件已存在则删除临时文件不做处理
             } else {
@@ -190,7 +190,7 @@ public class LocalFileService implements FileService {
             }
             return fileInfo;
         } else {
-            logger.info("上传文件{}完成:{}->{}",fileName,fileAbsName,absPath.concat("/").concat(md5));
+            logger.info("上传文件{}完成:{}->{}", fileName, fileAbsName, absPath.concat("/").concat(md5));
             newFile.renameTo(new File(absPath.concat("/").concat(md5)));
         }
         FileInfoEntity infoEntity = fileInfoService.createEntity();
@@ -199,7 +199,7 @@ public class LocalFileService implements FileService {
         infoEntity.setLocation(filePath.concat("/").concat(md5));
         infoEntity.setName(fileName);
         infoEntity.setType(type);
-        infoEntity.setSize((long)fileSize);
+        infoEntity.setSize((long) fileSize);
         infoEntity.setMd5(md5);
         infoEntity.setStatus(DataStatus.STATUS_ENABLED);
         fileInfoService.insert(infoEntity);
@@ -210,7 +210,8 @@ public class LocalFileService implements FileService {
     public void writeFile(String fileId, OutputStream out, long skip) throws IOException {
         try (InputStream inputStream = readFile(fileId)) {
             if (skip > 0) {
-                inputStream.skip(skip);
+                long len = inputStream.skip(skip);
+                logger.info("skip write stream {},{}", skip, len);
             }
             StreamUtils.copy(inputStream, out);
         }