Commit 8c652a270fc55a0a2ee2384b3827c8d36204912f
1 parent
a5d3dbb5
1./external 路单信息开放
Showing
1 changed file
with
21 additions
and
24 deletions
src/main/java/com/bsth/server_rs/AuthorizeInterceptor_IN.java
| ... | ... | @@ -153,33 +153,30 @@ public class AuthorizeInterceptor_IN extends AbstractPhaseInterceptor<Message> i |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | public void loadLimit(String password) { |
| 156 | - if (!pwd2lines.containsKey(password)) { | |
| 157 | - Set<String> set = new HashSet<>(); | |
| 158 | - try { | |
| 159 | - BufferedReader reader = new BufferedReader(new FileReader(pathLimits + String.format("lines-%s.txt", password))); | |
| 160 | - String line = null; | |
| 161 | - while ((line = reader.readLine()) != null) { | |
| 162 | - set.add(line); | |
| 163 | - } | |
| 164 | - } catch (IOException e) { | |
| 165 | - logger.error("加载受限线路信息异常", e); | |
| 166 | - } finally { | |
| 167 | - pwd2lines.put(password, set); | |
| 156 | + Set<String> lineSet = new HashSet<>(); | |
| 157 | + try { | |
| 158 | + BufferedReader reader = new BufferedReader(new FileReader(pathLimits + String.format("lines-%s.txt", password))); | |
| 159 | + String line = null; | |
| 160 | + while ((line = reader.readLine()) != null) { | |
| 161 | + lineSet.add(line); | |
| 168 | 162 | } |
| 163 | + } catch (IOException e) { | |
| 164 | + logger.error("加载受限线路信息异常", e); | |
| 165 | + } finally { | |
| 166 | + pwd2lines.put(password, lineSet); | |
| 169 | 167 | } |
| 170 | - if (!pwd2device.containsKey(password)) { | |
| 171 | - Set<String> set = new HashSet<>(); | |
| 172 | - try { | |
| 173 | - BufferedReader reader = new BufferedReader(new FileReader(pathLimits + String.format("devices-%s.txt", password))); | |
| 174 | - String line = null; | |
| 175 | - while ((line = reader.readLine()) != null) { | |
| 176 | - set.add(line); | |
| 177 | - } | |
| 178 | - } catch (IOException e) { | |
| 179 | - logger.error("加载受限设备信息异常", e); | |
| 180 | - } finally { | |
| 181 | - pwd2device.put(password, set); | |
| 168 | + | |
| 169 | + Set<String> deviceSet = new HashSet<>(); | |
| 170 | + try { | |
| 171 | + BufferedReader reader = new BufferedReader(new FileReader(pathLimits + String.format("devices-%s.txt", password))); | |
| 172 | + String line = null; | |
| 173 | + while ((line = reader.readLine()) != null) { | |
| 174 | + deviceSet.add(line); | |
| 182 | 175 | } |
| 176 | + } catch (IOException e) { | |
| 177 | + logger.error("加载受限设备信息异常", e); | |
| 178 | + } finally { | |
| 179 | + pwd2device.put(password, deviceSet); | |
| 183 | 180 | } |
| 184 | 181 | } |
| 185 | 182 | ... | ... |