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

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

本文整理了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

  1. private String doGet(final String refPath, final Connection cx) throws SQLException {
  2. final int repo = config.getRepositoryId();
  3. final String path = Ref.parentPath(refPath) + "/";
  4. final String localName = Ref.simpleName(refPath);
  5. final String refsTable = refsTableName;
  6. final String sql = format(
  7. "SELECT value FROM %s WHERE repository = ? AND path = ? AND name = ?", refsTable);
  8. try (PreparedStatement st = cx.prepareStatement(log(sql, LOG, repo, path, localName))) {
  9. st.setInt(1, repo);
  10. st.setString(2, path);
  11. st.setString(3, localName);
  12. try (ResultSet rs = st.executeQuery()) {
  13. if (rs.next()) {
  14. return rs.getString(1);
  15. }
  16. return null;
  17. }
  18. }
  19. }

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

  1. private String doGet(final String refPath, final Connection cx) throws SQLException {
  2. final int repo = config.getRepositoryId();
  3. final String path = Ref.parentPath(refPath) + "/";
  4. final String localName = Ref.simpleName(refPath);
  5. final String refsTable = refsTableName;
  6. final String sql = format(
  7. "SELECT value FROM %s WHERE repository = ? AND path = ? AND name = ?", refsTable);
  8. try (PreparedStatement st = cx.prepareStatement(log(sql, LOG, repo, path, localName))) {
  9. st.setInt(1, repo);
  10. st.setString(2, path);
  11. st.setString(3, localName);
  12. try (ResultSet rs = st.executeQuery()) {
  13. if (rs.next()) {
  14. return rs.getString(1);
  15. }
  16. return null;
  17. }
  18. }
  19. }

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

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

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

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

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

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

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

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

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

  1. @Test
  2. public void testParentPath() {
  3. assertEquals("refs/heads", Ref.parentPath("refs/heads/ref1"));
  4. assertEquals("refs", Ref.parentPath("refs/heads"));
  5. assertEquals("", Ref.parentPath("refs"));
  6. }

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

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

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

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

相关文章