private void extractProtoSources(Set<String> extracted,String protoFile){
  if (!extracted.add(protoFile)) {
    return;
  }
  String content=copyTestData(protoFile);
  Matcher matcher=PROTO_IMPORT_PATTERN.matcher(content);
  while (matcher.find()) {
    extractProtoSources(extracted,matcher.group(1));
  }
}

private void extractProtoSources ( Set < String > extracted , String protoFile ) { if ( ! extracted . add ( protoFile ) ) { return ; } String content = copyTestData ( protoFile ) ; Matcher matcher = PROTO_IMPORT_PATTERN . matcher ( content ) ; while ( matcher . find ( ) ) { extractProtoSources ( extracted , matcher . group ( 1 ) ) ; } }
collect all needed proto files as resources from the classpath and store them in the temporary directory , so protoc can find them .
