servletContext.setAttribute(UploadUtils.PROPERTIES_ATTRIBUTE, props);
// Repository directory (this is where files are sent to)
File repositoryDir = UploadUtils.getMediaDir(servletContext);
UploadListener uploadListener = new UploadListener();
uploadListener.setCouchDb(couchDb);
servletContext.setAttribute(UploadServlet.OnUploadedListenerAttributeName, uploadListener);
OnUploadedListenerSingleton.configure(uploadListener);
try {
uploadWorker = new UploadWorker();