@RestController @RequestMapping(value="/manage/file/") public class ProjectFileControl extends BaseAgentController
projectInfoService| Constructor and Description |
|---|
ProjectFileControl(ConsoleService consoleService,
WhitelistDirectoryService whitelistDirectoryService) |
| Modifier and Type | Method and Description |
|---|---|
String |
batchDelete(DiffFileVo diffFileVo) |
String |
deleteFile(String filename,
String type,
String levelName) |
String |
diffFile(DiffFileVo diffFileVo)
对比文件
|
String |
download(String id,
String filename,
String levelName)
将执行文件下载到客户端 本地
|
String |
getFileList(String id,
String path) |
String |
newFileFolder(String id,
String levelName,
String filename,
String unFolder)
创建文件夹/文件
|
String |
readFile(String filePath,
String filename)
读取文件内容 (只能处理文本文件)
|
String |
remoteDownload(String id,
String url,
String levelName,
String unzip)
下载远程文件
|
String |
rename(String id,
String levelName,
String filename,
String newname)
修改文件夹/文件
|
String |
updateConfigFile(String filePath,
String filename,
String fileText)
保存文件内容 (只能处理文本文件)
|
String |
upload() |
getNowUserName, getProjectInfoModel, getProjectInfoModel, getUserName, getWorkspaceId, tryGetProjectInfoModel, tryGetProjectInfoModelcheckPathSafe, pathSafeclearResources, createMultipart, getCookieValue, getHeader, getHeaders, getIp, getMultiRequest, getObject, getParameter, getParameter, getParameterInt, getParameterInt, getParameterLong, getParameterLong, getParameters, getParametersMap, getRefererParameter, getUnescapeParameter, getUnescapeParameter, getUnescapeParameters, getXssParameter, getXssParameter, getXssParameters, hasFile, resetInfogetApplication, getAttribute, getClientIP, getHeaderMapValues, getRequest, getRequestAttributes, getResponse, getSession, getSessionAttribute, getSessionAttributeObj, removeSessionAttribute, setAttribute, setSessionAttribute, tryGetRequestAttributespublic ProjectFileControl(ConsoleService consoleService, WhitelistDirectoryService whitelistDirectoryService)
@RequestMapping(value="getFileList",
method=POST,
produces="application/json")
public String getFileList(String id,
String path)
@PostMapping(value="diff_file",
produces="application/json")
public String diffFile(@RequestBody
DiffFileVo diffFileVo)
diffFileVo - 参数@RequestMapping(value="upload",
method=POST,
produces="application/json")
public String upload()
throws Exception
Exception@RequestMapping(value="deleteFile",
method=POST,
produces="application/json")
public String deleteFile(String filename,
String type,
String levelName)
@RequestMapping(value="batch_delete",
method=POST,
produces="application/json")
public String batchDelete(@RequestBody
DiffFileVo diffFileVo)
@PostMapping(value="read_file",
produces="application/json")
public String readFile(String filePath,
String filename)
filePath - 相对项目文件的文件夹filename - 读取的文件名@PostMapping(value="update_config_file",
produces="application/json")
public String updateConfigFile(String filePath,
String filename,
String fileText)
filePath - 相对项目文件的文件夹filename - 读取的文件名fileText - 文件内容@GetMapping(value="download",
produces="application/json")
public String download(String id,
String filename,
String levelName)
id - 项目idfilename - 文件名levelName - 文件夹名@PostMapping(value="remote_download",
produces="application/json")
public String remoteDownload(String id,
String url,
String levelName,
String unzip)
id - 项目idurl - 远程 url 地址levelName - 保存的文件夹unzip - 是否为压缩包、true 将自动解压@PostMapping(value="new_file_folder.json",
produces="application/json")
public String newFileFolder(String id,
String levelName,
@ValidatorItem
String filename,
String unFolder)
id - 项目IDlevelName - 二级文件夹名filename - 文件名unFolder - true/1 为文件夹,false/0 为文件Copyright © 2017–2022. All rights reserved.