}
public LSInput resolveResource(String type, String namespaceURI, String publicId, final String systemId, final String baseURI) {
LOGGER.fine("type="+type+ " namespaceURI="+namespaceURI+" publicId="+publicId+" systemId="+systemId+" baseURI="+baseURI);
try {
final SDDocument doc;
if (systemId == null) {
doc = nsMapping.get(namespaceURI);
} else {
URI rel = (baseURI != null)
? new URI(baseURI).resolve(systemId)
: new URI(systemId);
doc = docs.get(rel.toString());
}
if (doc != null) {
return new LSInput() {
public Reader getCharacterStream() {
return null;
}
public void setCharacterStream(Reader characterStream) {
throw new UnsupportedOperationException();
}
public InputStream getByteStream() {
ByteArrayBuffer bab = new ByteArrayBuffer();
try {
doc.writeTo(null, resolver, bab);
} catch (IOException ioe) {
throw new WebServiceException(ioe);
}
return bab.newInputStream();
}
public void setByteStream(InputStream byteStream) {
throw new UnsupportedOperationException();
}
public String getStringData() {
return null;
}
public void setStringData(String stringData) {
throw new UnsupportedOperationException();
}
public String getSystemId() {
return doc.getURL().toExternalForm();
}
public void setSystemId(String systemId) {
throw new UnsupportedOperationException();
}
public String getPublicId() {
return null;
}
public void setPublicId(String publicId) {
throw new UnsupportedOperationException();
}
public String getBaseURI() {
return doc.getURL().toExternalForm();
}
public void setBaseURI(String baseURI) {
throw new UnsupportedOperationException();
}