Merge remote-tracking branch 'origin/GP-6715_dev747368_localdirdebuginfod_filepath'

This commit is contained in:
Ryan Kurtz
2026-04-20 13:41:21 -04:00
2 changed files with 10 additions and 3 deletions
@@ -95,6 +95,9 @@ public class BuildIdDebugFileProvider implements DebugFileProvider {
}
File bucketDir = new File(rootDir, buildId.substring(0, 2));
File file = new File(bucketDir, buildId.substring(2) + ".debug");
if (!rootDir.equals(bucketDir.getParentFile()) || !bucketDir.equals(file.getParentFile())) {
throw new IOException("Bad buildid: " + buildId);
}
return file.isFile() ? file : null;
}
@@ -167,11 +167,15 @@ public class LocalDirDebugInfoDProvider implements DebugFileStorage {
return null;
}
private File getBuildidDir(String buildId) {
return new File(rootDir, buildId);
private File getBuildidDir(String buildId) throws IOException {
File dir = new File(rootDir, buildId);
if (rootDir.equals(dir.getParentFile())) {
throw new IOException("Bad buildid value: " + buildId);
}
return dir;
}
private File getCachePath(ExternalDebugInfo id) {
private File getCachePath(ExternalDebugInfo id) throws IOException {
String suffix = "";
if (id.getObjectType() == ObjectType.SOURCE) {
suffix = "-" + escapePath(Objects.requireNonNullElse(id.getExtra(), ""));