Skip to content
This repository was archived by the owner on Jul 21, 2024. It is now read-only.

Commit a9c7a73

Browse files
committed
Merge remote-tracking branch 'parent/main'
# Conflicts: # README.md # src/main/java/com/github/zxbu/webdavteambition/WebdavTeambitionApplication.java # src/main/java/net/sf/webdav/methods/DoGet.java
2 parents 510183d + fa8b890 commit a9c7a73

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.github.zxbu.webdavteambition.config;
2+
3+
import com.github.zxbu.webdavteambition.model.result.TFile;
4+
import com.github.zxbu.webdavteambition.store.AliYunDriverClientService;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.scheduling.annotation.Scheduled;
7+
import org.springframework.stereotype.Component;
8+
9+
@Component
10+
public class AliYunDriverCronTask {
11+
12+
@Autowired
13+
private AliYunDriverClientService aliYunDriverClientService;
14+
15+
/**
16+
* 每隔5分钟请求一下接口,保证token不过期
17+
*/
18+
@Scheduled(initialDelay = 30 * 1000, fixedDelay = 5 * 60 * 1000)
19+
public void refreshToken() {
20+
try {
21+
TFile root = aliYunDriverClientService.getTFileByPath("/");
22+
aliYunDriverClientService.getTFiles(root.getFile_id());
23+
} catch (Exception e) {
24+
// nothing
25+
}
26+
27+
}
28+
}

src/main/java/net/sf/webdav/methods/DoGet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ protected void folderBody(ITransaction transaction, String path,
208208
/**
209209
* Return the CSS styles used to display the HTML representation
210210
* of the webdav content.
211-
*
211+
*
212212
* @return
213213
*/
214214
protected String getCSS()
@@ -270,7 +270,7 @@ protected String getCSS()
270270

271271
/**
272272
* Return the header to be displayed in front of the folder content
273-
*
273+
*
274274
* @param transaction
275275
* @param path
276276
* @param resp
@@ -285,7 +285,7 @@ protected String getHeader(ITransaction transaction, String path,
285285

286286
/**
287287
* Return the footer to be displayed after the folder content
288-
*
288+
*
289289
* @param transaction
290290
* @param path
291291
* @param resp

0 commit comments

Comments
 (0)