Class FormatIdentifierSiegfried
- java.lang.Object
-
- fr.gouv.vitam.common.format.identification.siegfried.FormatIdentifierSiegfried
-
- All Implemented Interfaces:
FormatIdentifier
public class FormatIdentifierSiegfried extends java.lang.Object implements FormatIdentifier
Siegfried implementation of format identifier
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PRONOM_NAMESPACE
Pronom namespacestatic java.lang.String
UNKNOW_NAMESPACE
Unknown namespace
-
Constructor Summary
Constructors Constructor Description FormatIdentifierSiegfried(SiegfriedClientFactory siegfriedClientFactory, java.nio.file.Path versionPath)
For JUnit ONLYFormatIdentifierSiegfried(java.util.Map<java.lang.String,java.lang.Object> configurationProperties)
Configuration should come with 'client', 'rootPath' and 'versionPath' mandatory parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FormatIdentifierResponse>
analysePath(java.nio.file.Path path)
Identify the format of the file identified by its pathFormatIdentifierInfo
status()
Get format identifier status
-
-
-
Field Detail
-
PRONOM_NAMESPACE
public static final java.lang.String PRONOM_NAMESPACE
Pronom namespace- See Also:
- Constant Field Values
-
UNKNOW_NAMESPACE
public static final java.lang.String UNKNOW_NAMESPACE
Unknown namespace- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FormatIdentifierSiegfried
public FormatIdentifierSiegfried(java.util.Map<java.lang.String,java.lang.Object> configurationProperties) throws FormatIdentifierTechnicalException
Configuration should come with 'client', 'rootPath' and 'versionPath' mandatory parameters. If client is 'http': 'host' and 'port' are mandatory. If not, mock client is used.- Parameters:
configurationProperties
- the configuration properties needed to instantiate Siegfried format identifier- Throws:
FormatIdentifierTechnicalException
- If a technical error occures when the version path is createdjava.lang.IllegalArgumentException
- if mandatory parameter are not given or null
-
FormatIdentifierSiegfried
public FormatIdentifierSiegfried(SiegfriedClientFactory siegfriedClientFactory, java.nio.file.Path versionPath)
For JUnit ONLY- Parameters:
siegfriedClientFactory
- a custom instance of siegfried clientversionPath
- the version request path
-
-
Method Detail
-
status
public FormatIdentifierInfo status() throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException
Description copied from interface:FormatIdentifier
Get format identifier status- Specified by:
status
in interfaceFormatIdentifier
- Returns:
- The format identifier software information containing version
- Throws:
FormatIdentifierTechnicalException
- for any other technical exceptionFormatIdentifierNotFoundException
- if the given identifier could not responds
-
analysePath
public java.util.List<FormatIdentifierResponse> analysePath(java.nio.file.Path path) throws FileFormatNotFoundException, FormatIdentifierBadRequestException, FormatIdentifierTechnicalException, FormatIdentifierNotFoundException
Description copied from interface:FormatIdentifier
Identify the format of the file identified by its path- Specified by:
analysePath
in interfaceFormatIdentifier
- Parameters:
path
- the path to the file to be identified- Returns:
- the FormatIdentifierResponse containing information about the format of the file
- Throws:
FileFormatNotFoundException
- if a file format is not found by the identifierFormatIdentifierBadRequestException
- if the given path dont match a fileFormatIdentifierTechnicalException
- for any other technical exceptionFormatIdentifierNotFoundException
- if the given identifier could not responds
-
-