@RestController
@RequestMapping(method=GET,
path="${spring.cloud.config.server.prefix:}")
public class ResourceController
extends Object
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.| Constructor and Description |
|---|
ResourceController(ResourceRepository resourceRepository,
EnvironmentRepository environmentRepository) |
ResourceController(ResourceRepository resourceRepository,
EnvironmentRepository environmentRepository,
Map<String,ResourceEncryptor> resourceEncryptorMap) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
binary(String name,
String profile,
String label,
org.springframework.web.context.request.ServletWebRequest request) |
void |
notFound(NoSuchResourceException e) |
String |
retrieve(String name,
String profile,
String label,
org.springframework.web.context.request.ServletWebRequest request,
boolean resolvePlaceholders) |
void |
setEncryptEnabled(boolean encryptEnabled) |
void |
setPlainTextEncryptEnabled(boolean plainTextEncryptEnabled) |
public ResourceController(ResourceRepository resourceRepository, EnvironmentRepository environmentRepository, Map<String,ResourceEncryptor> resourceEncryptorMap)
public ResourceController(ResourceRepository resourceRepository, EnvironmentRepository environmentRepository)
public void setEncryptEnabled(boolean encryptEnabled)
public void setPlainTextEncryptEnabled(boolean plainTextEncryptEnabled)
@RequestMapping(value="/{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)
throws IOException
IOException@RequestMapping(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
IOException@ExceptionHandler(value=NoSuchResourceException.class) @ResponseStatus(value=NOT_FOUND) public void notFound(NoSuchResourceException e)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.