Added methods to retrieve the String representation of Profile XSD

schema. Refs #17423
This commit is contained in:
Luca Frosini 2019-09-02 14:44:35 +02:00
parent 1292d0e50a
commit 6fbd228b0f
1 changed files with 11 additions and 5 deletions

View File

@ -174,22 +174,28 @@ public class DataCalogueMetadataFormatReader implements DataCatalogueMetadataDis
namespaceCategories = null; namespaceCategories = null;
} }
@Override @Override
public String getProfileSchema() { public String getProfileSchema() {
if(profileSchema == null) { if(profileSchema == null) {
InputStream inputStream = getProfileSchemaInputStream(); profileSchema = DataCalogueMetadataFormatReader.getProfileSchemaString();
profileSchema = new BufferedReader(new InputStreamReader(inputStream)).lines()
.collect(Collectors.joining("\n"));
} }
return profileSchema; return profileSchema;
} }
static InputStream getProfileSchemaInputStream() { public static String getProfileSchemaString() {
InputStream inputStream = DataCalogueMetadataFormatReader.getProfileSchemaInputStream();
return new BufferedReader(new InputStreamReader(inputStream)).lines()
.collect(Collectors.joining("\n"));
}
public static InputStream getProfileSchemaInputStream() {
return DataCalogueMetadataFormatReader.class.getResourceAsStream(SCHEMA_FILENAME); return DataCalogueMetadataFormatReader.class.getResourceAsStream(SCHEMA_FILENAME);
} }
static URL getProfileSchemaURL() { public static URL getProfileSchemaURL() {
return DataCalogueMetadataFormatReader.class.getResource(SCHEMA_FILENAME); return DataCalogueMetadataFormatReader.class.getResource(SCHEMA_FILENAME);
} }