try {
dir = DirectoryBuilder.newDirectoryInstance(cache, cache, cache, INDEX_NAME).chunkSize(BUFFER_SIZE).create();
createFile(fileName, dir);
assert dir.fileExists(fileName);
assert dir.fileModified(fileName) != 0;
AssertJUnit.assertEquals(0, dir.fileModified("nonExistentFileName.txt"));
} finally {
if (dir != null) dir.close();
}