public class MimeExtractorRepo extends Object
Constructor and Description |
---|
MimeExtractorRepo()
Default Constructor
|
MimeExtractorRepo(List<MetExtractorSpec> defaultExtractorSpecs,
String defaultNamingConventionId,
String mimeRepoFile,
boolean magic)
Constructs a new MimeExtractorMappingFile with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addMetExtractorSpec(String mimeType,
MetExtractorSpec spec) |
void |
addMetExtractorSpecs(String mimeType,
List<MetExtractorSpec> specs) |
List<MetExtractorSpec> |
getDefaultMetExtractorSpecs() |
String |
getDefaultNamingConventionId() |
List<MetExtractorSpec> |
getExtractorSpecsForFile(File file) |
List<MetExtractorSpec> |
getExtractorSpecsForMimeType(String mimeType) |
String |
getMimeType(File file) |
List<String> |
getMimeTypes(File file)
Gets the mime-type hierarchy.
|
String |
getNamingConventionId(String mimeType) |
boolean |
isMagic() |
void |
setDefaultMetExtractorSpecs(List<MetExtractorSpec> defaultExtractorSpecs) |
void |
setDefaultNamingConventionId(String defaultNamingConventionId) |
void |
setMagic(boolean magic) |
void |
setMimeRepoFile(String mimeRepoFile) |
void |
setNamingConventionId(String mimeType,
String namingConventionId) |
public MimeExtractorRepo() throws FileNotFoundException
FileNotFoundException
public MimeExtractorRepo(List<MetExtractorSpec> defaultExtractorSpecs, String defaultNamingConventionId, String mimeRepoFile, boolean magic) throws FileNotFoundException
defaultExtractorClassName
- The name of the default extractor to call if the mime type
can't be determined.repo
- The Mime Repository to use for mime resolution.magic
- Whether or not mime magic should be used or not in resolution.mappings
- List
of MimeExtractorMapping
s.FileNotFoundException
public void addMetExtractorSpec(String mimeType, MetExtractorSpec spec)
public void addMetExtractorSpecs(String mimeType, List<MetExtractorSpec> specs)
public List<MetExtractorSpec> getExtractorSpecsForMimeType(String mimeType)
public List<MetExtractorSpec> getExtractorSpecsForFile(File file) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public List<MetExtractorSpec> getDefaultMetExtractorSpecs()
public void setDefaultMetExtractorSpecs(List<MetExtractorSpec> defaultExtractorSpecs)
defaultExtractorClassName
- the defaultExtractorClassName to setpublic void setDefaultNamingConventionId(String defaultNamingConventionId)
public String getDefaultNamingConventionId()
public boolean isMagic()
public void setMagic(boolean magic)
magic
- the magic to setpublic void setMimeRepoFile(String mimeRepoFile) throws FileNotFoundException
mimeRepo
- the mimeRepo to setFileNotFoundException
Copyright © 1999-2015 Apache OODT. All Rights Reserved.