Class MetadataProfileReader
- java.lang.Object
-
- org.gcube.common.metadataprofilediscovery.MetadataProfileReader
-
- All Implemented Interfaces:
MetadataProfileDiscovery
public class MetadataProfileReader extends Object implements MetadataProfileDiscovery
The Class MetadataProfileReader.- Author:
- Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it Mar 1, 2022
-
-
Field Summary
Fields Modifier and Type Field Description static StringURL_OF_GCDCMETADATAPROFILEV3_XSD
-
Constructor Summary
Constructors Constructor Description MetadataProfileReader(String grMetadataProfileSecondaryType)Instantiates a new metadata profile reader.MetadataProfileReader(String grMetadataProfileSecondaryType, String resourceName)Instantiates a new metadata profile reader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<MetadataProfile>getListOfMetadataProfiles()Gets the list of metadata profiles.List<NamespaceCategory>getListOfNamespaceCategories()Gets the list of namespace categories.MetadataFormatgetMetadataFormatForMetadataProfile(MetadataProfile profile)Gets the metadata format for metadata profile.StringgetProfileSchema()Gets the profile schema.static InputStreamgetProfileSchemaInputStream()Gets the profile schema input stream.static StringgetProfileSchemaString()Gets the profile schema string.static URLgetProfileSchemaURL()Gets the profile schema URL.voidresetMetadataProfile()Reset metadata profile.voidresetNamespaceCategories()Reset namespace categories.static MetadataFormattoMetadataFormat(InputStream metadataProfileStream)Utility method to get a metadata format from a "gCube Metadata Profiles" model (XML-based).static voidvalidateProfile(InputStream xml)Validate profile.voidvalidateProfile(String xmlProfile)Validate profile.
-
-
-
Field Detail
-
URL_OF_GCDCMETADATAPROFILEV3_XSD
public static final String URL_OF_GCDCMETADATAPROFILEV3_XSD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MetadataProfileReader
public MetadataProfileReader(String grMetadataProfileSecondaryType) throws Exception
Instantiates a new metadata profile reader.- Parameters:
grMetadataProfileSecondaryType- the SecondaryType that must be used to discover the "gCube Metadata Profiles" from Information System- Throws:
Exception- the exception
-
MetadataProfileReader
public MetadataProfileReader(String grMetadataProfileSecondaryType, String resourceName) throws Exception
Instantiates a new metadata profile reader.- Parameters:
grMetadataProfileSecondaryType- the gr metadata profile secondary typeresourceName- the resource name the SecondaryType and the ResourceName that must be used to discover the "gCube Metadata Profiles" from Information System- Throws:
Exception- the exception
-
-
Method Detail
-
getProfileSchemaString
public static String getProfileSchemaString()
Gets the profile schema string.- Returns:
- the profile schema string
-
getProfileSchemaInputStream
public static InputStream getProfileSchemaInputStream()
Gets the profile schema input stream.- Returns:
- the profile schema input stream
-
getProfileSchemaURL
public static URL getProfileSchemaURL()
Gets the profile schema URL.- Returns:
- the profile schema URL
-
validateProfile
public static void validateProfile(InputStream xml) throws Exception
Validate profile.- Parameters:
xml- the xml- Throws:
Exception- the exception
-
getMetadataFormatForMetadataProfile
public MetadataFormat getMetadataFormatForMetadataProfile(MetadataProfile profile) throws Exception
Gets the metadata format for metadata profile.- Specified by:
getMetadataFormatForMetadataProfilein interfaceMetadataProfileDiscovery- Parameters:
profile- the profile- Returns:
- the metadata format for metadata profile
- Throws:
Exception- the exception
-
getListOfMetadataProfiles
public List<MetadataProfile> getListOfMetadataProfiles() throws Exception
Gets the list of metadata profiles.- Specified by:
getListOfMetadataProfilesin interfaceMetadataProfileDiscovery- Returns:
- the list of metadata profiles
- Throws:
Exception- the exception
-
getListOfNamespaceCategories
public List<NamespaceCategory> getListOfNamespaceCategories() throws Exception
Gets the list of namespace categories.- Specified by:
getListOfNamespaceCategoriesin interfaceMetadataProfileDiscovery- Returns:
- the list of namespace categories
- Throws:
Exception- the exception
-
resetMetadataProfile
public void resetMetadataProfile()
Reset metadata profile.- Specified by:
resetMetadataProfilein interfaceMetadataProfileDiscovery
-
resetNamespaceCategories
public void resetNamespaceCategories()
Reset namespace categories.- Specified by:
resetNamespaceCategoriesin interfaceMetadataProfileDiscovery
-
getProfileSchema
public String getProfileSchema()
Gets the profile schema.- Specified by:
getProfileSchemain interfaceMetadataProfileDiscovery- Returns:
- the profile schema
-
validateProfile
public void validateProfile(String xmlProfile) throws ParserConfigurationException, SAXException, IOException
Validate profile.- Specified by:
validateProfilein interfaceMetadataProfileDiscovery- Parameters:
xmlProfile- the xml profile- Throws:
ParserConfigurationException- the parser configuration exceptionSAXException- the SAX exceptionIOException- Signals that an I/O exception has occurred.
-
toMetadataFormat
public static MetadataFormat toMetadataFormat(InputStream metadataProfileStream) throws JAXBException
Utility method to get a metadata format from a "gCube Metadata Profiles" model (XML-based).- Parameters:
metadataProfileStream- the metadata profile stream- Returns:
- the metadata format
- Throws:
JAXBException- the JAXB exception
-
-