* @throws IOException
*/
public static void copy(Directory src, Directory dest, boolean closeDirSrc) throws IOException {
final String[] files = src.listAll();
IndexFileNameFilter filter = IndexFileNameFilter.getFilter();
byte[] buf = new byte[BufferedIndexOutput.BUFFER_SIZE];
for (int i = 0; i < files.length; i++) {
if (!filter.accept(null, files[i]))
continue;
IndexOutput os = null;
IndexInput is = null;
try {