All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bndtools.templating.StringResource Maven / Gradle / Ivy

The newest version!
package org.bndtools.templating;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

public class StringResource implements Resource {

	private final String content;

	public StringResource(String content) {
		this.content = content;
	}

	@Override
	public ResourceType getType() {
		return ResourceType.File;
	}

	@Override
	public InputStream getContent() throws IOException {
		return new ByteArrayInputStream(content.getBytes("UTF-8"));
	}

	@Override
	public String getTextEncoding() {
		return "UTF-8";
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy