if (is.available() == 0)
{
return "";
}
final XSLFPowerPointExtractor ppe;
try
{
ppe = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<XSLFPowerPointExtractor>()
{
public XSLFPowerPointExtractor run() throws Exception
{
return new XSLFPowerPointExtractor(OPCPackage.open(is));
}
});
}
catch (PrivilegedActionException pae)
{
Throwable cause = pae.getCause();
if (cause instanceof IOException)
{
throw new DocumentReadException("Can't open presentation.", cause);
}
else if (cause instanceof OpenXML4JRuntimeException)
{
throw new DocumentReadException("Can't open presentation.", cause);
}
else if (cause instanceof OpenXML4JException)
{
throw new DocumentReadException("Can't open presentation.", cause);
}
else if (cause instanceof XmlException)
{
throw new DocumentReadException("Can't open presentation.", cause);
}
else if (cause instanceof RuntimeException)
{
throw (RuntimeException)cause;
}
else
{
throw new RuntimeException(cause);
}
}
return SecurityHelper.doPrivilegedAction(new PrivilegedAction<String>()
{
public String run()
{
return ppe.getText(true, true);
}
});
}
finally
{