|
|
@@ -44,6 +44,9 @@ public class ResourceServiceImpl implements ResourceService {
|
|
|
|
|
|
private Logger logger = Logger.getLogger(getClass());
|
|
|
|
|
|
+ // 是否为windows系统
|
|
|
+ private boolean isWindowsPlatform = System.getProperty("os.name").toLowerCase().startsWith("win");
|
|
|
+
|
|
|
@Override
|
|
|
public List<Resource> syncResources(String userName)
|
|
|
throws ClientProtocolException, URISyntaxException, IOException {
|
|
|
@@ -104,7 +107,11 @@ public class ResourceServiceImpl implements ResourceService {
|
|
|
}
|
|
|
|
|
|
for (Resource localResource : localResources) {
|
|
|
- if (remoteResource.getUri().equals(localResource.getUri())) {
|
|
|
+ // windows平台并不区分文件名的大小写,即使将该资源视为需要同步,也无法创建相应文件
|
|
|
+ // 1.若路径完全相同
|
|
|
+ // 2.或者为windows平台并且忽略大小写后路径相同
|
|
|
+ if (remoteResource.getUri().equals(localResource.getUri())
|
|
|
+ || (isWindowsPlatform && remoteResource.getUri().equalsIgnoreCase(localResource.getUri()))) {
|
|
|
// 如果远程资源比本地资源更新
|
|
|
if (remoteResource.getUpdateDate().after(localResource.getUpdateDate())) {
|
|
|
return true;
|