FileDocCategorySizeDatePackage
_TestHelper.javaAPI DocApache Lucene 2.2.02375Sat Jun 16 22:20:24 BST 2007org.apache.lucene.store

_TestHelper

public class _TestHelper extends Object
This class provides access to package-level features defined in the store package. It is used for testing only.

Fields Summary
Constructors Summary
Methods Summary
public static booleanisFSIndexInput(org.apache.lucene.store.IndexInput is)
Returns true if the instance of the provided input stream is actually an FSIndexInput.

        return is instanceof FSIndexInput;
    
public static booleanisFSIndexInputClone(org.apache.lucene.store.IndexInput is)
Returns true if the provided input stream is an FSIndexInput and is a clone, that is it does not own its underlying file descriptor.

        if (isFSIndexInput(is)) {
            return ((FSIndexInput) is).isClone;
        } else {
            return false;
        }
    
public static booleanisFSIndexInputOpen(org.apache.lucene.store.IndexInput is)
Given an instance of FSDirectory.FSIndexInput, this method returns true if the underlying file descriptor is valid, and false otherwise. This can be used to determine if the OS file has been closed. The descriptor becomes invalid when the non-clone instance of the FSIndexInput that owns this descriptor is closed. However, the descriptor may possibly become invalid in other ways as well.

        if (isFSIndexInput(is)) {
            FSIndexInput fis = (FSIndexInput) is;
            return fis.isFDValid();
        } else {
            return false;
        }