use of com.facebook.buck.distributed.thrift.FetchSourceFilesResponse in project buck by facebook.
the class DistBuildService method fetchSourceFile.
public InputStream fetchSourceFile(String hashCode) throws IOException {
FrontendRequest request = createFetchSourceFileRequest(hashCode);
FrontendResponse response = makeRequestChecked(request);
Preconditions.checkState(response.isSetFetchSourceFilesResponse());
Preconditions.checkState(response.getFetchSourceFilesResponse().isSetFiles());
FetchSourceFilesResponse fetchSourceFilesResponse = response.getFetchSourceFilesResponse();
Preconditions.checkState(1 == fetchSourceFilesResponse.getFilesSize());
FileInfo file = fetchSourceFilesResponse.getFiles().get(0);
Preconditions.checkState(file.isSetContent());
return new ByteArrayInputStream(file.getContent());
}
Aggregations