Package burp.mcp.util

Class ProjectFiles

java.lang.Object
burp.mcp.util.ProjectFiles

public final class ProjectFiles extends Object
Locates the .burp file of the current project.

The Montoya API exposes only the project name and id, never the file path. Burp does record its recent project files in its user-level Java preferences (burp.suite.recentProjectFilesN paired with burp.suite.recentProjectNamesN, index 0 = most recent), so the current project's file can be matched by name.

Everything here is best-effort: a missing key, unreadable preferences backend, relative path, or temporary project yields an empty result and the caller falls back to a temporary socket path.

  • Method Details

    • burpPrefLookup

      public static Function<String,String> burpPrefLookup()
      Read-only lookup backed by Burp's user-level Java preferences.
    • locate

      public static Optional<Path> locate(String projectName, Function<String,String> lookup)
      Find the project file for projectName: the most recent entry whose file basename or recorded project name matches, ignoring a trailing .burp and case.
    • socketPathFor

      public static Path socketPathFor(Path projectFile)
      Socket path next to a project file: <dir>/<basename>.sock.
    • isUsableSocketPath

      public static boolean isUsableSocketPath(Path socketPath)
      Socket paths must stay under the OS sockaddr_un ceiling (~108 bytes on Linux); leave headroom for the trailing NUL.