Class AgentFileManagerImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.agent.AgentFileManagerImpl
-
- All Implemented Interfaces:
AgentFileManagerCallback,SAgentFileManager
public class AgentFileManagerImpl extends Object implements SAgentFileManager, AgentFileManagerCallback
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.agent.SAgentFileManager
SAgentFileManager.Callback
-
-
Constructor Summary
Constructors Constructor Description AgentFileManagerImpl(BuildAgentManager buildAgentManager, AgentFileManagerCache cache, XStreamHolder xStreamHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(String sessionId, String error)RemoteFileStructurerequestDirectoryStructure(String agentName, String directoryName)Performs a synchronous request on agentagentNameand returns the remote structure of the directorydirectoryName(or possibly a file).voidrequestForFile(String agentName, String fileName, boolean lookupInCache, SAgentFileManager.Callback callback)Performs asynchronous request to the agentagentNamefor afileNamefile (or directory).voidsuccess(String sessionId, org.springframework.web.multipart.MultipartFile data, boolean archived)
-
-
-
Constructor Detail
-
AgentFileManagerImpl
public AgentFileManagerImpl(@NotNull BuildAgentManager buildAgentManager, @NotNull AgentFileManagerCache cache, @NotNull XStreamHolder xStreamHolder)
-
-
Method Detail
-
requestForFile
public void requestForFile(@NotNull String agentName, @NotNull String fileName, boolean lookupInCache, @NotNull SAgentFileManager.Callback callback)Description copied from interface:SAgentFileManagerPerforms asynchronous request to the agentagentNamefor afileNamefile (or directory). The caller is notified about the result viacallback. In case of success the caller is provided with the local copy of the requested file.The
fileNamesupports several useful macros:"#home","#work","#temp","#logs","#plugins","#lib","#update","#conf", and"#cache", each referring to a specific agent directory. These macros are to be used to specify the root of the requested file (or directory).Examples:
-
"#logs"- full logs directory -
"#work/directory.map"- a "directory.map" file inside agent working directory -
"#plugins/ant/lib"- full "lib" directory of the Ant plugin
Current limitations:
- you can use only slash separator (
'/'instead of'\') - wildcards
"?"and"*"are not supported
By default all transferred data is encrypted.
- Specified by:
requestForFilein interfaceSAgentFileManager- Parameters:
agentName- the name of agent to request tofileName- file (or directory) name in the format abovelookupInCache- if set totrue, server will try to use cached datacallback- the callback
-
-
error
public void error(@NotNull String sessionId, @NotNull String error)- Specified by:
errorin interfaceAgentFileManagerCallback
-
success
public void success(@NotNull String sessionId, @NotNull org.springframework.web.multipart.MultipartFile data, boolean archived)- Specified by:
successin interfaceAgentFileManagerCallback
-
requestDirectoryStructure
@Nullable public RemoteFileStructure requestDirectoryStructure(@NotNull String agentName, @NotNull String directoryName)
Description copied from interface:SAgentFileManagerPerforms a synchronous request on agentagentNameand returns the remote structure of the directorydirectoryName(or possibly a file). Method returnsnullin case of error.The
directoryNameformat is the same as inSAgentFileManager.requestForFile(String, String, boolean, Callback).- Specified by:
requestDirectoryStructurein interfaceSAgentFileManager- Parameters:
agentName- the name of agent to request todirectoryName- directory (or file) name- Returns:
- the directory structure, or null
-
-