@@ -169,21 +169,29 @@ public void handleMetadataFiles(DirectoryStream<Path> metadataXmlFiles, Element
169169 // Important folder name to identify metadata should be ../../
170170 lastUnknownMetadataFolderName = file .getParent ().getParent ().relativize (file );
171171
172- try {
173- String metadataSchema = metadataSchemaUtils .autodetectSchema (metadata , null );
174- // If local node doesn't know metadata
175- // schema try to load next xml file.
176- if (metadataSchema == null ) {
177- continue ;
172+ String metadataSchema = null ;
173+
174+ if (style .equals ("schema:iso19115-3.2018.che:convert/fromISO19139.che" ) &&
175+ "CHE_MD_Metadata" .equals (metadata .getName ()) &&
176+ "http://www.geocat.ch/2008/che" .equals (metadata .getNamespace ().getURI ())) {
177+ metadataSchema = "iso19115-3.2018.che" ;
178+ infoSchema = "iso19115-3.2018.che" ;
179+ }
180+ if (metadataSchema == null ) {
181+ try {
182+ metadataSchema = metadataSchemaUtils .autodetectSchema (metadata , null );
183+ } catch (NoSchemaMatchesException e ) {
184+ Log .debug (Geonet .MEF , "No schema match for " + lastUnknownMetadataFolderName + "." );
178185 }
186+ }
187+ if (metadataSchema == null ) {
188+ continue ;
189+ }
179190
180- String currFile = "Found metadata file " + file .getParent ().getParent ().relativize (file );
191+ String currFile = "Found metadata file " + file .getParent ().getParent ().relativize (file );
181192
182- mdFiles .put (metadataSchema , Pair .read (currFile , metadata ));
193+ mdFiles .put (metadataSchema , Pair .read (currFile , metadata ));
183194
184- } catch (NoSchemaMatchesException e ) {
185- Log .debug (Geonet .MEF , "No schema match for " + lastUnknownMetadataFolderName + "." );
186- }
187195 }
188196 }
189197
0 commit comments