|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.FormatRegistry
public class FormatRegistry
Constructor Summary | |
---|---|
FormatRegistry()
|
Method Summary | |
---|---|
static Format |
detectFileFormat(SeekableInputStream stream)
Detect and return the format of the file by looking at the first bytes of a file. |
static ClassLoader |
getAdditionalFormatClassLoader()
Returns an additional context class loader used to load format providers. |
static Format |
getFormat(MimeType type)
|
static Format |
getFormatForExtension(String extension)
Retrieve the first FormatInfo which has a default extension which matches the given extension. |
static List<Format> |
getFormatInformation()
Retrieve the format information for the currently registered document types. |
static Integer |
getPriority(Format format)
Return the overridden priority for the given format or null if the default
priority applies. |
static void |
setAdditionalFormatClassLoader(ClassLoader formatClassLoader)
Sets an additional context classloader used to load format providers. |
static void |
setPriority(Format format,
int priority)
Override the default detection priority of the given format, replacing it with the given priority. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormatRegistry()
Method Detail |
---|
public static ClassLoader getAdditionalFormatClassLoader()
null
, the system class loader will be used.
public static void setPriority(Format format, int priority)
format
- priority
- public static Integer getPriority(Format format)
null
if the default
priority applies. The default priority of a Format
can be retrieved by a call of
Format.getPriority()
.
format
- the format the priority is asked for
null
which indicates that
the default priority of the format applies.public static Format getFormatForExtension(String extension)
extension
-
public static final List<Format> getFormatInformation()
Iterator
of FormatInfopublic static Format getFormat(MimeType type)
public static void setAdditionalFormatClassLoader(ClassLoader formatClassLoader)
null
, the system class loader will be used. Changing this loader must happen
before any format is loaded, because the format provider access lazily takes place while the
first loading process. Afterwards no further access is done.
formatClassLoader
- the new class loader to usepublic static Format detectFileFormat(SeekableInputStream stream) throws IOException
stream
- the raw data stream
IOException
- if an io error or an unsupported encoding occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |