Search in sources :

Example 1 with FileWatcherManager

use of org.eclipse.che.api.vfs.watcher.FileWatcherManager in project che by eclipse.

the class WsAgentTestBase method setUp.

public void setUp() throws Exception {
    if (workspaceHolder == null)
        workspaceHolder = new TestWorkspaceHolder();
    if (root == null)
        root = new File(FS_PATH);
    if (root.exists()) {
        IoUtil.deleteRecursive(root);
    }
    root.mkdir();
    File indexDir = new File(INDEX_PATH);
    if (indexDir.exists()) {
        IoUtil.deleteRecursive(indexDir);
    }
    indexDir.mkdir();
    Set<PathMatcher> filters = new HashSet<>();
    filters.add(path -> true);
    FSLuceneSearcherProvider sProvider = new FSLuceneSearcherProvider(indexDir, filters);
    vfsProvider = new LocalVirtualFileSystemProvider(root, sProvider);
    projectTypeRegistry = new ProjectTypeRegistry(new HashSet<>());
    projectTypeRegistry.registerProjectType(new PT1());
    projectHandlerRegistry = new ProjectHandlerRegistry(new HashSet<>());
    this.eventService = new EventService();
    projectRegistry = new ProjectRegistry(workspaceHolder, vfsProvider, projectTypeRegistry, projectHandlerRegistry, eventService);
    projectRegistry.initProjects();
    this.importerRegistry = new ProjectImporterRegistry(new HashSet<>());
    fileWatcherNotificationHandler = new DefaultFileWatcherNotificationHandler(vfsProvider);
    fileTreeWatcher = new FileTreeWatcher(root, new HashSet<>(), fileWatcherNotificationHandler);
    fileWatcherManager = mock(FileWatcherManager.class);
    TestWorkspaceHolder wsHolder = new TestWorkspaceHolder();
    pm = new ProjectManager(vfsProvider, projectTypeRegistry, projectRegistry, projectHandlerRegistry, importerRegistry, fileWatcherNotificationHandler, fileTreeWatcher, wsHolder, fileWatcherManager);
    pm.initWatcher();
}
Also used : ProjectTypeRegistry(org.eclipse.che.api.project.server.type.ProjectTypeRegistry) ProjectHandlerRegistry(org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry) ProjectImporterRegistry(org.eclipse.che.api.project.server.importer.ProjectImporterRegistry) LocalVirtualFileSystemProvider(org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystemProvider) EventService(org.eclipse.che.api.core.notification.EventService) FileWatcherManager(org.eclipse.che.api.vfs.watcher.FileWatcherManager) PathMatcher(java.nio.file.PathMatcher) DefaultFileWatcherNotificationHandler(org.eclipse.che.api.vfs.impl.file.DefaultFileWatcherNotificationHandler) FileTreeWatcher(org.eclipse.che.api.vfs.impl.file.FileTreeWatcher) File(java.io.File) HashSet(java.util.HashSet) FSLuceneSearcherProvider(org.eclipse.che.api.vfs.search.impl.FSLuceneSearcherProvider)

Aggregations

File (java.io.File)1 PathMatcher (java.nio.file.PathMatcher)1 HashSet (java.util.HashSet)1 EventService (org.eclipse.che.api.core.notification.EventService)1 ProjectHandlerRegistry (org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry)1 ProjectImporterRegistry (org.eclipse.che.api.project.server.importer.ProjectImporterRegistry)1 ProjectTypeRegistry (org.eclipse.che.api.project.server.type.ProjectTypeRegistry)1 DefaultFileWatcherNotificationHandler (org.eclipse.che.api.vfs.impl.file.DefaultFileWatcherNotificationHandler)1 FileTreeWatcher (org.eclipse.che.api.vfs.impl.file.FileTreeWatcher)1 LocalVirtualFileSystemProvider (org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystemProvider)1 FSLuceneSearcherProvider (org.eclipse.che.api.vfs.search.impl.FSLuceneSearcherProvider)1 FileWatcherManager (org.eclipse.che.api.vfs.watcher.FileWatcherManager)1