Java NIO 内存文件系统 ParallelGit

码农软件 · 软件分类 · Git开源工具 · 2019-11-04 07:12:52

软件介绍

ParallelGit 是为 Git 应用准备的高性能 Java NIO 内存文件系统。ParallelGit 是基于 JGit 构建的, 可以帮助 Java 项目快速的访问 Git 文件。

ParallelGit 可以帮助你操作本地 Git仓库,允许你通过 Java 7 nio 文件系统接口来访问 Git 仓库,达到跟原生文件系统一样的体验。

示例

Create Repository

public Repository createProjectRepository() {
  File dir = new File("/home/project/repo");
  return RepositoryUtils.createRepository(dir);
}

Create Branch

public void branchFromMaster(String newBranch, Repository repo) {
  BranchUtils.createBranch(newBranch, "master", repo)
}

Read File

public void printFile(String filename, Repository repo) {
  byte[] blob = GitFileUtils.readFile(filename, "master", repo);
  String text = new String(blob);
  System.out.println(text);
}

本文地址:https://codercto.com/soft/d/18225.html

Programming Collective Intelligence

Programming Collective Intelligence

Toby Segaran / O'Reilly Media / 2007-8-26 / USD 39.99

Want to tap the power behind search rankings, product recommendations, social bookmarking, and online matchmaking? This fascinating book demonstrates how you can build Web 2.0 applications to mine the......一起来看看 《Programming Collective Intelligence》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具