public static String appendPath(String... paths) {
		if ((CollectionUtils.isAllNull(Arrays.asList(paths)))) {
			return null;
		}

		StringBuilder buffer = new StringBuilder();
		for (String path : paths) {
			if (path == null || path.isEmpty()) {
				continue;
			}

			boolean emptyBuffer = buffer.length() == 0;
			boolean bufferEndsWithSlash =
				!emptyBuffer && "/\\".indexOf(buffer.charAt(buffer.length() - 1)) != -1;
			boolean pathStartsWithSlash = "/\\".indexOf(path.charAt(0)) != -1;

			if (!bufferEndsWithSlash && !pathStartsWithSlash && !emptyBuffer) {
				buffer.append("/");
			}
			else if (pathStartsWithSlash && bufferEndsWithSlash) {
				path = path.substring(1);
			}
			buffer.append(path);
		}

		return buffer.toString();
	}
Concats path strings together, taking care to ensure that there is a correct
path separator character between each part.
<p>
Handles forward or back slashes as path separator characters in the input, but
only adds forward slashes when separating the path strings that need a separator.

@param paths vararg list of path strings, empty or null elements are ok and are skipped.
@return null if all params null, "" empty string if all are empty, or
"path_element[1]/path_element[2]/.../path_element[N]" otherwise.
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/FSUtilities.java