Class AgentFileProtocolResolver
java.lang.Object
com.netflix.genie.web.agent.resources.AgentFileProtocolResolver
- All Implemented Interfaces:
org.springframework.core.io.ProtocolResolver
public class AgentFileProtocolResolver
extends Object
implements org.springframework.core.io.ProtocolResolver
Resource resolver for files local to an agent running a job that can be streamed to the server and served via API.
The URI for such resources is: agent://<jobId>/<relativePath>.
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionAgentFileProtocolResolver(AgentFileStreamService agentFileStreamService) Constructor. -
Method Summary
-
Constructor Details
-
AgentFileProtocolResolver
Constructor.- Parameters:
agentFileStreamService- the agent file stream service
-
-
Method Details
-
createUri
public static URI createUri(String jobId, String path, @Nullable String rangeHeader) throws URISyntaxException Create a URI for the given remote agent file.- Parameters:
jobId- the job idpath- the path of the file within the job directoryrangeHeader- the request range header (as per RFC 7233)- Returns:
- a
URIrepresenting the remote agent file - Throws:
URISyntaxException- if constructing the URI fails
-
resolve
public org.springframework.core.io.Resource resolve(String location, org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
resolvein interfaceorg.springframework.core.io.ProtocolResolver
-