org.apache.lucene.index
Class LuceneUtils

java.lang.Object
  extended by org.apache.lucene.index.LuceneUtils

public abstract class LuceneUtils
extends Object

Author:
kimchy

Constructor Summary
LuceneUtils()
           
 
Method Summary
static void clearLocks(Lock[] locks)
          Clears all the locks within the array, ignoring any exceptions.
static void copy(Directory src, Directory dest, byte[] buffer)
          Copies one directory contents to the other.
static void copy(Directory src, Directory dest, String name, byte[] buffer)
          Copies over the contents of the name entry from the src directory into the dest directory.
static void copy(IndexInput indexInput, IndexOutput indexOutput, String name, byte[] buffer)
          Copies the contents of the IndexInput into the IndexOutput.
static boolean isCompound(Directory directory)
          Returns true if all the segments of the directory are in compound format.
static boolean isUnCompound(Directory directory)
          Returns true if all the segments of the directory are in un-compound format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneUtils

public LuceneUtils()
Method Detail

copy

public static void copy(Directory src,
                        Directory dest,
                        byte[] buffer)
                 throws IOException
Copies one directory contents to the other. Will automatically compound or uncompound the contents of the src directory into the dest directory.

Parameters:
src - The src directory to copy from
dest - The dest directory to copy to
buffer - The buffer to use when copying over
Throws:
IOException

copy

public static void copy(Directory src,
                        Directory dest,
                        String name,
                        byte[] buffer)
                 throws IOException
Copies over the contents of the name entry from the src directory into the dest directory.

Parameters:
src - The src directory to copy from
dest - The dest directory to copy to
name - the name of the entry
buffer - The buffer to use
Throws:
IOException

copy

public static void copy(IndexInput indexInput,
                        IndexOutput indexOutput,
                        String name,
                        byte[] buffer)
                 throws IOException
Copies the contents of the IndexInput into the IndexOutput.

Parameters:
indexInput - The content to copy from
indexOutput - The output to write to
name - The name of the file
buffer - The buffer to use
Throws:
IOException

isCompound

public static boolean isCompound(Directory directory)
                          throws IOException
Returns true if all the segments of the directory are in compound format. Will return true if the index does not exists or there are no segments.

Throws:
IOException

isUnCompound

public static boolean isUnCompound(Directory directory)
                            throws IOException
Returns true if all the segments of the directory are in un-compound format. Will return true if the index does not exists or there are no segments.

Throws:
IOException

clearLocks

public static void clearLocks(Lock[] locks)
Clears all the locks within the array, ignoring any exceptions.



Copyright (c) 2004-2009 The Compass Project.