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

de.mklinger.qetcher.liferay.client.impl.htmlinliner.ResourceLoader Maven / Gradle / Ivy

The newest version!
package de.mklinger.qetcher.liferay.client.impl.htmlinliner;

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Optional;

/**
 * @author Marc Klinger - mklinger[at]mklinger[dot]de
 */
public interface ResourceLoader extends Closeable {
	/**
	 * Get the contents of the given URL as String.
	 * @return empty optional in case of problems.
	 */
	Optional getContents(URI url, URI referrer);

	/**
	 * Read binary image data from in and get e.g. data:image/jpeg;base64,dada...
	 * @throws IOException In case of encoding problems
	 */
	String getInlineImgSrc(String contentType, InputStream in) throws IOException;

	/**
	 * Get the contents of the given URL as HTML img tag src: e.g. data:image/jpeg;base64,dada...
	 * @return empty optional in case of problems.
	 */
	Optional getExternalInlineImgSrc(URI url, URI referrer);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy