Class MagicMatcher
java.lang.Object
net.sf.jmimemagic.MagicMatcher
- All Implemented Interfaces:
Serializable, Cloneable
This class represents a single match test.
- Version:
- $Revision: 1.1 $
- Author:
- $Author: arimus $
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a submatch to this magic matchprotected Objectclone()String[]Get the extensions for the underlying detectory.getMatch()get all submatches for this magic matchbooleanisValid()Test to see if everything is in order for this match.voidsetMatch(MagicMatch match) voidSet all submatches.test(byte[] data, boolean onlyMimeMatch) Test to see if this match or any submatches match.test to see if this match or any submatches match
-
Constructor Details
-
MagicMatcher
public MagicMatcher()
-
-
Method Details
-
setMatch
-
getMatch
-
isValid
public boolean isValid()Test to see if everything is in order for this match.- Returns:
- whether or not this match has enough data to be valid.
-
addSubMatcher
add a submatch to this magic match- Parameters:
m- a magic match
-
setSubMatchers
Set all submatches.- Parameters:
a- a collection of submatches.
-
getSubMatchers
get all submatches for this magic match- Returns:
- a collection of submatches
-
test
test to see if this match or any submatches match- Parameters:
f- the file that should be used to test the matchonlyMimeMatch- DOCUMENT ME!- Returns:
- the deepest magic match object that matched
- Throws:
IOException- DOCUMENT ME!UnsupportedTypeException- DOCUMENT ME!
-
test
public MagicMatch test(byte[] data, boolean onlyMimeMatch) throws IOException, UnsupportedTypeException Test to see if this match or any submatches match.- Parameters:
data- the data that should be used to test the matchonlyMimeMatch- Indica que sólo se identifique el mimetype de los datos.- Returns:
- the deepest magic match object that matched
- Throws:
IOException- Cuando falla la lectura de los datos.UnsupportedTypeException- Cuando no se identifiquen los datos.
-
getDetectorExtensions
Get the extensions for the underlying detectory.- Returns:
- Listado de extensiones.
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-