本文整理汇总了Java中org.eclipse.jgit.transport.UploadPack类的典型用法代码示例。如果您正苦于以下问题:Java UploadPack类的具体用法?Java UploadPack怎么用?Java UploadPack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UploadPack类属于org.eclipse.jgit.transport包,在下文中一共展示了UploadPack类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
protected void execute(final FileSystemUser user,
final Repository repository,
final InputStream in,
final OutputStream out,
final OutputStream err,
final JGitFileSystem fileSystem) {
final UploadPack up = new UploadPack(repository);
final PackConfig config = new PackConfig(repository);
config.setCompressionLevel(Deflater.BEST_COMPRESSION);
up.setPackConfig(config);
up.setRefFilter(new HiddenBranchRefFilter());
try {
up.upload(in,
out,
err);
} catch (final IOException ignored) {
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:GitUploadCommand.java
示例2: create
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public UploadPack create(HttpServletRequest req, Repository repo) {
UploadPack up = new UploadPack(repo);
up.setPackConfig(config.getPackConfig());
up.setTimeout(config.getTimeout());
up.setPreUploadHook(PreUploadHookChain.newChain(Lists.newArrayList(preUploadHooks)));
up.setPostUploadHook(PostUploadHookChain.newChain(Lists.newArrayList(postUploadHooks)));
ProjectState state = (ProjectState) req.getAttribute(ATT_STATE);
for (UploadPackInitializer initializer : uploadPackInitializers) {
initializer.init(state.getNameKey(), up);
}
return up;
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:14,代码来源:GitOverHttpServlet.java
示例3: onSendPack
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public void onSendPack(
UploadPack up, Collection<? extends ObjectId> wants, Collection<? extends ObjectId> haves)
throws ServiceMayNotContinueException {
for (UploadValidationListener validator : uploadValidationListeners) {
try {
validator.onPreUpload(repository, project, remoteHost, up, wants, haves);
} catch (ValidationException e) {
throw new UploadValidationException(e.getMessage());
}
}
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:13,代码来源:UploadValidators.java
示例4: onBeginNegotiateRound
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public void onBeginNegotiateRound(
UploadPack up, Collection<? extends ObjectId> wants, int cntOffered)
throws ServiceMayNotContinueException {
for (UploadValidationListener validator : uploadValidationListeners) {
try {
validator.onBeginNegotiate(repository, project, remoteHost, up, wants, cntOffered);
} catch (ValidationException e) {
throw new UploadValidationException(e.getMessage());
}
}
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:13,代码来源:UploadValidators.java
示例5: onEndNegotiateRound
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public void onEndNegotiateRound(
UploadPack up,
Collection<? extends ObjectId> wants,
int cntCommon,
int cntNotFound,
boolean ready)
throws ServiceMayNotContinueException {}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:UploadValidators.java
示例6: runGitCommand
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
protected int runGitCommand() {
UploadPack uploadPack = new UploadPack(gitRepository);
uploadPack.setTimeout(timeout);
try {
uploadPack.upload(getInputStream(), getOutputStream(),
getErrorStream());
} catch (IOException e) {
return -4;
}
return 0;
}
开发者ID:litesolutions,项目名称:scm-ssh-plugin,代码行数:13,代码来源:GitCommandFactory.java
示例7: create
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
/**
* This does nothing special. Synchronising the project with Overleaf will
* have been performed by {@link WLRepositoryResolver}.
* @param __ Not used, required by the {@link UploadPackFactory} interface
* @param repository The JGit repository provided by the
* {@link WLRepositoryResolver}
* @return the {@link UploadPack}, used by JGit to serve the request
*/
@Override
public UploadPack create(
HttpServletRequest __,
Repository repository
) {
Log.info(
"[{}] Creating upload-pack",
repository.getWorkTree().getName()
);
return new UploadPack(repository);
}
开发者ID:winstonli,项目名称:writelatex-git-bridge,代码行数:20,代码来源:WLUploadPackFactory.java
示例8: create
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public UploadPack create(X req, Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException {
UserModel user = UserModel.ANONYMOUS;
int timeout = 0;
if (req instanceof HttpServletRequest) {
// http/https request may or may not be authenticated
user = GitBlit.self().authenticate((HttpServletRequest) req);
if (user == null) {
user = UserModel.ANONYMOUS;
}
} else if (req instanceof GitDaemonClient) {
// git daemon request is always anonymous
GitDaemonClient client = (GitDaemonClient) req;
// set timeout from Git daemon
timeout = client.getDaemon().getTimeout();
}
RefFilter refFilter = new UserRefFilter(user);
UploadPack up = new UploadPack(db);
up.setRefFilter(refFilter);
up.setTimeout(timeout);
return up;
}
开发者ID:warpfork,项目名称:gitblit,代码行数:28,代码来源:GitblitUploadPackFactory.java
示例9: create
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public UploadPack create(X req, Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException {
UserModel user = UserModel.ANONYMOUS;
int timeout = 0;
if (req instanceof HttpServletRequest) {
// http/https request may or may not be authenticated
user = GitBlit.self().authenticate((HttpServletRequest) req);
if (user == null) {
user = UserModel.ANONYMOUS;
}
} else if (req instanceof DaemonClient) {
// git daemon request is always anonymous
DaemonClient client = (DaemonClient) req;
// set timeout from Git daemon
timeout = client.getDaemon().getTimeout();
}
RefFilter refFilter = new UserRefFilter(user);
UploadPack up = new UploadPack(db);
up.setRefFilter(refFilter);
up.setTimeout(timeout);
return up;
}
开发者ID:BullShark,项目名称:IRCBlit,代码行数:28,代码来源:GitblitUploadPackFactory.java
示例10: advertiseRefs
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public void advertiseRefs(UploadPack us) {
throw new UnsupportedOperationException("HackPushNegotiateHook cannot be used for UploadPack");
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:5,代码来源:HackPushNegotiateHook.java
示例11: advertiseRefs
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public void advertiseRefs(UploadPack us) {
throw new UnsupportedOperationException(
"ReceiveCommitsAdvertiseRefsHook cannot be used for UploadPack");
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:6,代码来源:ReceiveCommitsAdvertiseRefsHook.java
示例12: advertiseRefs
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
@Override
public void advertiseRefs(UploadPack uploadPack) {
throw new UnsupportedOperationException();
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:5,代码来源:AllRefsWatcher.java
示例13: onPreUpload
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
/**
* Validate an upload before it begins.
*
* @param repository The repository
* @param project The project
* @param remoteHost Remote address/hostname of the user
* @param up the UploadPack instance being processed.
* @param wants The list of wanted objects. These may be RevObject or RevCommit if the processor
* parsed them. Implementors should not rely on the values being parsed.
* @param haves The list of common objects. Empty on an initial clone request. These may be
* RevObject or RevCommit if the processor parsed them. Implementors should not rely on the
* values being parsed.
* @throws ValidationException to block the upload and send a message back to the end-user over
* the client's protocol connection.
*/
default void onPreUpload(
Repository repository,
Project project,
String remoteHost,
UploadPack up,
Collection<? extends ObjectId> wants,
Collection<? extends ObjectId> haves)
throws ValidationException {}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:24,代码来源:UploadValidationListener.java
示例14: onBeginNegotiate
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
/**
* Invoked before negotiation round is started.
*
* @param repository The repository
* @param project The project
* @param remoteHost Remote address/hostname of the user
* @param up the UploadPack instance being processed
* @param wants The list of wanted objects. These may be RevObject or RevCommit if the processor
* parsed them. Implementors should not rely on the values being parsed.
* @param cntOffered number of objects the client has offered.
* @throws ValidationException to block the upload and send a message back to the end-user over
* the client's protocol connection.
*/
default void onBeginNegotiate(
Repository repository,
Project project,
String remoteHost,
UploadPack up,
Collection<? extends ObjectId> wants,
int cntOffered)
throws ValidationException {}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:22,代码来源:UploadValidationListener.java
示例15: init
import org.eclipse.jgit.transport.UploadPack; //导入依赖的package包/类
/**
* UploadPack initialization.
*
* <p>Invoked by Gerrit when a new UploadPack instance is created and just before it is used.
* Implementors will usually call setXXX methods on the uploadPack parameter in order to set
* additional properties on it.
*
* @param project project for which the UploadPack is created
* @param uploadPack the UploadPack instance which is being initialized
*/
void init(Project.NameKey project, UploadPack uploadPack);
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:UploadPackInitializer.java
注:本文中的org.eclipse.jgit.transport.UploadPack类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论