/** * Reads a specified file and creates a graph. * * @param file * @return The graph created * @throws GraphException * @throws IOException */ public static WSGraph createGraph(File file) throws GraphException, IOException { String graphString = IOUtil.readFileToString(file); return createGraph(graphString); }
/** * @param file * @return The XmlElement in the document. * @throws IOException */ public static org.xmlpull.infoset.XmlElement loadXML(File file) throws IOException { String xmlText = IOUtil.readFileToString(file); XmlDocument document = BUILDER.parseString(xmlText); return document.getDocumentElement(); }
/** * @param file * @return The list of components defined in the specified file. * @throws ComponentException * @throws ComponentRegistryException */ public List<WSComponent> getComponents(File file) throws ComponentException, ComponentRegistryException { try { String compString = IOUtil.readFileToString(file); List<WSComponent> components = WSComponentFactory .createComponents(compString); return components; } catch (IOException e) { throw new ComponentRegistryException(e); } }