List of usage examples for javax.servlet ServletContext getResourceAsStream
public InputStream getResourceAsStream(String path);
InputStream
object. From source file:org.apache.catalina.core.StandardContext.java
/** JSR77 deploymentDescriptor attribute * * @return string deployment descriptor *///from w ww. ja v a 2s.com public String getDeploymentDescriptor() { InputStream stream = null; ServletContext servletContext = getServletContext(); if (servletContext != null) { stream = servletContext.getResourceAsStream(org.apache.catalina.startup.Constants.ApplicationWebXml); } if (stream == null) { return ""; } BufferedReader br = new BufferedReader(new InputStreamReader(stream)); StringBuffer sb = new StringBuffer(); String strRead = ""; try { while (strRead != null) { sb.append(strRead); strRead = br.readLine(); } } catch (IOException e) { return ""; } return sb.toString(); }