try {
Object oUCB = xMSF.createInstanceWithArguments
("com.sun.star.ucb.UniversalContentBroker",
new Object[] {"Local", "Office"}) ;
XContentIdentifierFactory ciFac = (XContentIdentifierFactory)
UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB) ;
String url = util.utils.getFullTestURL("SwXTextEmbeddedObject.sxw") ;
String escUrl = "" ;
// In base URL of a JAR file in content URL all directory
// separators ('/') must be replaced with escape symbol '%2F'.
int idx = url.indexOf("/") ;
int lastIdx = -1 ;
while (idx >= 0) {
escUrl += url.substring(lastIdx + 1, idx) + "%2F" ;
lastIdx = idx ;
idx = url.indexOf("/", idx + 1) ;
}
escUrl += url.substring(lastIdx + 1) ;
String cntUrl = "vnd.sun.star.pkg://" + escUrl + "/" ;
log.println("Getting Content of '" + cntUrl + "'") ;
XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;
XContentProvider cntProv = (XContentProvider)
UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;
XContent cnt = cntProv.queryContent(CI) ;