0

I am using getClass.getClassLoader().getResourceAsStream("abc.txt") which returns of type Inputstream, to get the filepath which works fine. Now i need to pass the the filepath to streamresult but it has a constructor : StreamResult(new FileOutputStream()). How do i pass the filepath which is of type inputstream to to streamresult.

I am reading an xml file and displaying that data in a jsp file. From the jsp file i am setting a flag which writes data back to the xml file. TransformerFactory.newInstance().newTransformer().transform(new DOMSource(ds.getOwnerDocument()), new StreamResult(new FileOutputStream(pathFile)));. So pathFile is the file to which i want to write data to. I just cannot pass abc.txt in place of pathFile because i need the absoulte file path.

Coder17
  • 767
  • 4
  • 11
  • 30

0 Answers0