|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KMimeMagic
public class KMimeMagic
May be removed in KDE 4.0. Determine auto-magically the type of file, not only by using its extension, but also by reading its contents. Unless specified otherwise, KMimeMagic uses $KDEDIR/share/mimelnk/magic for this purpose. To make KMimeMagic restore the 'atime' of a file after it opened it, add its directory in kmimemagicrc like: [Settings] atimeDirs=/tmp,/var/tmp,/home/dfaure/tmp This isn't done by default because it changes the 'ctime'. See kmimemagic.cpp for a full discussion on this issue. The basic usage of KMimeMagic is :
find...Type
() methods.
Constructor Summary | |
---|---|
|
KMimeMagic()
Create a parser and initialize it with the KDE-global data: the "magic" config file as well as the snippets from share/config/magic. |
protected |
KMimeMagic(java.lang.Class dummy)
|
|
KMimeMagic(java.lang.String configFile)
Create a parser and initialize it with the given config file. |
Method Summary | |
---|---|
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
protected void |
finalize()
Deletes the wrapped C++ instance |
KMimeMagicResult |
findBufferFileType(byte[] arg1,
java.lang.String filename)
Same functionality as findBufferType() but with additional capability of distinguishing between C-headers and C-Source. |
KMimeMagicResult |
findBufferType(byte[] p)
Same functionality as above, except data is not read from a file. |
KMimeMagicResult |
findFileType(java.lang.String _filename)
Try to find a MimeType for the given file. |
protected static void |
initStatic()
|
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
boolean |
mergeBufConfig(java.lang.String arg1)
Merge an existing parse table with the data from the given buffer. |
boolean |
mergeConfig(java.lang.String configFile)
Merge an existing parse table with the data from the given file. |
static KMimeMagic |
self()
Returns a pointer to the unique KMimeMagic instance in this process. |
void |
setFollowLinks(boolean _enable)
Enable/Disable follow-links. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected KMimeMagic(java.lang.Class dummy)
public KMimeMagic()
public KMimeMagic(java.lang.String configFile)
Method Detail |
---|
public boolean mergeConfig(java.lang.String configFile)
true
on success.public boolean mergeBufConfig(java.lang.String arg1)
true
on success.public void setFollowLinks(boolean _enable)
public KMimeMagicResult findFileType(java.lang.String _filename)
public KMimeMagicResult findBufferType(byte[] p)
public KMimeMagicResult findBufferFileType(byte[] arg1, java.lang.String filename)
public static KMimeMagic self()
protected static void initStatic()
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |