mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01:00
Final improvements. Fixing reply mention. Do NOT use "instanceUrlRaw" as of now. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/564 Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
38 lines
522 B
Java
38 lines
522 B
Java
package org.mian.gitnex.helpers;
|
|
|
|
/**
|
|
* Author opyale
|
|
*/
|
|
|
|
public class PathsHelper {
|
|
|
|
public static String join(String... paths) {
|
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
for(String path : paths) {
|
|
|
|
if(path != null && !path.isEmpty()) {
|
|
|
|
if(!path.startsWith("/")) {
|
|
|
|
stringBuilder.append("/");
|
|
}
|
|
|
|
if(path.endsWith("/")) {
|
|
|
|
path = path.substring(0, path.lastIndexOf("/"));
|
|
}
|
|
|
|
stringBuilder.append(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return stringBuilder.append("/").toString();
|
|
|
|
}
|
|
|
|
}
|