Class ResourceController

java.lang.Object
org.springframework.cloud.config.server.resource.ResourceController

@RestController @RequestMapping(method=GET, path="${spring.cloud.config.server.prefix:}") public class ResourceController extends Object
An HTTP endpoint for serving up templated plain text resources from an underlying repository. Can be used to supply config files for consumption by a wide variety of applications and services. A ResourceRepository is used to locate a Resource, specific to an application, and the contents are transformed to text. Then an EnvironmentRepository is used to supply key-value pairs which are used to replace placeholders in the resource text.
Author:
Dave Syer, Daniel Lavoie
  • Constructor Details

  • Method Details

    • setEncryptEnabled

      public void setEncryptEnabled(boolean encryptEnabled)
    • setPlainTextEncryptEnabled

      public void setPlainTextEncryptEnabled(boolean plainTextEncryptEnabled)
    • retrieve

      @GetMapping("/{name}/{profile}/{label}/**") public String retrieve(@PathVariable String name, @PathVariable String profile, @PathVariable String label, org.springframework.web.context.request.ServletWebRequest request, @RequestParam(defaultValue="true") boolean resolvePlaceholders, @RequestHeader(value="Accept-Charset",required=false,defaultValue="UTF-8") String acceptedCharset) throws IOException
      Throws:
      IOException
    • retrieveDefault

      @GetMapping(value="/{name}/{profile}/{path:.*}", params="useDefaultLabel") public String retrieveDefault(@PathVariable String name, @PathVariable String profile, @PathVariable String path, org.springframework.web.context.request.ServletWebRequest request, @RequestParam(defaultValue="true") boolean resolvePlaceholders, @RequestHeader(value="Accept-Charset",required=false,defaultValue="UTF-8") String acceptedCharset) throws IOException
      Throws:
      IOException
    • binary

      @GetMapping(value="/{name}/{profile}/{label}/**", produces="application/octet-stream") public byte[] binary(@PathVariable String name, @PathVariable String profile, @PathVariable String label, org.springframework.web.context.request.ServletWebRequest request) throws IOException
      Throws:
      IOException
    • binaryDefault

      @GetMapping(value="/{name}/{profile}/{path:.*}", params="useDefaultLabel", produces="application/octet-stream") public byte[] binaryDefault(@PathVariable String name, @PathVariable String profile, @PathVariable String path, org.springframework.web.context.request.ServletWebRequest request) throws IOException
      Throws:
      IOException