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 Details

    • AgentFileProtocolResolver

      public AgentFileProtocolResolver(AgentFileStreamService agentFileStreamService)
      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 id
      path - the path of the file within the job directory
      rangeHeader - the request range header (as per RFC 7233)
      Returns:
      a URI representing 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:
      resolve in interface org.springframework.core.io.ProtocolResolver