919293949596979899100101
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(); } }
107108109110111112113114115116117
Directory dir = null; try { dir = DirectoryBuilder.newDirectoryInstance(cache, cache, cache, INDEX_NAME).chunkSize(BUFFER_SIZE).create(); createFile(fileName, dir); long lastModifiedDate = dir.fileModified(fileName); Thread.sleep(1); dir.touchFile(fileName); assert lastModifiedDate != dir.fileModified(fileName);
112113114115116117118119120121122
long lastModifiedDate = dir.fileModified(fileName); Thread.sleep(1); dir.touchFile(fileName); assert lastModifiedDate != dir.fileModified(fileName); } finally { if (dir != null) dir.close(); } }
127128129130131132133134135136137
Directory dir = null; try { dir = DirectoryBuilder.newDirectoryInstance(cache, cache, cache, INDEX_NAME).chunkSize(BUFFER_SIZE).create(); long lastModifiedDate = dir.fileModified(fileName); AssertJUnit.assertEquals(0L, lastModifiedDate); Thread.sleep(1); dir.touchFile(fileName); AssertJUnit.assertEquals(lastModifiedDate, dir.fileModified(fileName));
132133134135136137138139140141142
long lastModifiedDate = dir.fileModified(fileName); AssertJUnit.assertEquals(0L, lastModifiedDate); Thread.sleep(1); dir.touchFile(fileName); AssertJUnit.assertEquals(lastModifiedDate, dir.fileModified(fileName)); } finally { if (dir != null) dir.close(); } }
136137138139140141142143144145146
dir = new InfinispanDirectory(cache, "index"); createFile(fileName, dir); assert dir.fileExists(fileName); assert dir.fileModified(fileName) != 0; assert dir.fileModified("nonExistentFileName.txt") == 0; } finally { if (dir != null) dir.close(); }
138139140141142143144145146147148
createFile(fileName, dir); assert dir.fileExists(fileName); assert dir.fileModified(fileName) != 0; assert dir.fileModified("nonExistentFileName.txt") == 0; } finally { if (dir != null) dir.close(); } }
154155156157158159160161162163164
String fileName = "testfile.txt"; dir = new InfinispanDirectory(cache, "index"); createFile(fileName, dir); long lastModifiedDate = dir.fileModified(fileName); Thread.sleep(100); dir.touchFile(fileName); assert lastModifiedDate != dir.fileModified(fileName);
159160161162163164165166167168169
long lastModifiedDate = dir.fileModified(fileName); Thread.sleep(100); dir.touchFile(fileName); assert lastModifiedDate != dir.fileModified(fileName); } finally { if (dir != null) dir.close(); } }
174175176177178179180181182183184
Cache cache = cacheManager.getCache(); String fileName = "nonExistent.txt"; dir = new InfinispanDirectory(cache, "index"); long lastModifiedDate = dir.fileModified(fileName); Thread.sleep(100); dir.touchFile(fileName); AssertJUnit.assertEquals(lastModifiedDate, dir.fileModified(fileName)); } finally {