/** * Returns the content of a specified file as a String. * * @param path * @return the content of a specified file as a String * @throws IOException */ public static String readFileToString(String path) throws IOException { FileReader read = new FileReader(path); return readToString(read); }
/** * Returns the content of a specified file as a String. * * @param file * @return the content of a specified file as a String * @throws IOException */ public static String readFileToString(File file) throws IOException { FileReader reader = new FileReader(file); return readToString(reader); }
/** * Returns a String read from a specified InputStream. * * @param stream * The specified InputStream * @return The String read from the specified InputStream * @throws IOException */ public static String readToString(InputStream stream) throws IOException { return readToString(new InputStreamReader(stream)); }
/** * Returns the content of a specified file as a String. * * @param path * @return the content of a specified file as a String * @throws IOException */ public static String readFileToString(String path) throws IOException { FileReader read = new FileReader(path); return readToString(read); }
/** * Returns the content of a specified file as a String. * * @param file * @return the content of a specified file as a String * @throws IOException */ public static String readFileToString(File file) throws IOException { FileReader reader = new FileReader(file); return readToString(reader); }
/** * Returns a String read from a specified InputStream. * * @param stream * The specified InputStream * @return The String read from the specified InputStream * @throws IOException */ public static String readToString(InputStream stream) throws IOException { return readToString(new InputStreamReader(stream)); }
private void addComponents(String name) { try { URL wsdlUrl = new URL(this.url, name); logger.debug("WSDL URL: " + wsdlUrl); String wsdlString = IOUtil.readToString(wsdlUrl.openStream()); logger.debug("WSDL: " + wsdlString); List<WSComponent> components = WSComponentFactory.createComponents(wsdlString); addComponents(name, components); } catch (MalformedURLException e) { // Ignore logger.error(e.getMessage(), e); } catch (IOException e) { // Ignore logger.error(e.getMessage(), e); } catch (RuntimeException e) { logger.error(e.getMessage(), e); } }
/** * @param file * @return The XmlElement in the document. * @throws IOException */ public static org.xmlpull.infoset.XmlElement loadXML(InputStream stream) throws IOException { String xmlText = IOUtil.readToString(stream); XmlDocument document = BUILDER.parseString(xmlText); return document.getDocumentElement(); }