forked from fanruan/finekit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1006 B
37 lines
1006 B
package com.fanruan.api.cluster.resource; |
|
|
|
import com.fr.decision.fileserver.FineFileServer; |
|
import com.fr.io.config.RepositoryConfig; |
|
import com.fr.io.repository.ResourceRepository; |
|
|
|
/** |
|
* 文件服务器Kit. |
|
* |
|
* @author Dylan.Liu |
|
* @version 10.0 |
|
* Created by Dylan.Liu on 2021/1/12 |
|
*/ |
|
public class FineFileServerKit { |
|
|
|
/** |
|
* 获取文件服务器当前配置. |
|
* |
|
* @return 文件服务器当前配置 |
|
* @throws Exception 获取配置失败时异常 |
|
*/ |
|
public static <T extends RepositoryConfig> T getRepoConfig() throws Exception { |
|
return FineFileServer.getInstance().getRepoConfig(); |
|
} |
|
|
|
/** |
|
* 文件服务器读写权限测试. |
|
* |
|
* @param repo 仓库 |
|
* @param workRoot 工作路径 |
|
* @return 是否有读写权限 |
|
*/ |
|
public static boolean hasReadWritePermission(ResourceRepository repo, String workRoot) { |
|
return FineFileServer.getInstance().hasReadWritePermission(repo, workRoot); |
|
} |
|
|
|
}
|
|
|