Class ProjectFileUtils

java.lang.Object
net.mcreator.ui.mcp.tools.utils.ProjectFileUtils

public final class ProjectFileUtils extends Object
  • Constructor Details

    • ProjectFileUtils

      public ProjectFileUtils()
  • Method Details

    • getWorkspaceRoot

      public static Path getWorkspaceRoot(MCreator mcreator) throws IOException
      Throws:
      IOException
    • getCommonRoot

      @Nullable public static Path getCommonRoot(MCreator mcreator) throws IOException
      Returns:
      canonical common root of the source and resource roots, or null if it does not exist
      Throws:
      IOException
    • resolveFile

      @Nullable public static File resolveFile(Path workspaceRoot, Path root, String path) throws IOException
      Returns:
      canonical file for the workspace-relative path, or null if it is outside the given root
      Throws:
      IOException
    • getPathInWorkspace

      public static String getPathInWorkspace(Path workspaceRoot, File file)
      Returns:
      workspace-relative path of the file with forward slashes