• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IGitblit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.gitblit.manager.IGitblit的典型用法代码示例。如果您正苦于以下问题:Java IGitblit类的具体用法?Java IGitblit怎么用?Java IGitblit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IGitblit类属于com.gitblit.manager包,在下文中一共展示了IGitblit类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: run

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
public void run() throws UnloggedFailure {
	UserModel user = getUser(true);
	IGitblit gitblit = getContext().getGitblit();
	if (null != gitblit.getTeamModel(newUserName)) {
		throw new UnloggedFailure(1, String.format("Team %s already exists!", newUserName));
	}

	// set the new name
	user.username = newUserName;

	try {
		gitblit.reviseUser(username, user);
		stdout.println(String.format("Renamed user %s to %s.", username, newUserName));
	} catch (GitBlitException e) {
		String msg = String.format("Failed to rename user from %s to %s", username, newUserName);
		log.error(msg, e);
		throw new UnloggedFailure(1, msg);
	}
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:21,代码来源:UsersDispatcher.java


示例2: run

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
public void run() throws UnloggedFailure {

	RepositoryModel repo = getRepository(true);

	if (!getContext().getClient().getUser().canAdmin(repo)) {
		throw new UnloggedFailure(1,  String.format("Sorry, you do not have permission to delete %s", repository));
	}

	IGitblit gitblit = getContext().getGitblit();
	if (gitblit.deleteRepositoryModel(repo)) {
		stdout.println(String.format("%s has been deleted.", repository));
	} else {
		throw new UnloggedFailure(1, String.format("Failed to delete %s!", repository));
	}
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:17,代码来源:RepositoriesDispatcher.java


示例3: run

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
public void run() throws UnloggedFailure {

	if (getTeam(false) != null) {
		throw new UnloggedFailure(1, String.format("Team %s already exists!", teamname));
	}

	TeamModel team = new TeamModel(teamname);
	team.canAdmin = canAdmin;
	team.canFork = canFork;
	team.canCreate = canCreate;

	IGitblit gitblit = getContext().getGitblit();
	try {
		gitblit.addTeam(team);
		stdout.println(String.format("%s created.", teamname));
	} catch (GitBlitException e) {
		String msg = String.format("Failed to create %s!", teamname);
		log.error(msg, e);
		throw new UnloggedFailure(1, msg);
	}
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:23,代码来源:TeamsDispatcher.java


示例4: GerritGitBlitWebApp

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Inject
public GerritGitBlitWebApp(Provider<IPublicKeyManager> publicKeyManagerProvider, Provider<ITicketService> ticketServiceProvider,
		IRuntimeManager runtimeManager, IPluginManager pluginManager, INotificationManager notificationManager, IUserManager userManager,
		IAuthenticationManager authenticationManager, IRepositoryManager repositoryManager, IProjectManager projectManager,
		IFederationManager federationManager, IGitblit gitblit, IServicesManager services, IFilestoreManager filestoreManager,
		DynamicItem<WebSession> gerritSession) {
	super(publicKeyManagerProvider, ticketServiceProvider, runtimeManager, pluginManager, notificationManager, userManager,
			authenticationManager, repositoryManager, projectManager, federationManager, gitblit, services, filestoreManager);
	this.gerritSesssion = gerritSession;
	// We need this, otherwise the flotr2 library adds again links that are not recoded for static access.
	setHeaderResponseDecorator(new IHeaderResponseDecorator() {
		@Override
		public IHeaderResponse decorate(IHeaderResponse response) {
			return new StaticRewritingHeaderResponse(response);
		}
	});
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:18,代码来源:GerritGitBlitWebApp.java


示例5: getUser

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
protected UserModel getUser(boolean requireUser) throws UnloggedFailure {
	IGitblit gitblit = getContext().getGitblit();
	UserModel user = gitblit.getUserModel(username);
	if (requireUser && user == null) {
		throw new UnloggedFailure(1, String.format("User %s does not exist!", username));
	}
	return user;
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:9,代码来源:UsersDispatcher.java


示例6: getRepository

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
protected RepositoryModel getRepository(boolean requireRepository) throws UnloggedFailure {
	IGitblit gitblit = getContext().getGitblit();
	RepositoryModel repo = gitblit.getRepositoryModel(repository);
	if (requireRepository && repo == null) {
		throw new UnloggedFailure(1, String.format("Repository %s does not exist!", repository));
	}
	return repo;
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:9,代码来源:RepositoriesDispatcher.java


示例7: getItems

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
protected List<RepositoryModel> getItems() {
	IGitblit gitblit = getContext().getGitblit();
	UserModel user = getContext().getClient().getUser();
	List<RepositoryModel> repositories = gitblit.getRepositoryModels(user);
	return repositories;
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:8,代码来源:RepositoriesDispatcher.java


示例8: getItems

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
protected List<ProjectModel> getItems() {
	IGitblit gitblit = getContext().getGitblit();
	UserModel user = getContext().getClient().getUser();

	List<ProjectModel> projects = gitblit.getProjectModels(user, false);
	return projects;
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:9,代码来源:ProjectsDispatcher.java


示例9: getTeam

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
protected TeamModel getTeam(boolean requireTeam) throws UnloggedFailure {
	IGitblit gitblit = getContext().getGitblit();
	TeamModel team = gitblit.getTeamModel(teamname);
	if (requireTeam && team == null) {
		throw new UnloggedFailure(1, String.format("Team %s does not exist!", teamname));
	}
	return team;
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:9,代码来源:TeamsDispatcher.java


示例10: GerritGitBlitContext

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Inject
GerritGitBlitContext(GitBlitSettings settings, IRuntimeManager runtime, INotificationManager notificationManager, IUserManager userManager,
		IAuthenticationManager authenticationManager, IRepositoryManager repositoryManager, IProjectManager projectManager, IGitblit gitblit) {
	this.settings = settings;
	this.runtime = runtime;
	this.notificationManager = notificationManager;
	this.userManager = userManager;
	this.authenticationManager = authenticationManager;
	this.repositoryManager = repositoryManager;
	this.projectManager = projectManager;
	this.gitblit = gitblit;
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:13,代码来源:GerritGitBlitContext.java


示例11: GroovyConsole

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
public GroovyConsole() {
	this.groovyClassLoader = new GroovyClassLoader();

	BINDINGS.put("gitblit", GitblitContext.getManager(IGitblit.class));
}
 
开发者ID:lovromazgon,项目名称:gitblit-groovy-console-plugin,代码行数:6,代码来源:GroovyConsole.java


示例12: getUrl

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
protected String getUrl(TicketModel ticket) {
	return GitblitContext.getManager(IGitblit.class).getTicketService().getTicketUrl(ticket);
}
 
开发者ID:gitblit,项目名称:gitblit-slack-plugin,代码行数:4,代码来源:SlackTicketHook.java


示例13: getItems

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
protected List<UserModel> getItems() {
	IGitblit gitblit = getContext().getGitblit();
	List<UserModel> users = gitblit.getAllUsers();
	return users;
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:7,代码来源:UsersDispatcher.java


示例14: run

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
public void run() throws UnloggedFailure {
	IGitblit gitblit = getContext().getGitblit();
	gitblit.resetRepositoryListCache();
	gitblit.getTicketService().resetCaches();
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:7,代码来源:ResetCommand.java


示例15: getItems

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
protected List<TeamModel> getItems() {
	IGitblit gitblit = getContext().getGitblit();
	List<TeamModel> teams = gitblit.getAllTeams();
	return teams;
}
 
开发者ID:gitblit,项目名称:gitblit-powertools-plugin,代码行数:7,代码来源:TeamsDispatcher.java


示例16: configureServlets

import com.gitblit.manager.IGitblit; //导入依赖的package包/类
@Override
protected void configureServlets() {
	log.info("Configuring servlet and filters");
	// Plugin life-cycle listener
	bind(PluginActivator.class);
	bind(LifecycleListener.class).annotatedWith(UniqueAnnotations.create()).to(PluginActivator.class);

	// Changed things
	bind(IStoredSettings.class).to(GitBlitSettings.class);
	bind(IRuntimeManager.class).to(GerritGitBlitRuntimeManager.class);
	bind(IUserManager.class).to(GerritGitBlitUserManager.class);
	bind(IAuthenticationManager.class).to(GerritGitBlitAuthenticationManager.class);
	bind(IRepositoryManager.class).to(GerritGitBlitRepositoryManager.class);
	bind(GitblitContext.class).to(GerritGitBlitContext.class);
	bind(GitBlitWebApp.class).to(GerritGitBlitWebApp.class);
	bind(IPluginManager.class).to(NullPluginManager.class);
	bind(ITicketService.class).to(ReallyNullTicketService.class);

	// Gitblit bindings
	bind(XssFilter.class).to(JSoupXssFilter.class);
	bind(AvatarGenerator.class).to(GravatarGenerator.class);
	bind(WorkQueue.class).toProvider(WorkQueueProvider.class);

	bind(IGitblit.class).to(GitblitManager.class);

	// core managers
	bind(IPluginManager.class).to(NullPluginManager.class);
	bind(INotificationManager.class).to(NotificationManager.class);
	bind(IProjectManager.class).to(ProjectManager.class);
	bind(IFederationManager.class).to(FederationManager.class);
	bind(IFilestoreManager.class).to(FilestoreManager.class);
	bind(IPublicKeyManager.class).toProvider(IPublicKeyManagerProvider.class);

	// manager for long-running daemons and services
	bind(IServicesManager.class).to(ServicesManager.class);

	// Servlets -- note: FilestoreServlet is not configured
	serve('/' + WrappedPagesFilter.SERVLET_RELATIVE_PATH + '*').with(PagesServlet.class);
	serve('/' + WrappedRawFilter.SERVLET_RELATIVE_PATH + '*').with(RawServlet.class);
	serve('/' + WrappedSyndicationFilter.SERVLET_RELATIVE_PATH + '*').with(WrappedSyndicationServlet.class);
	serve("/zip/*").with(DownloadZipServlet.class);
	serve("/logo.png").with(LogoServlet.class);
	serve("/static/logo.png").with(LogoServlet.class);
	serve("/graph/*").with(BranchGraphServlet.class);
	serve("/static/*").with(StaticResourcesServlet.class);
	serve("/clippy.swf").with(StaticResourcesServlet.class);
	serve("/pt").with(PtServlet.class);

	// Filters
	filter("/*").through(GerritWicketFilter.class);
	filter('/' + WrappedPagesFilter.SERVLET_RELATIVE_PATH + '*').through(WrappedPagesFilter.class);
	filter('/' + WrappedRawFilter.SERVLET_RELATIVE_PATH + '*').through(WrappedRawFilter.class);
	filter('/' + WrappedSyndicationFilter.SERVLET_RELATIVE_PATH + '*').through(WrappedSyndicationFilter.class);
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:55,代码来源:GitBlitServletModule.java



注:本文中的com.gitblit.manager.IGitblit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IpPrefix类代码示例发布时间:2022-05-23
下一篇:
Java ServiceException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap