本文整理了Java中com.linecorp.centraldogma.internal.Util.isValidDirPath()
方法的一些代码示例,展示了Util.isValidDirPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isValidDirPath()
方法的具体详情如下:
包路径:com.linecorp.centraldogma.internal.Util
类名称:Util
方法名:isValidDirPath
暂无
代码示例来源:origin: line/centraldogma
public static boolean isValidDirPath(String path) {
return isValidDirPath(path, false);
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common
public static boolean isValidDirPath(String path) {
return isValidDirPath(path, false);
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common-shaded
public static boolean isValidDirPath(String path) {
return isValidDirPath(path, false);
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common
public static String validateDirPath(String path, String paramName) {
requireNonNull(path, paramName);
if (isValidDirPath(path)) {
return path;
}
throw new IllegalArgumentException(
paramName + ": " + path + " (expected: " + DIR_PATH_PATTERN.pattern() + ')');
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common-shaded
public static String validateDirPath(String path, String paramName) {
requireNonNull(path, paramName);
if (isValidDirPath(path)) {
return path;
}
throw new IllegalArgumentException(
paramName + ": " + path + " (expected: " + DIR_PATH_PATTERN.pattern() + ')');
}
代码示例来源:origin: line/centraldogma
public static String validateDirPath(String path, String paramName) {
requireNonNull(path, paramName);
if (isValidDirPath(path)) {
return path;
}
throw new IllegalArgumentException(
paramName + ": " + path + " (expected: " + DIR_PATH_PATTERN.pattern() + ')');
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded
/**
* Normalizes the path according to the following order.
* <ul>
* <li>if the path is {@code null}, empty string or "/", normalize to {@code "/*"}</li>
* <li>if the path is a valid file path, return the path as it is</li>
* <li>if the path is a valid directory path, append "*" at the end</li>
* </ul>
*/
private static String normalizePath(String path) {
if (path == null || path.isEmpty() || "/".equals(path)) {
return "/*";
}
if (isValidFilePath(path)) {
return path;
}
if (isValidDirPath(path)) {
if (path.endsWith("/")) {
return path + '*';
} else {
return path + "/*";
}
}
return path;
}
代码示例来源:origin: line/centraldogma
/**
* Normalizes the path according to the following order.
* <ul>
* <li>if the path is {@code null}, empty string or "/", normalize to {@code "/*"}</li>
* <li>if the path is a valid file path, return the path as it is</li>
* <li>if the path is a valid directory path, append "*" at the end</li>
* </ul>
*/
private static String normalizePath(String path) {
if (path == null || path.isEmpty() || "/".equals(path)) {
return "/*";
}
if (isValidFilePath(path)) {
return path;
}
if (isValidDirPath(path)) {
if (path.endsWith("/")) {
return path + '*';
} else {
return path + "/*";
}
}
return path;
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server
/**
* Normalizes the path according to the following order.
* <ul>
* <li>if the path is {@code null}, empty string or "/", normalize to {@code "/*"}</li>
* <li>if the path is a valid file path, return the path as it is</li>
* <li>if the path is a valid directory path, append "*" at the end</li>
* </ul>
*/
private static String normalizePath(String path) {
if (path == null || path.isEmpty() || "/".equals(path)) {
return "/*";
}
if (isValidFilePath(path)) {
return path;
}
if (isValidDirPath(path)) {
if (path.endsWith("/")) {
return path + '*';
} else {
return path + "/*";
}
}
return path;
}
内容来源于网络,如有侵权,请联系作者删除!