public abstract class ContentPlugin extends WDXPluginAdapter
| Modifier and Type | Class and Description |
|---|---|
static class |
ContentPlugin.EditableField<T> |
static class |
ContentPlugin.Field<T> |
| Modifier and Type | Field and Description |
|---|---|
static int |
FT_SETSUCCESS |
protected static org.apache.commons.logging.Log |
log |
CONTENT_DELAYIFSLOW, CONTFLAGS_EDIT, CONTFLAGS_FIELDEDIT, CONTFLAGS_PASSTHROUGH_SIZE_FLOAT, CONTFLAGS_SUBSTATTRIBUTES, CONTFLAGS_SUBSTATTRIBUTESTR, CONTFLAGS_SUBSTDATE, CONTFLAGS_SUBSTDATETIME, CONTFLAGS_SUBSTMASK, CONTFLAGS_SUBSTSIZE, CONTFLAGS_SUBSTTIME, CONTST_READNEWDIR, CONTST_REFRESHPRESSED, CONTST_SHOWHINT, SETFLAGS_FIRST_ATTRIBUTE, SETFLAGS_LAST_ATTRIBUTE, SETFLAGS_ONLY_DATE| Modifier | Constructor and Description |
|---|---|
protected |
ContentPlugin() |
| Modifier and Type | Method and Description |
|---|---|
int |
contentGetSupportedField(int fieldIndex,
java.lang.StringBuffer fieldName,
java.lang.StringBuffer units,
int maxlen)
ContentGetSupportedField is called to enumerate all supported fields.
|
int |
contentGetSupportedFieldFlags(int fieldIndex)
ContentGetSupportedFieldFlags is called to get various information about
a plugin variable.
|
int |
contentGetValue(java.lang.String fileName,
int fieldIndex,
int unitIndex,
FieldValue fieldValue,
int maxlen,
int flags)
ContentGetValue is called to retrieve the value of a specific field for a
given file, e.g. the date field of a file.
|
java.lang.Iterable<java.nio.ByteBuffer> |
contents(java.lang.String fileName) |
int |
contentSetValue(java.lang.String fileName,
int fieldIndex,
int unitIndex,
int fieldType,
FieldValue fieldValue,
int flags)
ContentSetValue is called to set the value of a specific field for a
given file, e.g. to change the date field of a file.
|
void |
contentStopGetValue(java.lang.String fileName)
ContentStopGetValue is called to tell a plugin that a directory change
has occurred, and the plugin should stop loading a value.
|
protected <T,F extends ContentPlugin.Field<T>> |
define(F field) |
java.lang.Iterable<ContentPlugin.Field<?>> |
fields()
Let's you iterate over all the fields
defined in this ContentPlugin,
in the order they were defined. |
<T> ContentPlugin.Field<T> |
getField(java.lang.String name) |
<T> T |
getValue(ContentPlugin.Field<T> field,
java.lang.String fileName) |
<T> T |
getValue(java.lang.String fieldName,
java.lang.String fileName) |
protected abstract void |
initFields() |
void |
listFields()
Prints string representations for all fields to System.out,
in the order they were
defined. |
void |
listFields(java.io.PrintStream out)
Prints string representations for all fields to to the specified PrintStream,
in the order they were
defined. |
void |
runTests(java.lang.String... fileNames) |
contentEditValue, contentGetDefaultSortOrder, contentGetDetectString, contentPluginUnloading, contentSendStateInformation, contentSetDefaultParamspublic static final int FT_SETSUCCESS
protected static org.apache.commons.logging.Log log
protected abstract void initFields()
protected final <T,F extends ContentPlugin.Field<T>> void define(F field)
public java.lang.Iterable<ContentPlugin.Field<?>> fields()
defined in this ContentPlugin,
in the order they were defined.public <T> ContentPlugin.Field<T> getField(java.lang.String name)
public <T> T getValue(ContentPlugin.Field<T> field, java.lang.String fileName) throws java.io.IOException
java.io.IOExceptionpublic <T> T getValue(java.lang.String fieldName,
java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionpublic void listFields()
defined.public void listFields(java.io.PrintStream out)
defined.public java.lang.Iterable<java.nio.ByteBuffer> contents(java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionpublic final int contentGetSupportedField(int fieldIndex,
java.lang.StringBuffer fieldName,
java.lang.StringBuffer units,
int maxlen)
WDXPluginAdaptercontentGetSupportedField in interface WDXPluginInterfacecontentGetSupportedField in class WDXPluginAdapterfieldIndex - The index of the field for which TC requests information.
Starting with 0, the FieldIndex is increased until the plugin
returns an error.fieldName - Here the plugin has to return the name of the field with index
FieldIndex. The field may not contain the following chars: .
(dot) | (vertical line) : (colon). You may return a maximum of
maxlen characters, including the trailing 0.units - When a field supports several units like bytes, kbytes, Mbytes
etc, they need to be specified here in the following form:
bytes|kbytes|Mbytes . The separator is the vertical dash
(Alt+0124). As field names, unit names may not contain a
vertical dash, a dot, or a colon. You may return a maximum of
maxlen characters, including the trailing 0. If the field type
is FT_MULTIPLECHOICE, the plugin needs to return all possible
values here. Example: The field "File Type" of the built-in
content plugin can have the values "File", "Folder" and
"Reparse point". The available choices need to be returned in
the following form: File|Folder|Reparse point . The same
separator is used as for Units. You may return a maximum of
maxlen characters, including the trailing 0. The field type
FT_MULTIPLECHOICE does NOT support any units.maxlen - The maximum number of characters, including the trailing 0,
which may be returned in each of the fields.public final int contentGetSupportedFieldFlags(int fieldIndex)
WDXPluginAdaptercontentGetSupportedFieldFlags in interface WDXPluginInterfacecontentGetSupportedFieldFlags in class WDXPluginAdapterfieldIndex - The index of the field for which the sort order should be
returned.
public final int contentGetValue(java.lang.String fileName,
int fieldIndex,
int unitIndex,
FieldValue fieldValue,
int maxlen,
int flags)
WDXPluginAdaptercontentGetValue in interface WDXPluginInterfacecontentGetValue in class WDXPluginAdapterfileName - The name of the file for which the plugin needs to return the
field data.fieldIndex - The index of the field for which the content has to be
returned. This is the same index as the FieldIndex value in
ContentGetSupportedField.unitIndex - The index of the unit used. fieldValue - Here the plugin needs to return the requested data. The data
format depends on the field type:
maxlen - The maximum number of bytes fitting into the FieldValue
variable.flags - Currently only one flag is defined:
public final void contentStopGetValue(java.lang.String fileName)
WDXPluginAdaptercontentStopGetValue in interface WDXPluginInterfacecontentStopGetValue in class WDXPluginAdapterfileName - The name of the file for which ContentGetValue is currently
being called.public final int contentSetValue(java.lang.String fileName,
int fieldIndex,
int unitIndex,
int fieldType,
FieldValue fieldValue,
int flags)
WDXPluginAdaptercontentSetValue in interface WDXPluginInterfacecontentSetValue in class WDXPluginAdapterfileName - The name of the file for which the plugin needs to change the
field data. This is set to NULL to indicate the end of change
attributes (see remarks below).fieldIndex - The index of the field for which the content has to be
returned. This is the same index as the FieldIndex value in
ContentGetSupportedField. This is set to -1 to signal the end
of change attributes (see remarks below).unitIndex - The index of the unit used. fieldType - The type of data passed to the plugin in FieldValue. This is
the same type as returned by the plugin via
ContentGetSupportedField. If the plugin returned a different
type via ContentGetValue, the the FieldType _may_ be of that
type too.fieldValue - Here the plugin receives the data to be changed. The data
format depends on the field type:
flags - Currently the following flags are defined:
public void runTests(java.lang.String... fileNames)
throws java.io.IOException
java.io.IOException