Class CssUrlMapper
- java.lang.Object
-
- com.composum.sling.clientlibs.processor.CssUrlMapper
-
- All Implemented Interfaces:
ClientlibProcessor
public class CssUrlMapper extends Object implements ClientlibProcessor
A simple processor to map URLs embedded in CSS files.
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
URL_PATTERN
-
Fields inherited from interface com.composum.sling.clientlibs.service.ClientlibProcessor
DEFAULT_CHARSET
-
-
Constructor Summary
Constructors Constructor Description CssUrlMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
map(ProcessorContext context, String url)
void
map(String css, Writer writer, ProcessorContext context)
InputStream
processContent(InputStream source, ProcessorContext context)
Transforms the content and result in a stream with the probably changed content - for pipes.
-
-
-
Field Detail
-
URL_PATTERN
public static final Pattern URL_PATTERN
-
-
Method Detail
-
processContent
public InputStream processContent(InputStream source, ProcessorContext context) throws IOException
Description copied from interface:ClientlibProcessor
Transforms the content and result in a stream with the probably changed content - for pipes.- Specified by:
processContent
in interfaceClientlibProcessor
- Parameters:
source
- the original to process by the processor. the processor returns a different stream, this must be closed by the processor.- Returns:
- the transformation result - might also be the originial sourceStream if switched off
- Throws:
IOException
-
map
public void map(String css, Writer writer, ProcessorContext context)
-
map
public String map(ProcessorContext context, String url)
-
-