/** * Read file or url specified by <tt>path</tt>. * @return file or url content as <tt>byte[]</tt> or as <tt>String</tt> if * <tt>convertToString</tt> is true. */ private static Object readFileOrUrl(String path, boolean convertToString) throws IOException { return SourceReader.readFileOrUrl(path, convertToString, shellContextFactory.getCharacterEncoding()); }
/** * Read file or url specified by <tt>path</tt>. * @return file or url content as <tt>byte[]</tt> or as <tt>String</tt> if * <tt>convertToString</tt> is true. */ private static Object readFileOrUrl(String path, boolean convertToString) throws IOException { return SourceReader.readFileOrUrl(path, convertToString, shellContextFactory.getCharacterEncoding()); }
/** * Read file or url specified by <tt>path</tt>. * @return file or url content as <tt>byte[]</tt> or as <tt>String</tt> if * <tt>convertToString</tt> is true. */ private static Object readFileOrUrl(String path, boolean convertToString) { try { return SourceReader.readFileOrUrl(path, convertToString, shellContextFactory.getCharacterEncoding()); } catch (IOException ex) { Context.reportError(ToolErrorReporter.getMessage( "msg.couldnt.read.source", path, ex.getMessage())); return null; } } }
String charEnc = shellContextFactory.getCharacterEncoding(); if(charEnc == null)
Scriptable scope = getShellScope(); Charset cs; String charEnc = shellContextFactory.getCharacterEncoding(); if (charEnc != null) { cs = Charset.forName(charEnc);
Scriptable scope = getShellScope(); Charset cs; String charEnc = shellContextFactory.getCharacterEncoding(); if (charEnc != null) { cs = Charset.forName(charEnc);