package org.jenkinsci.plugins.p4.scm.swarm; import java.io.Serializable; public class P4Path implements Serializable { private static final long serialVersionUID = 1L; private final String path; private final String revision; public P4Path(String path, String revision) { this.path = path; this.revision = revision; } public P4Path(String path) { this.path = path; this.revision = null; } public String getPathBuilder(String file) { String filePath = path + "/" + file; if (getRevision() == null) { return filePath; } else { return filePath + "@" + getRevision(); } } public String getName() { String p = getPath(); if (p.startsWith("//")) { p = p.substring("//".length()); p = p.replaceAll("/", "."); } String r = getRevision(); if (r != null) { if(r.startsWith("refs/pull/")) { r = r.substring("refs/pull/".length()); } r = r.replaceAll("/", "."); } return p + "." + r; } public String getPath() { return path; } public String getRevision() { if (revision != null && revision.startsWith("refs/heads/")) { return revision.substring("refs/heads/".length()); } return revision; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 22875 | Paul Allen | Refactor P4Path and Swarm API | ||
#3 | 22758 | Paul Allen |
Use '/' in getPathBuilder. Depot syntax will always be '/' only local syntax requires File.separator. JENKINS-46414 |
||
#2 | 22681 | Paul Allen |
Fix FindBug Errors. P4Path needed to be Serializable and null check protection for replaceAll. |
||
#1 | 22678 | Paul Allen |
MultiBranch support for Helix4Git (GitHub PR model). Update MultiBranch product names to Helix. |