There's a method Document
called getDocumentUri()
that might do what you want. It seems to depend on what way the Document was created whether the Uri is set to something or null
. I don't know how JSoup creates the documents, so your mileage may vary.
http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Document.html#getDocumentURI()
If JSoup doesn't set it, you could call setDocumentUri()
manually in your method, and then use getDocumentUri()
where you needed it?