@Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() == EditType.EDIT) { String spec = buildCommitDiffSpec(path); return new URL(url, url.getPath() + spec); } return null; }
@Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() == EditType.EDIT) { URL url = getUrl(); String spec = buildCommitDiffSpec(url, path); return new URL(url, url.getPath() + spec); } return null; }
@Override public URL getFileLink(Path path) throws IOException { if (path.getEditType().equals(EditType.DELETE)) { return null; } URL url = getUrl(); return new URL(url, String.format(url.getPath() + "blob?r=%s&h=%s&f=%s", encodeString(projectName), path.getChangeSet().getId(), encodeString(path.getPath()))); }
/** * Creates a link to the file. * http://[GogsGit URL]/src/[commit]/[path] * Deleted Files link to the parent version. No easy way to find it * * @param path affected file path * @return diff link * @throws IOException on input or output error */ @Override public URL getFileLink(Path path) throws IOException { if (path.getEditType().equals(EditType.DELETE)) { return getDiffLinkRegardlessOfEditType(path); } else { URL url = getUrl(); return new URL(url, url.getPath() + "src/" + path.getChangeSet().getId() + "/" + path.getPath()); } }
/** * Creates a link to the file. * http://[KilnGit URL]/FileHistory/[path]?rev=[commit] * * @param path affected file path * @return diff link * @throws IOException on input or output error */ @Override public URL getFileLink(Path path) throws IOException { if (path.getEditType().equals(EditType.DELETE)) { return getDiffLinkRegardlessOfEditType(path); } else { GitChangeSet changeSet = path.getChangeSet(); URL url = getUrl(); return new URL(url, url.getPath() + "FileHistory/" + path.getPath() + param(url).add("rev=" + changeSet.getId()).toString()); } }
/** * Creates a link to the file. * http://[GitHib URL]/blob/573670a3bb1f3b939e87f1dee3e99b6bfe281fcb/src/main/java/hudson/plugins/git/browser/GithubWeb.java * Github seems to have no URL for deleted files, so just return * a difflink instead. * * @param path file * @return file link * @throws IOException on input or output error */ @Override public URL getFileLink(Path path) throws IOException { if (path.getEditType().equals(EditType.DELETE)) { return getDiffLinkRegardlessOfEditType(path); } else { final String spec = "blob/" + path.getChangeSet().getId() + "/" + path.getPath(); URL url = getUrl(); return new URL(url, url.getPath() + spec); } }
/** * Creates a link to the file. * http://[GitHib URL]/blob/573670a3bb1f3b939e87f1dee3e99b6bfe281fcb/src/main/java/hudson/plugins/git/browser/GithubWeb.java * Github seems to have no URL for deleted files, so just return * a difflink instead. * * @param path file * @return file link * @throws IOException */ @Override public URL getFileLink(Path path) throws IOException { if (path.getEditType().equals(EditType.DELETE)) { return getDiffLinkRegardlessOfEditType(path); } else { final String spec = "blob/" + path.getChangeSet().getId() + "/" + path.getPath(); return new URL(url, url.getPath() + spec); } }
/** * Creates a link to the file diff. * http://[GogsGit URL]/commit/[commit]#diff-N * * @param path affected file path * @return diff link * @throws IOException on input or output error */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT || path.getSrc() == null || path.getDst() == null || path.getChangeSet().getParentCommit() == null) { return null; } return getDiffLinkRegardlessOfEditType(path); }
/** * Creates a link to the file diff. * http://[GitHib URL]/commit/573670a3bb1f3b939e87f1dee3e99b6bfe281fcb#diff-N * * @param path affected file path * @return diff link * @throws IOException */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT || path.getSrc() == null || path.getDst() == null || path.getChangeSet().getParentCommit() == null) { return null; } return getDiffLinkRegardlessOfEditType(path); }
/** * Creates a link to the file. * https://SERVER/PATH/projects/PROJECT/repository/revisions/a9182a07750c9a0dfd89a8461adf72ef5ef0885b/entry/pom.xml * For deleted files just returns a diff link, which will have /dev/null as target file. * * @param path affected file path * @return file link * @throws IOException on input or output error */ @Override public URL getFileLink(Path path) throws IOException { if (path.getEditType().equals(EditType.DELETE)) { return getDiffLink(path); } else { final String spec = "revisions/" + path.getChangeSet().getId() + "/entry/" + path.getPath(); URL url = getUrl(); return new URL(url, url.getPath() + spec); } }
/** * Creates a link to the file. * https://SERVER/PATH/projects/PROJECT/repository/revisions/a9182a07750c9a0dfd89a8461adf72ef5ef0885b/entry/pom.xml * For deleted files just returns a diff link, which will have /dev/null as target file. * * @param path file * @return file link * @throws IOException */ @Override public URL getFileLink(Path path) throws IOException { if (path.getEditType().equals(EditType.DELETE)) { return getDiffLink(path); } else { final String spec = "revisions/" + path.getChangeSet().getId() + "/entry/" + path.getPath(); return new URL(url, url.getPath() + spec); } }
/** * Creates a link to the file diff. * http://[BitbucketWeb URL]/commits/[commitid] * * @param path affected file path * @return diff link * @throws IOException on input or output error */ @Override public URL getDiffLink(GitChangeSet.Path path) throws IOException { if (path.getEditType() != EditType.EDIT || path.getSrc() == null || path.getDst() == null || path.getChangeSet().getParentCommit() == null) { return null; } return getDiffLinkRegardlessOfEditType(path); }
/** * Creates a link to the file diff. * http://[GitHib URL]/commit/573670a3bb1f3b939e87f1dee3e99b6bfe281fcb#diff-N * * @param path affected file path * @return diff link * @throws IOException on input or output error */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT || path.getSrc() == null || path.getDst() == null || path.getChangeSet().getParentCommit() == null) { return null; } return getDiffLinkRegardlessOfEditType(path); }
/** * Creates a link to the file diff. * {@code http://[Stash URL]/diff/[path]?at=[commit]&until=[commit]} * * @param path affected file path * @return diff link * @throws IOException on input or output error */ @Override public URL getDiffLink(Path path) throws IOException { GitChangeSet changeSet = path.getChangeSet(); URL url = getUrl(); if (path.getEditType() == EditType.DELETE) { return new URL(url, url.getPath() + "diff/" + path.getPath() + param(url).add("at=" + changeSet.getParentCommit()).add("until=" + changeSet.getId()).toString()); } else { return new URL(url, url.getPath() + "diff/" + path.getPath() + param(url).add("at=" + changeSet.getId()).add("until=" + changeSet.getId()).toString()); } }
/** * Creates a link to the file diff. * http://[GitList URL]/commit/6c99ffee4cb6d605d55a1cc7cb47f25a443f7f54#N * * @param path affected file path * @return diff link * @throws IOException on I/O error */ @Override public URL getDiffLink(Path path) throws IOException { if(path.getEditType() != EditType.EDIT || path.getSrc() == null || path.getDst() == null || path.getChangeSet().getParentCommit() == null) { return null; } return getDiffLinkRegardlessOfEditType(path); }
/** * Creates a link to the file diff. * http://[KilnGit URL]/History/[commit]#diff-N * * @param path affected file path * @return diff link * @throws IOException on input or output error */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT || path.getSrc() == null || path.getDst() == null || path.getChangeSet().getParentCommit() == null) { return null; } return getDiffLinkRegardlessOfEditType(path); }
/** * {@inheritDoc} */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT || path.getSrc() == null || path.getDst() == null || path.getChangeSet().getParentCommit() == null) { return null; } return diffLink(path); }
@Override public URL getFileLink(Path path) throws IOException { if (path.getEditType() == EditType.DELETE) { String spec = buildCommitDiffSpec(path); return new URL(url, url.getPath() + spec); } String spec = param().add("p=" + projectName).add("a=viewblob").add("h=" + path.getDst()).add("f=" + path.getPath()).toString(); return new URL(url, url.getPath() + spec); }
@Override public URL getFileLink(Path path) throws IOException { URL url = getUrl(); if (path.getEditType() == EditType.DELETE) { String spec = buildCommitDiffSpec(url, path); return new URL(url, url.getPath() + spec); } String spec = param(url).add("p=" + projectName).add("a=viewblob").add("h=" + path.getDst()).add("f=" + path.getPath()).toString(); return new URL(url, url.getPath() + spec); }
@Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) return null; // no diff if this is not an edit change String r1 = path.getChangeSet().getParentCommit(); String r2 = path.getChangeSet().getId(); return new URL(getUrl(), getPath(path) + String.format("?r1=%s&r2=%s", r1, r2)); }