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

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

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

Ref.parentPath介绍

暂无

代码示例

代码示例来源: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

private void putInternal(final String name, final String value) {
  Preconditions.checkState(config.isRepositorySet());
  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

@Override
public String remove(final String refName) {
  final int repo = config.getRepositoryId();
  final String path = Ref.parentPath(refName) + "/";
  final String localName = Ref.simpleName(refName);
  final String refsTable = refsTableName;

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

private void putInternal(final String name, final String value) {
  Preconditions.checkState(config.isRepositorySet());
  final int repo = config.getRepositoryId();
  final String path = Ref.parentPath(name) + "/";
  final String localName = Ref.simpleName(name);
  final String refsTable = refsTableName;

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

@Override
public String remove(final String refName) {
  final int repo = config.getRepositoryId();
  final String path = Ref.parentPath(refName) + "/";
  final String localName = Ref.simpleName(refName);
  final String refsTable = refsTableName;

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

@Test
public void testParentPath() {
  assertEquals("refs/heads", Ref.parentPath("refs/heads/ref1"));
  assertEquals("refs", Ref.parentPath("refs/heads"));
  assertEquals("", Ref.parentPath("refs"));
}

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

remoteRefName = ref.getName();
} else {
  final String specParentPath = Ref.parentPath(remoterefspec);
  final boolean isTag;
  final String localName;

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

remoteRefName = ref.getName();
} else {
  final String specParentPath = Ref.parentPath(remoterefspec);
  final boolean isTag;
  final String localName;

相关文章