org.locationtech.geogig.model.Ref.simpleName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中org.locationtech.geogig.model.Ref.simpleName方法的一些代码示例,展示了Ref.simpleName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ref.simpleName方法的具体详情如下:
包路径:org.locationtech.geogig.model.Ref
类名称:Ref
方法名:simpleName

Ref.simpleName介绍

暂无

代码示例

代码示例来源:origin: locationtech/geogig

private String doGet(final String refPath, final Connection cx) throws SQLException {
  final int repo = config.getRepositoryId();
  final String path = Ref.parentPath(refPath) + "/";
  final String localName = Ref.simpleName(refPath);
  final String refsTable = refsTableName;
  final String sql = format(
      "SELECT value FROM %s WHERE repository = ? AND path = ? AND name = ?", refsTable);
  try (PreparedStatement st = cx.prepareStatement(log(sql, LOG, repo, path, localName))) {
    st.setInt(1, repo);
    st.setString(2, path);
    st.setString(3, localName);
    try (ResultSet rs = st.executeQuery()) {
      if (rs.next()) {
        return rs.getString(1);
      }
      return null;
    }
  }
}

代码示例来源:origin: org.locationtech.geogig/geogig-postgres

private String doGet(final String refPath, final Connection cx) throws SQLException {
  final int repo = config.getRepositoryId();
  final String path = Ref.parentPath(refPath) + "/";
  final String localName = Ref.simpleName(refPath);
  final String refsTable = refsTableName;
  final String sql = format(
      "SELECT value FROM %s WHERE repository = ? AND path = ? AND name = ?", refsTable);
  try (PreparedStatement st = cx.prepareStatement(log(sql, LOG, repo, path, localName))) {
    st.setInt(1, repo);
    st.setString(2, path);
    st.setString(3, localName);
    try (ResultSet rs = st.executeQuery()) {
      if (rs.next()) {
        return rs.getString(1);
      }
      return null;
    }
  }
}

代码示例来源:origin: locationtech/geogig

final int repo = config.getRepositoryId();
final String path = Ref.parentPath(name) + "/";
final String localName = Ref.simpleName(name);
final String refsTable = refsTableName;

代码示例来源:origin: org.locationtech.geogig/geogig-postgres

final int repo = config.getRepositoryId();
final String path = Ref.parentPath(name) + "/";
final String localName = Ref.simpleName(name);
final String refsTable = refsTableName;

代码示例来源:origin: locationtech/geogig

final int repo = config.getRepositoryId();
final String path = Ref.parentPath(refName) + "/";
final String localName = Ref.simpleName(refName);
final String refsTable = refsTableName;
try (Connection cx = PGStorage.newConnection(dataSource)) {

代码示例来源:origin: org.locationtech.geogig/geogig-postgres

final int repo = config.getRepositoryId();
final String path = Ref.parentPath(refName) + "/";
final String localName = Ref.simpleName(refName);
final String refsTable = refsTableName;
try (Connection cx = PGStorage.newConnection(dataSource)) {

代码示例来源:origin: locationtech/geogig

@Test
public void testSimpleName() {
  assertEquals("ref1", Ref.simpleName("refs/heads/ref1"));
  assertEquals("HEAD", Ref.simpleName("HEAD"));
}

相关文章