Package org.uberfire.backend.server.util
Class Paths
- java.lang.Object
-
- org.uberfire.backend.server.util.Paths
-
public final class Paths extends Object
-
-
Constructor Summary
Constructors Constructor Description Paths()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.uberfire.java.nio.file.Pathconvert(org.uberfire.backend.vfs.Path path)static org.uberfire.backend.vfs.FileSystemconvert(org.uberfire.java.nio.file.FileSystem fs)static org.uberfire.backend.vfs.Pathconvert(org.uberfire.java.nio.file.Path path)static booleanisLock(org.uberfire.backend.vfs.Path path)static org.uberfire.backend.vfs.PathnormalizePath(org.uberfire.backend.vfs.Path path)git:// and default:// can point to the same location.static org.uberfire.java.nio.file.PathnormalizePath(org.uberfire.java.nio.file.Path path)git:// and default:// can point to the same location.static StringreadLockedBy(org.uberfire.backend.vfs.Path path)static StringremovePrefix(org.uberfire.backend.vfs.Path wholePath, org.uberfire.backend.vfs.Path prefixToRemove)Substring the second path from the first.
-
-
-
Method Detail
-
convert
public static org.uberfire.backend.vfs.Path convert(org.uberfire.java.nio.file.Path path)
-
convert
public static org.uberfire.java.nio.file.Path convert(org.uberfire.backend.vfs.Path path)
-
convert
public static org.uberfire.backend.vfs.FileSystem convert(org.uberfire.java.nio.file.FileSystem fs)
-
readLockedBy
public static String readLockedBy(org.uberfire.backend.vfs.Path path)
-
isLock
public static boolean isLock(org.uberfire.backend.vfs.Path path)
-
removePrefix
public static String removePrefix(org.uberfire.backend.vfs.Path wholePath, org.uberfire.backend.vfs.Path prefixToRemove)
Substring the second path from the first. This can be used to for example to substring the repository prefix from a Path.- Parameters:
wholePath- What we want to substring from the first PathprefixToRemove- The Path we want to substring- Returns:
- The result. For example the File URI from the Repository root or from a submodule root.
- Throws:
IllegalStateException- When the the prefix is longer than the URI where it is removed from.
-
normalizePath
public static org.uberfire.java.nio.file.Path normalizePath(org.uberfire.java.nio.file.Path path)
git:// and default:// can point to the same location. This normalizes the Paths for easier use with length and removePrefix functions.- Parameters:
path-- Returns:
-
normalizePath
public static org.uberfire.backend.vfs.Path normalizePath(org.uberfire.backend.vfs.Path path)
git:// and default:// can point to the same location. This normalizes the Paths for easier use with length and removePrefix functions.- Parameters:
path-- Returns:
-
-