Package com.inet.lib.less
Class ReaderFactory
- java.lang.Object
-
- com.inet.lib.less.ReaderFactory
-
public class ReaderFactory extends java.lang.ObjectA factory to create a reader and streams for parsing. You can override it to resolve the URL, implement a cache or use another encoding as UFT-8.
-
-
Constructor Summary
Constructors Constructor Description ReaderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Readercreate(java.net.URL url)Create a Reader for the given URL.java.io.InputStreamopenStream(java.net.URL url)Open an InputStream for the given URL.java.io.InputStreamopenStream(java.net.URL baseURL, java.lang.String urlStr, java.lang.String relativeUrlStr)Open an InputStream for the given URL.
-
-
-
Method Detail
-
openStream
public java.io.InputStream openStream(java.net.URL url) throws java.io.IOExceptionOpen an InputStream for the given URL.- Parameters:
url- the url, not null- Returns:
- the stream, never null
- Throws:
java.io.IOException- If any I/O error occur on reading the URL.
-
openStream
public java.io.InputStream openStream(java.net.URL baseURL, java.lang.String urlStr, java.lang.String relativeUrlStr) throws java.io.IOExceptionOpen an InputStream for the given URL. This is used for inlining images via data-uri.- Parameters:
baseURL- the URL of the top less fileurlStr- the absolute or relative URL that should be openrelativeUrlStr- relative URL of the less script- Returns:
- the stream, never null
- Throws:
java.io.IOException- If any I/O error occur on reading the URL.
-
create
public java.io.Reader create(java.net.URL url) throws java.io.IOExceptionCreate a Reader for the given URL.- Parameters:
url- the url, not null- Returns:
- the reader, never null
- Throws:
java.io.IOException- If any I/O error occur on reading the URL.
-
-