From 221d7fc4e1d3b0656ba7d7b97f1a24fad3222783 Mon Sep 17 00:00:00 2001 From: "zhouxin5253@163.com" <9a@2gvp!hs3> Date: Sat, 16 Jan 2021 20:07:08 +0800 Subject: [PATCH] fix bug --- .../zxbu/webdavteambition/config/TeambitionAutoConfig.java | 7 ++----- .../webdavteambition/store/TeambitionClientService.java | 1 + .../webdavteambition/store/TeambitionFileSystemStore.java | 7 ++----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/zxbu/webdavteambition/config/TeambitionAutoConfig.java b/src/main/java/com/github/zxbu/webdavteambition/config/TeambitionAutoConfig.java index 5911d85..8135982 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/config/TeambitionAutoConfig.java +++ b/src/main/java/com/github/zxbu/webdavteambition/config/TeambitionAutoConfig.java @@ -21,7 +21,7 @@ import java.util.List; @Configuration @EnableConfigurationProperties(TeambitionProperties.class) -public class TeambitionAutoConfig implements ApplicationContextAware { +public class TeambitionAutoConfig { private static final Logger LOGGER = LoggerFactory.getLogger(TeambitionAutoConfig.class); @Autowired @@ -70,8 +70,5 @@ public class TeambitionAutoConfig implements ApplicationContextAware { return teambitionClient; } - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - TeambitionFileSystemStore.setApplicationContext(applicationContext); - } + } diff --git a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java index 312f1ea..07e4ce4 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java +++ b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionClientService.java @@ -35,6 +35,7 @@ public class TeambitionClientService { public TeambitionClientService(TeambitionClient teambitionClient) { this.client = teambitionClient; + TeambitionFileSystemStore.setBean(this); } public List getTFiles(String nodeId) { diff --git a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java index aafb73f..2ceda4f 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java +++ b/src/main/java/com/github/zxbu/webdavteambition/store/TeambitionFileSystemStore.java @@ -22,16 +22,13 @@ import java.util.List; public class TeambitionFileSystemStore implements IWebdavStore { private static final Logger LOGGER = LoggerFactory.getLogger(TeambitionFileSystemStore.class); - private static ApplicationContext applicationContext; private static TeambitionClientService teambitionClientService; - public TeambitionFileSystemStore(File file) { } - public static void setApplicationContext(ApplicationContext applicationContext) { - TeambitionFileSystemStore.applicationContext = applicationContext; - TeambitionFileSystemStore.teambitionClientService = applicationContext.getBean(TeambitionClientService.class); + public static void setBean(TeambitionClientService teambitionClientService) { + TeambitionFileSystemStore.teambitionClientService = teambitionClientService; }