private static String clean(String path) {
        final StringBuilder sb = new StringBuilder();
        final String[] parts = path.split(PATH_SEPARATOR_STRING);
        for (final String part : parts) {
            if (part.length() > 0) {
                sb.append(cleanPart(part));
                sb.append("/");
            }
        }
        if (sb.length() > 0) {
            sb.setLength(sb.length() - 1);
        }
        return sb.toString();
    }
Clean a path so that it doesn't contain leading or trailing separators, no double separators and no
invalid characters.

@param path The path to clean.
@return A cleaned path.
stroom-data/stroom-data-zip/src/main/java/stroom/data/zip/StroomFileNameUtil.java