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

Java DfsRepositoryDescription类代码示例

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

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



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

示例1: open

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
public Repository open(DaemonClient client, String name)
        throws RepositoryNotFoundException,
        ServiceNotAuthorizedException, ServiceNotEnabledException,
        ServiceMayNotContinueException {
    CassandraRepository repo = repositories.get(name);
    if (repo == null) {
        try {
            repo = new CassandraRepository(
                    new DfsRepositoryDescription(sanitiseName(name)),
                    storeconn);
        } catch (Exception e) {
            throw new ServiceMayNotContinueException(e);
        }
        repositories.put(name, repo);
    }
    return repo;
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:19,代码来源:CassandraRepositoryResolver.java


示例2: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  TestKey key1 = validKeyWithoutExpiration();
  TestKey key3 = expiredKey();
  repo = new InMemoryRepository(new DfsRepositoryDescription("repo"));
  store = new PublicKeyStore(repo);
  store.add(key1.getPublicKeyRing());
  store.add(key3.getPublicKeyRing());

  PersonIdent ident = new PersonIdent("A U Thor", "[email protected]");
  CommitBuilder cb = new CommitBuilder();
  cb.setAuthor(ident);
  cb.setCommitter(ident);
  assertEquals(RefUpdate.Result.NEW, store.save(cb));

  signedPushConfig = new SignedPushConfig();
  signedPushConfig.setCertNonceSeed("sekret");
  signedPushConfig.setCertNonceSlopLimit(60 * 24);
  checker = newChecker(true);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:PushCertificateCheckerTest.java


示例3: newBatchRefUpdate

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@SafeVarargs
private static BatchRefUpdate newBatchRefUpdate(Consumer<ReceiveCommand>... resultSetters) {
  try (Repository repo = new InMemoryRepository(new DfsRepositoryDescription("repo"))) {
    BatchRefUpdate bru = repo.getRefDatabase().newBatchUpdate();
    for (int i = 0; i < resultSetters.length; i++) {
      ReceiveCommand cmd =
          new ReceiveCommand(
              ObjectId.fromString(String.format("%039x1", i)),
              ObjectId.fromString(String.format("%039x2", i)),
              "refs/heads/branch" + i);
      bru.addCommand(cmd);
      resultSetters[i].accept(cmd);
    }
    return bru;
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:17,代码来源:RefUpdateUtilTest.java


示例4: openUncached

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
Repository openUncached(GitRepository repo, boolean mustExist) throws IOException {
  String objectPath = repo.getObjectPath();

  // ByteString suffix = ZERO.concat(ByteString.copyFromUtf8(absolutePath)).concat(ZERO);
  // KeyValuePath refsPath = refsBase.child(suffix);

  DfsRepositoryDescription description = new DfsRepositoryDescription(objectPath);
  ObjectStorePath repoPath = new ObjectStorePath(objectStore, objectPath);
  CloudDfsRepository dfs = new CloudDfsRepository(repo.getData(), description, repoPath, dataStore, tempDir);

  try {
    if (!dfs.exists()) {
      if (mustExist) {
        throw new RepositoryNotFoundException(repo.getData().getName());
      }
      dfs.create(true);
      dfs.updateRef(Constants.HEAD).link("refs/heads/master");
    }
  } catch (IOException e) {
    throw new IllegalStateException("Error creating repository", e);
  }

  dfs.getConfig().setBoolean("http", null, "receivepack", true);

  return dfs;
}
 
开发者ID:justinsb,项目名称:cloudata,代码行数:27,代码来源:CloudGitRepositoryStore.java


示例5: RepositoryS3Test

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
public RepositoryS3Test() {
    try {
        this.repository = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription()));
        this.uut = new RepositoryS3(BUCKET, repository.getRepository(), amazonS3, new Branch(Constants.MASTER));
    }
    catch (Exception e) {
        throw new IllegalArgumentException(e);
    }
}
 
开发者ID:berlam,项目名称:github-bucket,代码行数:10,代码来源:RepositoryS3Test.java


示例6: CassandraRepository

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
/**
 * Creating a new repository object may result in creating a new repository
 * in the storage layer, or if the repository identified by "repoDesc" already
 * exists, it will be used instead.
 *
 * @param repoDesc  description of the repository that this object will
 *                  provide access to.
 */
@SuppressWarnings("rawtypes")
public CassandraRepository(DfsRepositoryDescription repoDesc, StoreConnection conn)
        throws IOException {
    super(new DfsRepositoryBuilder<DfsRepositoryBuilder, CassandraRepository>() {
        @Override
        public CassandraRepository build() throws IOException {
            throw new UnsupportedOperationException();
        }
    }.setRepositoryDescription(repoDesc));

    objdb = new CassandraObjDatabase(this, conn);
    refdb = new CassandraRefDatabase(this, conn);
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:22,代码来源:CassandraRepository.java


示例7: ObjStore

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
/**
 * Constructor
 *
 * @param keyspace the Cassandra keyspace
 * @param session  a Cassandra session instance
 * @throws NullPointerException if either of the parameters are null
 * @throws IOException          if an exception occurs when communicating to the
 *                              database
 */
public ObjStore(String keyspace, Session session,
                DfsRepositoryDescription repoDesc) throws IOException {
    if (keyspace == null || session == null) {
        throw new NullPointerException();
    }
    this.keyspace = keyspace;
    this.session = session;
    this.repoDesc = repoDesc;
    createSchemaIfNotExist();
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:20,代码来源:ObjStore.java


示例8: cloneProject

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
public static TestRepository<InMemoryRepository> cloneProject(Project.NameKey project, String uri)
    throws Exception {
  DfsRepositoryDescription desc = new DfsRepositoryDescription("clone of " + project.get());

  FS fs = FS.detect();

  // Avoid leaking user state into our tests.
  fs.setUserHome(null);

  InMemoryRepository dest =
      new InMemoryRepository.Builder()
          .setRepositoryDescription(desc)
          // SshTransport depends on a real FS to read ~/.ssh/config, but
          // InMemoryRepository by default uses a null FS.
          // TODO(dborowitz): Remove when we no longer depend on SSH.
          .setFS(fs)
          .build();
  Config cfg = dest.getConfig();
  cfg.setString("remote", "origin", "url", uri);
  cfg.setString("remote", "origin", "fetch", "+refs/heads/*:refs/remotes/origin/*");
  TestRepository<InMemoryRepository> testRepo = newTestRepository(dest);
  FetchResult result = testRepo.git().fetch().setRemote("origin").call();
  String originMaster = "refs/remotes/origin/master";
  if (result.getTrackingRefUpdate(originMaster) != null) {
    testRepo.reset(originMaster);
  }
  return testRepo;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:29,代码来源:GitUtil.java


示例9: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  repo = new TestRepository<DfsRepository>(
      new InMemoryRepository(new DfsRepositoryDescription("test")));
  parser = new RevisionParser(
      repo.getRepository(),
      new TestGitilesAccess(repo.getRepository()).forRequest(null),
      new VisibilityCache(false, CacheBuilder.newBuilder().maximumSize(0)));
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:10,代码来源:RevisionParserTest.java


示例10: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  repo = new TestRepository<DfsRepository>(
      new InMemoryRepository(new DfsRepositoryDescription("test")));
  servlet = new RepositoryIndexServlet(
      new DefaultRenderer(),
      new TestGitilesAccess(repo.getRepository()),
      new TimeCache());
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:10,代码来源:RepositoryIndexServletTest.java


示例11: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  repo = new TestRepository<DfsRepository>(
      new InMemoryRepository(new DfsRepositoryDescription("test")));
  walk = new RevWalk(repo.getRepository());
  cache = new TimeCache();
  start = repo.getClock().getTime() / 1000;
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:9,代码来源:TimeCacheTest.java


示例12: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  DfsRepository r = new InMemoryRepository(new DfsRepositoryDescription("test"));
  repo = new TestRepository<DfsRepository>(r);

  RevCommit commit = repo.branch("refs/heads/master").commit().create();
  repo.update("refs/heads/branch", commit);
  repo.update("refs/tags/ctag", commit);
  RevTag tag = repo.tag("atag", commit);
  repo.update("refs/tags/atag", tag);
  r.updateRef("HEAD").link("refs/heads/master");

  servlet = TestGitilesServlet.create(repo);
}
 
开发者ID:afrojer,项目名称:gitiles,代码行数:15,代码来源:RefServletTest.java


示例13: CloudDfsRepository

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
public CloudDfsRepository(RepositoryData data, DfsRepositoryDescription repoDesc, ObjectStorePath repoPath,
    DataStore dataStore, File tempDir) {
  super(new DfsRepositoryBuilder<DfsRepositoryBuilder, CloudDfsRepository>() {
    @Override
    public CloudDfsRepository build() throws IOException {
      throw new UnsupportedOperationException();
    }
  }.setRepositoryDescription(repoDesc));
  this.data = data;

  this.objdb = new CloudObjDatabase(this, repoPath, tempDir);
  this.refdb = new CloudRefDatabase(this, dataStore);
}
 
开发者ID:justinsb,项目名称:cloudata,代码行数:14,代码来源:CloudDfsRepository.java


示例14: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    desc = new DfsPackDescription(new DfsRepositoryDescription(), DESC_NAME);
}
 
开发者ID:benhumphreys,项目名称:jgit-cassandra,代码行数:5,代码来源:DescMapperTest.java


示例15: inMemoryRepo

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Nonnull
public static GfsConfiguration inMemoryRepo() {
  return repo(new InMemoryRepository(new DfsRepositoryDescription()));
}
 
开发者ID:beijunyi,项目名称:ParallelGit,代码行数:5,代码来源:GfsConfiguration.java


示例16: TestRepository

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
public TestRepository(boolean bare) {
  super(new DfsRepositoryDescription());
  File mockLocation = new File(System.getProperty("java.io.tmpdir"));
  directory = bare ? mockLocation : new File(mockLocation, DOT_GIT);
  workTree = bare ? null : mockLocation;
}
 
开发者ID:beijunyi,项目名称:ParallelGit,代码行数:7,代码来源:AbstractParallelGitTest.java


示例17: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUp() {
  repo = new InMemoryRepository(new DfsRepositoryDescription("repo"));
  store = new PublicKeyStore(repo);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:6,代码来源:PublicKeyCheckerTest.java


示例18: setUpInjector

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUpInjector() throws Exception {
  Config cfg = InMemoryModule.newDefaultConfig();
  cfg.setInt("receive", null, "maxTrustDepth", 2);
  cfg.setStringList(
      "receive",
      null,
      "trustedKey",
      ImmutableList.of(
          Fingerprint.toString(keyB().getPublicKey().getFingerprint()),
          Fingerprint.toString(keyD().getPublicKey().getFingerprint())));
  Injector injector =
      Guice.createInjector(new InMemoryModule(cfg, NoteDbMode.newNotesMigrationFromEnv()));

  lifecycle = new LifecycleManager();
  lifecycle.add(injector);
  injector.injectMembers(this);
  lifecycle.start();

  db = schemaFactory.open();
  schemaCreator.create(db);
  userId = accountManager.authenticate(AuthRequest.forUser("user")).getAccountId();
  // Note: does not match any key in TestKeys.
  accountsUpdate.create().update(userId, a -> a.setPreferredEmail("[email protected]"));
  user = reloadUser();

  requestContext.setContext(
      new RequestContext() {
        @Override
        public CurrentUser getUser() {
          return user;
        }

        @Override
        public Provider<ReviewDb> getReviewDbProvider() {
          return Providers.of(db);
        }
      });

  storeRepo = new InMemoryRepository(new DfsRepositoryDescription("repo"));
  store = new PublicKeyStore(storeRepo);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:43,代码来源:GerritPublicKeyCheckerTest.java


示例19: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  tr = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription("pubkeys")));
  store = new PublicKeyStore(tr.getRepository());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:6,代码来源:PublicKeyStoreTest.java


示例20: setUp

import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; //导入依赖的package包/类
@Before
public void setUp() {
  TestTimeUtil.resetWithClockStep(1, TimeUnit.SECONDS);
  project = new Project.NameKey("repo");
  repo = new InMemoryRepository(new DfsRepositoryDescription(project.get()));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:7,代码来源:VersionedMetaDataTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java BinaryResponseParser类代码示例发布时间:2022-05-23
下一篇:
Java RemoteControlConfiguration类代码示例发布时间: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