Class PathUtil
- java.lang.Object
-
- org.guvnor.common.services.project.backend.server.utils.PathUtil
-
@Singleton public class PathUtil extends Object
Contains methods that directly invokePathsor involve implementation specific details on paths that are difficult to mock in unit tests.
-
-
Constructor Summary
Constructors Constructor Description PathUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.uberfire.java.nio.file.Pathconvert(org.uberfire.backend.vfs.Path path)org.uberfire.backend.vfs.Pathconvert(org.uberfire.java.nio.file.Path path)Optional<String>extractBranch(String uri)StringgetNiogitRepoPath(org.uberfire.java.nio.file.Path path)org.uberfire.backend.vfs.PathnormalizePath(org.uberfire.backend.vfs.Path path)StringreplaceBranch(String newBranchName, String uri)StringstripProtocolAndBranch(String uri)StringstripRepoNameAndSpace(String strippedPath)
-
-
-
Method Detail
-
normalizePath
public org.uberfire.backend.vfs.Path normalizePath(org.uberfire.backend.vfs.Path path)
-
convert
public org.uberfire.java.nio.file.Path convert(org.uberfire.backend.vfs.Path path)
-
convert
public org.uberfire.backend.vfs.Path convert(org.uberfire.java.nio.file.Path path)
-
stripRepoNameAndSpace
public String stripRepoNameAndSpace(String strippedPath)
- Parameters:
strippedPath- Assumed to be a return value ofstripProtocolAndBranch(String)
-
getNiogitRepoPath
public String getNiogitRepoPath(org.uberfire.java.nio.file.Path path)
- Parameters:
path- A path for a JGit file system. Must not be null.- Returns:
- The file path for an niogit directory that contains the given path's filesystem.
-
-