// set temp directory and the threshold for all services with a
// StreamingAttachment annotation
if (delegate.adapters != null) {
// get the CmisService factory
CmisServiceFactory factory = (CmisServiceFactory) getServletContext().getAttribute(
CmisRepositoryContextListener.SERVICES_FACTORY);
if (factory == null) {
throw new CmisRuntimeException("Service factory not available! Configuration problem?");
}
// iterate of all adapters
for (ServletAdapter adapter : delegate.adapters) {
WSFeatureList wsfl = adapter.getEndpoint().getBinding().getFeatures();
for (WebServiceFeature ft : wsfl) {
if (ft instanceof StreamingAttachmentFeature) {
((StreamingAttachmentFeature) ft).setDir(factory.getTempDirectory().getAbsolutePath());
((StreamingAttachmentFeature) ft).setMemoryThreshold(factory.getMemoryThreshold());
}
}
}
}