Java question.
What method should I use to find out if a Windows file is marked as content indexed or not? I've tried to write a solution similair to Determine whether a file is a junction (in Windows) or not? , I would like to stress that the following code was written with simply assuming that the .getClass().getDeclaredMethod method did have "isIndexed" as an argument, in line with "isReparsePoint", however, that assumption turns out to be incorrect since the following code always returns as false. I decided to leave it in just in case someone knows the proper reference that would fit this code.
boolean isIndexed = false;
if (DosFileAttributes.class.isInstance(attr)) {
try {
Method m = attr.getClass().getDeclaredMethod("isIndexed");
m.setAccessible(true);
isIndexed = (boolean) m.invoke(attr);
} catch (Exception e) {
// just gave it a try
}
}
Instead of "isIndexed" in the getDeclaredMethod argument I've also tried using "isContentIndexed" and "isNotContentIndexed", all without any satisfactory results.