readOptionalEntrySource static method
Reads an optional entry only after its application-relative path has passed the same symlink confinement check as configured entries.
Implementation
static String? readOptionalEntrySource({
required String appDir,
required String relativePath,
}) {
validatePathWithinRoot(root: appDir, relativePath: relativePath);
final entry = File(p.join(appDir, relativePath));
return entry.existsSync() ? entry.readAsStringSync() : null;
}