Package org.infoglue.cms.util.webdav

Source Code of org.infoglue.cms.util.webdav.RepositoryResourceFactoryFactory

package org.infoglue.cms.util.webdav;

import org.apache.log4j.Logger;

import com.bradmcevoy.http.AuthenticationService;
import com.bradmcevoy.http.ResourceFactory;
import com.bradmcevoy.http.ResourceFactoryFactory;
import com.bradmcevoy.http.webdav.DefaultWebDavResponseHandler;
import com.bradmcevoy.http.webdav.WebDavResponseHandler;


public class RepositoryResourceFactoryFactory implements ResourceFactoryFactory
{
  private final static Logger logger = Logger.getLogger(RepositoryResourceFactoryFactory.class.getName());

  private static AuthenticationService authenticationService;
  private static RepositoryResourceFactory resourceFactory;

  public ResourceFactory createResourceFactory() {
    return resourceFactory;
  }

  public WebDavResponseHandler createResponseHandler() {
    return new DefaultWebDavResponseHandler(authenticationService);
  }

  public void init()
  {
   
    if(logger.isInfoEnabled())
      logger.info("init ContentResourceFactoryFactory");
   
    if( authenticationService == null ) {
      authenticationService = new AuthenticationService();
      resourceFactory = new RepositoryResourceFactory();     
    }
  }
}
TOP

Related Classes of org.infoglue.cms.util.webdav.RepositoryResourceFactoryFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.