public static T unwrap()

in common/src/main/java/org/jetbrains/teamcity/vault/support/VaultResponses.java [181:201]


	public static <T> T unwrap(final String wrappedResponse, Class<T> responseType) {

		Assert.hasText(wrappedResponse, "Wrapped response must not be empty");

		try {
			return (T) converter.read(responseType, new HttpInputMessage() {
				@Override
				public InputStream getBody() throws IOException {
					return new ByteArrayInputStream(wrappedResponse.getBytes());
				}

				@Override
				public HttpHeaders getHeaders() {
					return new HttpHeaders();
				}
			});
		}
		catch (IOException e) {
			throw new IllegalStateException(e);
		}
	}