|
|
@@ -68,7 +68,7 @@ public class DefaultIndexedFile extends DefaultInputComponent implements Indexed |
|
|
|
SensorStrategy sensorStrategy, @Nullable String oldRelativeFilePath) { |
|
|
|
super(batchId); |
|
|
|
this.projectKey = projectKey; |
|
|
|
this.projectRelativePath = PathUtils.sanitize(projectRelativePath); |
|
|
|
this.projectRelativePath = checkSanitize(projectRelativePath); |
|
|
|
this.moduleRelativePath = PathUtils.sanitize(moduleRelativePath); |
|
|
|
this.type = type; |
|
|
|
this.language = language; |
|
|
@@ -78,6 +78,14 @@ public class DefaultIndexedFile extends DefaultInputComponent implements Indexed |
|
|
|
validateKeyLength(); |
|
|
|
} |
|
|
|
|
|
|
|
static String checkSanitize(String relativePath) { |
|
|
|
String sanitized = PathUtils.sanitize(relativePath); |
|
|
|
if(sanitized == null) { |
|
|
|
throw new IllegalArgumentException(String.format("The path '%s' must sanitize to a non-null value", relativePath)); |
|
|
|
} |
|
|
|
return sanitized; |
|
|
|
} |
|
|
|
|
|
|
|
private void validateKeyLength() { |
|
|
|
String key = key(); |
|
|
|
if (key.length() > MAX_KEY_LENGTH) { |