/** * Parses file into StyleSheet. Internally transforms file to URL * @param fileName Name of file * @param encoding Encoding used to parse input * @return Parsed style sheet * @throws CSSException In case that parsing error occurs * @throws IOException If file is not found or not readable */ public static final StyleSheet parse(String fileName, String encoding) throws CSSException, IOException { try { File f = new File(fileName); URL url = f.toURI().toURL(); return parse(url, encoding); } catch (MalformedURLException e) { String message = "Unable to construct URL from fileName: " + fileName; log.error(message); throw new FileNotFoundException(message); } }
/** * Parses file into StyleSheet. Internally transforms file to URL * @param fileName Name of file * @param encoding Encoding used to parse input * @return Parsed style sheet * @throws CSSException In case that parsing error occurs * @throws IOException If file is not found or not readable */ public static final StyleSheet parse(String fileName, String encoding) throws CSSException, IOException { try { File f = new File(fileName); URL url = f.toURI().toURL(); return parse(url, encoding); } catch (MalformedURLException e) { String message = "Unable to construct URL from fileName: " + fileName; log.error(message); throw new FileNotFoundException(message); } }
/** * Parses file into StyleSheet. Internally transforms file to URL * @param fileName Name of file * @param encoding Encoding used to parse input * @return Parsed style sheet * @throws CSSException In case that parsing error occurs * @throws IOException If file is not found or not readable */ public static final StyleSheet parse(String fileName, String encoding) throws CSSException, IOException { try { File f = new File(fileName); URL url = f.toURI().toURL(); return parse(url, encoding); } catch (MalformedURLException e) { String message = "Unable to construct URL from fileName: " + fileName; log.error(message); throw new FileNotFoundException(message); } }
/** * Parses file into StyleSheet. Internally transforms file to URL * @param fileName Name of file * @param encoding Encoding used to parse input * @return Parsed style sheet * @throws CSSException In case that parsing error occurs * @throws IOException If file is not found or not readable */ public static final StyleSheet parse(String fileName, String encoding) throws CSSException, IOException { try { File f = new File(fileName); URL url = f.toURI().toURL(); return parse(url, encoding); } catch (MalformedURLException e) { String message = "Unable to construct URL from fileName: " + fileName; log.error(message); throw new FileNotFoundException(message); } }