File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
src/main/java/org/commonwl/viewer/domain Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 25
25
*/
26
26
public class WorkflowForm {
27
27
28
+ private String githubURL ;
29
+
28
30
public WorkflowForm () {}
29
31
30
32
public WorkflowForm (String githubURL ) {
31
- this .githubURL = githubURL ;
33
+ if (githubURL != null ) {
34
+ this .githubURL = trimTrailingSlashes (githubURL );
35
+ }
32
36
}
33
37
34
- private String githubURL ;
35
-
36
38
public String getGithubURL () {
37
39
return githubURL ;
38
40
}
39
41
40
42
public void setGithubURL (String githubURL ) {
41
- this .githubURL = githubURL ;
43
+ if (githubURL != null ) {
44
+ this .githubURL = trimTrailingSlashes (githubURL );
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Cuts any trailing slashes off a string
50
+ * @param url The string to cut the slashes off
51
+ * @return The same string without trailing slashes
52
+ */
53
+ private String trimTrailingSlashes (String url ) {
54
+ return url .replaceAll ("\\ /+$" , "" );
42
55
}
43
56
}
You can’t perform that action at this time.
0 commit comments