Class FileUtils

java.lang.Object
edu.university.ecs.lab.common.utils.FileUtils

public class FileUtils extends Object
Manages all file paths and file path conversion functions.
  • Method Details

    • getClonePath

      public static String getClonePath(String repoName)
      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

      public static String 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

      public static String 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

      public 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 repo
      Parameters:
      localPath - the local path to be converted
      Returns:
      the relative repo path
    • repoPathToPath

      @Deprecated public static String repoPathToPath(String repoPath)
      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

      public static String absoluteToRelative(String absolutePath)
      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

      public static String getMicroserviceNameFromPath(String path)
    • createPaths

      public static void createPaths()
      This method creates the default output and clone paths