use of org.eclipse.che.api.vfs.search.SearcherProvider in project che by eclipse.
the class ZipArchiverTest method setUp.
@Before
public void setUp() throws Exception {
File targetDir = new File(Thread.currentThread().getContextClassLoader().getResource(".").getPath()).getParentFile();
testDirectory = new File(targetDir, NameGenerator.generate("fs-", 4));
assertTrue(testDirectory.mkdir());
SearcherProvider searcherProvider = mock(SearcherProvider.class);
Searcher searcher = mock(Searcher.class);
VirtualFileSystem virtualFileSystem = new LocalVirtualFileSystem(testDirectory, mock(ArchiverFactory.class), searcherProvider, mock(AbstractVirtualFileSystemProvider.CloseCallback.class));
when(searcherProvider.getSearcher(eq(virtualFileSystem), eq(true))).thenReturn(searcher);
when(searcherProvider.getSearcher(eq(virtualFileSystem))).thenReturn(searcher);
vfsRoot = virtualFileSystem.getRoot();
}
use of org.eclipse.che.api.vfs.search.SearcherProvider in project che by eclipse.
the class TarArchiverTest method setUp.
@Before
public void setUp() throws Exception {
File targetDir = new File(Thread.currentThread().getContextClassLoader().getResource(".").getPath()).getParentFile();
testDirectory = new File(targetDir, NameGenerator.generate("fs-", 4));
assertTrue(testDirectory.mkdir());
SearcherProvider searcherProvider = mock(SearcherProvider.class);
Searcher searcher = mock(Searcher.class);
VirtualFileSystem virtualFileSystem = new LocalVirtualFileSystem(testDirectory, mock(ArchiverFactory.class), searcherProvider, mock(AbstractVirtualFileSystemProvider.CloseCallback.class));
when(searcherProvider.getSearcher(eq(virtualFileSystem), eq(true))).thenReturn(searcher);
when(searcherProvider.getSearcher(eq(virtualFileSystem))).thenReturn(searcher);
vfsRoot = virtualFileSystem.getRoot();
}
use of org.eclipse.che.api.vfs.search.SearcherProvider in project che by eclipse.
the class LocalVirtualFileTest method setUp.
@Before
public void setUp() throws Exception {
File targetDir = new File(Thread.currentThread().getContextClassLoader().getResource(".").getPath()).getParentFile();
testDirectory = new File(targetDir, NameGenerator.generate("fs-", 4));
assertTrue(testDirectory.mkdir());
assertionHelper = new LocalVirtualFileAssertionHelper(testDirectory);
archiverFactory = mock(ArchiverFactory.class);
SearcherProvider searcherProvider = mock(SearcherProvider.class);
fileSystem = new LocalVirtualFileSystem(testDirectory, archiverFactory, searcherProvider, mock(AbstractVirtualFileSystemProvider.CloseCallback.class));
searcher = mock(Searcher.class);
when(searcherProvider.getSearcher(eq(fileSystem), eq(true))).thenReturn(searcher);
when(searcherProvider.getSearcher(eq(fileSystem))).thenReturn(searcher);
}
use of org.eclipse.che.api.vfs.search.SearcherProvider in project che by eclipse.
the class LocalVirtualFileSystemTest method setUp.
@Before
public void setUp() throws Exception {
SearcherProvider searcherProvider = mock(SearcherProvider.class);
searcher = mock(Searcher.class);
closeCallback = mock(AbstractVirtualFileSystemProvider.CloseCallback.class);
File targetDir = new File(Thread.currentThread().getContextClassLoader().getResource(".").getPath()).getParentFile();
testDirectory = new File(targetDir, NameGenerator.generate("fs-", 4));
fileSystem = new LocalVirtualFileSystem(testDirectory, mock(ArchiverFactory.class), searcherProvider, closeCallback);
when(searcherProvider.getSearcher(eq(fileSystem), anyBoolean())).thenReturn(searcher);
when(searcherProvider.getSearcher(eq(fileSystem))).thenReturn(searcher);
}
use of org.eclipse.che.api.vfs.search.SearcherProvider in project che by eclipse.
the class IndexedFileUpdateConsumer method accept.
@Override
public void accept(Path path) {
try {
VirtualFileSystem virtualFileSystem = vfsProvider.getVirtualFileSystem();
SearcherProvider searcherProvider = virtualFileSystem.getSearcherProvider();
Searcher searcher = searcherProvider.getSearcher(virtualFileSystem);
Path innerPath = root.toPath().relativize(path);
org.eclipse.che.api.vfs.Path vfsPath = org.eclipse.che.api.vfs.Path.of(innerPath.toString());
VirtualFile child = virtualFileSystem.getRoot().getChild(vfsPath);
if (child != null) {
searcher.update(child);
}
} catch (ServerException e) {
LOG.error("Issue happened during updating modified file in index", e);
}
}
Aggregations