if (_xMSF == null)
{
GlobalLogWriter.get().println("MultiServiceFactory not set.");
return;
}
XTypeDetection aTypeDetection = null;
try
{
Object oObj = _xMSF.createInstance("com.sun.star.document.TypeDetection");
aTypeDetection = (XTypeDetection)UnoRuntime.queryInterface(XTypeDetection.class, oObj);
}
catch(com.sun.star.uno.Exception e)
{
GlobalLogWriter.get().println("Can't get com.sun.star.document.TypeDetection.");
return;
}
if (aTypeDetection != null)
{
String sType = aTypeDetection.queryTypeByURL(_sInputURL);
GlobalLogWriter.get().println("Type is: " + sType);
}
}