@@ -109,11 +109,13 @@ public void loadProspectiveVersion(ValidationStatusReport statusReport, MysqlExe
109109 //load prospective version alone now as used to combine with dependency for extension testing
110110 uploadReleaseFileIntoDB (prospectiveVersion , null , validationConfig .getLocalProspectiveFile (), rf2FilesLoaded );
111111 }
112-
112+ final String schemaName = prospectiveVersion . startsWith ( RVF_DB_PREFIX ) ? prospectiveVersion : RVF_DB_PREFIX + prospectiveVersion ;
113113 if (!validationConfig .isRf2DeltaOnly () && !checkDeltaFilesExist (validationConfig .getLocalProspectiveFile ())) {
114- final String schemaName = prospectiveVersion .startsWith (RVF_DB_PREFIX ) ? prospectiveVersion : RVF_DB_PREFIX + prospectiveVersion ;
115114 releaseDataManager .insertIntoProspectiveDeltaTables (schemaName , executionConfig );
116115 }
116+ if (!checkFullFilesExist (validationConfig .getLocalProspectiveFile ())) {
117+ releaseDataManager .insertIntoProspectiveFullTables (schemaName );
118+ }
117119
118120 statusReport .setTotalRF2FilesLoaded (rf2FilesLoaded .size ());
119121 Collections .sort (rf2FilesLoaded );
@@ -141,6 +143,24 @@ private boolean checkDeltaFilesExist(File localProspectiveFile) throws ReleaseIm
141143 return false ;
142144 }
143145
146+ private boolean checkFullFilesExist (File localProspectiveFile ) throws ReleaseImportException {
147+ try {
148+ String deltaDirectoryPath = new ReleaseImporter ().unzipRelease (new FileInputStream (localProspectiveFile ), ReleaseImporter .ImportType .FULL ).getAbsolutePath ();
149+ try (Stream <Path > pathStream = Files .find (new File (deltaDirectoryPath ).toPath (), 50 ,
150+ (path , basicFileAttributes ) -> path .toFile ().getName ().matches ("x?(sct|rel)2_Concept_[^_]*Full_.*.txt" ))) {
151+ if (pathStream .findFirst ().isPresent ()) {
152+ return true ;
153+ }
154+ }
155+ } catch (IOException | IllegalStateException e ) {
156+ if (e .getMessage ().contains ("No Full files found" )) {
157+ return false ;
158+ }
159+ throw new ReleaseImportException ("Error while searching input files." , e );
160+ }
161+ return false ;
162+ }
163+
144164 private String loadRelease (String releaseVersion ) throws IOException , BusinessServiceException {
145165 if (releaseVersion != null && releaseVersion .endsWith (ZIP_FILE_EXTENSION )) {
146166 String schemaName = RvfReleaseDbSchemaNameGenerator .generate (releaseVersion );
@@ -431,9 +451,9 @@ public void combineCurrentExtensionWithDependencySnapshot(MysqlExecutionConfig e
431451 if (isExtension (validationConfig )) {
432452 try {
433453 releaseDataManager .copyTableData (extensionVersion , combinedVersion , DELTA_TABLE , null );
434- releaseDataManager .copyTableData (extensionVersion , combinedVersion ,FULL_TABLE , null );
454+ releaseDataManager .copyTableData (extensionVersion , combinedVersion , FULL_TABLE , null );
435455 releaseDataManager .copyTableData (executionConfig .getExtensionDependencyVersion (),
436- extensionVersion , combinedVersion ,SNAPSHOT_TABLE , null );
456+ extensionVersion , combinedVersion , SNAPSHOT_TABLE , null );
437457 resourceLoader .loadResourceData (combinedSchema );
438458 } catch (Exception e ) {
439459 String errorMsg = e .getMessage ();
0 commit comments