final URL aURL = new URL();
aURL.Complete = util.utils.getOfficeTemp(
(XMultiServiceFactory) tParam.getMSF()) +
"picture.jpg";
final XSimpleFileAccess fAcc;
try {
Object oFAcc = ((XMultiServiceFactory) tParam.getMSF()).createInstance(
"com.sun.star.ucb.SimpleFileAccess");
fAcc = (XSimpleFileAccess) UnoRuntime.queryInterface(
XSimpleFileAccess.class, oFAcc);
if (fAcc.exists(aURL.Complete)) {
fAcc.kill(aURL.Complete);
}
} catch (com.sun.star.uno.Exception e) {
log.println("Error accessing file system :");
e.printStackTrace(log);
throw new StatusException("Error accessing file system.", e);
}
oObj = (XInterface) go;
log.println("ImplName " + util.utils.getImplName(oObj));
TestEnvironment tEnv = new TestEnvironment(oObj);
tEnv.addObjRelation("MediaDescriptor",
XMLTools.createMediaDescriptor(
new String[] {
"FilterName", "URL", "MediaType"
}, new Object[] { "JPG", aURL, "image/jpeg" }));
tEnv.addObjRelation("SourceDocument", xComp);
log.println("adding ObjRelation for XFilter");
log.println("This Component doesn't really support the cancel method");
log.println("See #101725");
tEnv.addObjRelation("NoFilter.cancel()", new Boolean(true));
final String hideMode = (String) tParam.get("soapi.test.hidewindows");
tEnv.addObjRelation("XFilter.Checker",
new ifc.document._XFilter.FilterChecker() {
public boolean checkFilter() {
try {
if ((hideMode != null) && hideMode.equals("true")) {
return true;
}
return fAcc.exists(aURL.Complete);
} catch (com.sun.star.uno.Exception e) {
return false;
}
}
});