mirror of
https://github.com/apache/nifi.git
synced 2025-03-04 00:19:44 +00:00
NIFI-13485 Use readBlob when reading content in GitHubRepositoryClient
- The readBlob method avoids issues with 1 MB limits on alternative getContent requests This closes #9067 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
3b2120e6c6
commit
cbdabccd6b
@ -212,7 +212,7 @@ public class GitHubRepositoryClient {
|
|||||||
return execute(() -> {
|
return execute(() -> {
|
||||||
try {
|
try {
|
||||||
final GHContent ghContent = repository.getFileContent(resolvedPath, branchRef);
|
final GHContent ghContent = repository.getFileContent(resolvedPath, branchRef);
|
||||||
return ghContent.read();
|
return repository.readBlob(ghContent.getSha());
|
||||||
} catch (final FileNotFoundException fnf) {
|
} catch (final FileNotFoundException fnf) {
|
||||||
throwPathOrBranchNotFound(fnf, resolvedPath, branchRef);
|
throwPathOrBranchNotFound(fnf, resolvedPath, branchRef);
|
||||||
return null;
|
return null;
|
||||||
@ -238,7 +238,7 @@ public class GitHubRepositoryClient {
|
|||||||
return execute(() -> {
|
return execute(() -> {
|
||||||
try {
|
try {
|
||||||
final GHContent ghContent = repository.getFileContent(resolvedPath, commitSha);
|
final GHContent ghContent = repository.getFileContent(resolvedPath, commitSha);
|
||||||
return ghContent.read();
|
return repository.readBlob(ghContent.getSha());
|
||||||
} catch (final FileNotFoundException fnf) {
|
} catch (final FileNotFoundException fnf) {
|
||||||
throw new FlowRegistryException("Path [" + resolvedPath + "] or Commit [" + commitSha + "] not found", fnf);
|
throw new FlowRegistryException("Path [" + resolvedPath + "] or Commit [" + commitSha + "] not found", fnf);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user