Class FileUtils
java.lang.Object
edu.university.ecs.lab.common.utils.FileUtils
Manages all file paths and file path conversion functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
absoluteToRelative
(String absolutePath) This method will convert an absolute path to a path that is relative to the PROJECT_PATH (user.dir)static void
This method creates the default output and clone pathsstatic String
This method returns the relative local path of the output directory as ./DEFAULT_OUTPUT_PATH.static String
This method returns the relative local path of the output directory as ./DEFAULT_OUTPUT_PATH.static String
getClonePath
(String repoName) This method returns the relative path of the cloned repository directory as ./DEFAULT_CLONE_PATH/repoName.static String
static String
pathToRepoPath
(String localPath, String repoName) This method will convert a local file path to a path that is relative to the repository root not including the name of the repostatic String
repoPathToPath
(String repoPath) Deprecated.
-
Method Details
-
getClonePath
This method returns the relative path of the cloned repository directory as ./DEFAULT_CLONE_PATH/repoName. This will be a working relative path to the repository directory on the local file system.- Parameters:
repoName
- the name of the repo- Returns:
- the relative path string where that repository is cloned to
-
getBaseOutputPath
This method returns the relative local path of the output directory as ./DEFAULT_OUTPUT_PATH. This will be a working relative path to the output directory on the local file system.- Returns:
- the relative path string where the output will exist
-
getBaseClonePath
This method returns the relative local path of the output directory as ./DEFAULT_OUTPUT_PATH. This will be a working relative path to the output directory on the local file system.- Returns:
- the relative path string where the output will exist
-
pathToRepoPath
This method will convert a local file path to a path that is relative to the repository root not including the name of the repo- Parameters:
localPath
- the local path to be converted- Returns:
- the relative repo path
-
repoPathToPath
Deprecated.This method will convert a repo path that is relative to the repository root to a local file path- Returns:
- the relative path string where the output will exist
-
absoluteToRelative
This method will convert an absolute path to a path that is relative to the PROJECT_PATH (user.dir)- Parameters:
absolutePath
- the absolute path to be converted- Returns:
- the relative path string after conversion
-
getMicroserviceNameFromPath
-
createPaths
public static void createPaths()This method creates the default output and clone paths
-