/** * Closes the given filesystem. * <p> * If you use VFS as singleton it is VERY dangerous to call this method. * * @param filesystem The FileSystem to close. */ @Override public void closeFileSystem(final FileSystem filesystem) { // inform the cache ... getFilesCache().clear(filesystem); // just in case the cache didnt call _closeFileSystem _closeFileSystem(filesystem); }
/** * Closes the given filesystem. * <p> * If you use VFS as singleton it is VERY dangerous to call this method. * * @param filesystem The FileSystem to close. */ @Override public void closeFileSystem(final FileSystem filesystem) { // inform the cache ... getFilesCache().clear(filesystem); // just in case the cache didnt call _closeFileSystem _closeFileSystem(filesystem); }
/** * Closes the given filesystem. * <p> * If you use VFS as singleton it is VERY dangerous to call this method. * * @param filesystem The FileSystem to close. */ @Override public void closeFileSystem(final FileSystem filesystem) { // inform the cache ... getFilesCache().clear(filesystem); // just in case the cache didnt call _closeFileSystem _closeFileSystem(filesystem); }
/** * Closes the given filesystem. * <p> * If you use VFS as singleton it is VERY dangerous to call this method. * * @param filesystem The FileSystem to close. */ @Override public void closeFileSystem(final FileSystem filesystem) { // inform the cache ... getFilesCache().clear(filesystem); // just in case the cache didnt call _closeFileSystem _closeFileSystem(filesystem); }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof NullFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof LRUFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof WeakRefFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof NullFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof SoftRefFilesCache); }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof NullFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof WeakRefFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof LRUFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof WeakRefFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof SoftRefFilesCache); }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof LRUFilesCache); } }
public void testClass() { assertTrue(getManager().getFilesCache() instanceof SoftRefFilesCache); }
/** * Will test if the cache is cleared and if it is still useable afterwards. It will actually ensure the test is * hitting the cache. */ public void testClearFiles() throws Exception { final FilesCache cache = getManager().getFilesCache(); final FileObject fo1 = getWriteFolder().resolveFile("dir1"); // clean the cache for this file system cache.clear(fo1.getFileSystem()); // make sure a empty cache clean does not fail cache.clear(fo1.getFileSystem()); final FileObject fo2 = getWriteFolder().resolveFile("dir1"); assertFalse("Objects after cache clear should be different", fo1 == fo2); }
/** * Will test if the cache is cleared and if it is still useable afterwards. * It will actually ensure the test is hitting the cache. */ public void testClearFiles() throws Exception { FilesCache cache = getManager().getFilesCache(); final FileObject fo1 = getWriteFolder().resolveFile("dir1"); // clean the cache for this file system cache.clear(fo1.getFileSystem()); // make sure a empty cache clean does not fail cache.clear(fo1.getFileSystem()); final FileObject fo2 = getWriteFolder().resolveFile("dir1"); assertFalse("Objects after cache clear should be different", fo1 == fo2); }
/** * Will test if the cache is cleared and if it is still useable afterwards. It will actually ensure the test is * hitting the cache. */ public void testClearFiles() throws Exception { final FilesCache cache = getManager().getFilesCache(); final FileObject fo1 = getWriteFolder().resolveFile("dir1"); // clean the cache for this file system cache.clear(fo1.getFileSystem()); // make sure a empty cache clean does not fail cache.clear(fo1.getFileSystem()); final FileObject fo2 = getWriteFolder().resolveFile("dir1"); assertFalse("Objects after cache clear should be different", fo1 == fo2); }
@Override public void testBasicCacheOps() throws Exception { // the basic test looks different for a null cache: final FilesCache cache = getManager().getFilesCache(); final FileObject fo = getWriteFolder().resolveFile("dir1"); final FileName fn = fo.getName(); final FileSystem fs = fo.getFileSystem(); cache.clear(fs); assertNull(cache.getFile(fs, fn)); cache.putFile(fo); assertNull(null, cache.getFile(fs, fn)); assertFalse(cache.putFileIfAbsent(fo)); // hmmm? assertNull(null, cache.getFile(fs, fn)); cache.removeFile(fs, fn); assertNull(cache.getFile(fs, fn)); }