|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SPI, extension point allowing third parties to redefine
attribute reading and writing. Must be registered
in default Lookup
.
It must generally deternime that they support given FileObject and attribute pair and if so then perform action.
Two providers can theoreticaly clash and support the same attribute for the same fileobject. The key point is that attribute meaning must be precisely defined guaranteeing that two independent providers respond with exactly same value hence making irrelevant which one is actually choosen.
Providers are not required to cache results. Any speculative results (per folder batching) can be implemented using FileAttributeQuery.writeAttribute() ignoring this self-initiated write.
Nested Class Summary | |
static class |
FileAttributeProvider.MemoryCache
Provides direct access to memory layer without delegating to providers layer. |
Method Summary | |
Object |
readAttribute(FileObject fo,
String name,
FileAttributeProvider.MemoryCache memoryCache)
Reads given attribute for given fileobject. |
boolean |
recognizesAttribute(String name)
Reports if an attribute is supported by the implementation. |
boolean |
recognizesFileObject(FileObject fo)
Reports if the file object is supported by the implementation. |
boolean |
writeAttribute(FileObject fo,
String name,
Object value)
Writes given attribute. |
Method Detail |
public boolean recognizesAttribute(String name)
public boolean recognizesFileObject(FileObject fo)
public Object readAttribute(FileObject fo, String name, FileAttributeProvider.MemoryCache memoryCache)
fo
- identifies source FileObject, never null
name
- identifies requested attribute, never null
memoryCache
- can store speculative results
null
if it does not exist.public boolean writeAttribute(FileObject fo, String name, Object value)
fo
- identifies target file object, never null
name
- identifies attribute, never null
value
- actual attribute value that should be stored or null
for removing it
false
on write failure if provider denies the value. On I/O error it
returns true
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |