ro.isdc.wro.model.resource.processor.support
Class DataUriGenerator
java.lang.Object
ro.isdc.wro.model.resource.processor.support.DataUriGenerator
public class DataUriGenerator
- extends Object
Generator for Data URIs.
(Inspired from: http://github.com/nzakas/cssembed.)
- Author:
- Alex Objelean, Ivar Conradi Ă˜sthus
Method Summary |
String |
generateDataURI(InputStream inputStream,
String fileName)
Generate the dataUri as string associated to the passed InputStream with encoding & type based on provided
fileName. |
static boolean |
isDataUri(String url)
Check if the url is actually a dataUri (base64 encoded value). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataUriGenerator
public DataUriGenerator()
generateDataURI
public String generateDataURI(InputStream inputStream,
String fileName)
throws IOException
- Generate the dataUri as string associated to the passed InputStream with encoding & type based on provided
fileName.
- Throws:
IOException
isDataUri
public static boolean isDataUri(String url)
- Check if the url is actually a dataUri (base64 encoded value).
- Parameters:
url
- to check
- Returns:
- true if the url is a base64 encoded value.
Copyright © 2008-2013. All Rights Reserved.