Esempio n. 1
0
  @Override
  public void init(final ServletConfig config) throws ServletException {
    this.config = config;

    setRepositoryResolver(new FileResolver<HttpServletRequest>((ResourceManager) resourceManager));
    super.init(this);
  }
Esempio n. 2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.jgit.http.server.GitServlet#init(javax.servlet.ServletConfig)
  */
 @Override
 public void init(final ServletConfig config) throws ServletException {
   // initial resolver.
   File root = getFile(config, "base-path");
   if (!root.exists()) {
     root.mkdirs();
   }
   boolean exportAll = getBoolean(config, "export-all");
   this.setRepositoryResolver(new AuthorizationFileResolver(root, exportAll));
   this.log.info(
       "initial by(base-path:" + root.getAbsolutePath() + ",export-all:" + exportAll + ")");
   //
   // System.out.println("<-----ssssssddddddddddd------>");
   // System.out.println(config.getInitParameter("base-path"));
   // SyncMgr.smgr().setWsDir(new File("/tmp/mgit"));
   // SyncMgr.smgr().setSync2Remoete(true);
   // AutoMerge am = SyncMgr.smgr().amerge("jgd");
   // if (am == null) {
   // try {
   // SyncMgr.smgr().addAMerge("jgd",
   // "file:///Users/Scorpion/Temp/jgd.git",
   // "file:///Users/Scorpion/Temp/jgdt.git");
   // } catch (Exception e) {
   // e.printStackTrace();
   // }
   // }
   super.init(config);
 }