com.x5.util.Path Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chunk-templates Show documentation
Show all versions of chunk-templates Show documentation
Chunk Template Engine for Java
package com.x5.util;
public class Path
{
public static String ensureTrailingFileSeparator(String path)
{
if (path != null) {
char lastChar = path.charAt(path.length()-1);
char fs = System.getProperty("file.separator").charAt(0);
if (lastChar != '\\' && lastChar != '/' && lastChar != fs) {
return path + fs;
}
}
return path;
}
public static String ensureTrailingPathSeparator(String path)
{
if (path != null) {
char lastChar = path.charAt(path.length()-1);
if (lastChar != '/') {
return path + '/';
}
}
return path;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy