当前位置: 首页>>代码示例>>Java>>正文


Java FileObject.addRecursiveListener方法代码示例

本文整理汇总了Java中org.openide.filesystems.FileObject.addRecursiveListener方法的典型用法代码示例。如果您正苦于以下问题:Java FileObject.addRecursiveListener方法的具体用法?Java FileObject.addRecursiveListener怎么用?Java FileObject.addRecursiveListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.filesystems.FileObject的用法示例。


在下文中一共展示了FileObject.addRecursiveListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.openide.filesystems.FileObject; //导入方法依赖的package包/类
void init(Project p) {
    Sources sources = ProjectUtils.getSources(p);
    sources.addChangeListener(this);
    SourceGroup[] groups = sources.getSourceGroups(Sources.TYPE_GENERIC);
    roots = new FileObject[groups.length];
    for (int i = 0; i < groups.length; i++) {
        SourceGroup group = groups[i];
        FileObject rootFolder = group.getRootFolder();
        roots[i] = rootFolder;
        rootFolder.addRecursiveListener(this);
        //scan(rootFolder);
        rootsToScan.add(rootFolder);
    }
    scanningTask = RP.post(this);
    DependencyProjectProvider prov = p.getLookup().lookup(DependencyProjectProvider.class);
    if (prov != null) {
        projectDependencyManager = new ProjectDependencyManager(prov);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:SourceMapsScanner.java

示例2: testRefreshRecursively

import org.openide.filesystems.FileObject; //导入方法依赖的package包/类
public void testRefreshRecursively() throws IOException {
    File f = new File(dataRootDir, "workdir/root-test-versioned");
    f.mkdirs();
    FileObject fo = FileUtil.toFileObject(f);
    fo = fo.createFolder("folder");
    fo.addRecursiveListener(new FileChangeAdapter());
    assertTrue(inteceptor.getRefreshRecursivelyFiles().contains(FileUtil.toFile(fo)));     
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:VCSInterceptorTest.java

示例3: testProvideExtensionsRefreshRecursively

import org.openide.filesystems.FileObject; //导入方法依赖的package包/类
public void testProvideExtensionsRefreshRecursively() throws Exception {
    File root = new File(getWorkDir(), "root");
    final File sub = new File(root, "sub");
    final File subsub = new File(sub, "subsub");
    File subsubdir = new File(subsub, "dir");
    subsubdir.mkdirs();
    File subfile = new File(sub, "file");
    subfile.createNewFile();
    File deepfile = new File(subsubdir, "deep");
    deepfile.createNewFile();

    ProvidedExtensionsTest.ProvidedExtensionsImpl.nextRefreshCall(
        sub,
        Long.MAX_VALUE - 10,
        subfile
    );


    TestFileChangeListener fcl = new TestFileChangeListener();
    FileObject rf = FileUtil.toFileObject(root);
    rf.addRecursiveListener(fcl);

    BaseFileObj noFO = FileObjectFactory.getInstance(root).getCachedOnly(subsubdir);
    assertNull("subsub directory has been skipped", noFO);

    assertEquals("No events", 0, fcl.checkAll());
    LOG.log(Level.INFO, "Touching subfile: {0}", deepfile);
    TestFileUtils.touch(deepfile, null);
    LOG.log(Level.INFO, "Will do refresh, lastModified: {0}", deepfile.lastModified());
    FileUtil.refreshFor(root);
    LOG.info("Refresh done");
    fcl.check(EventType.ATTRIBUTE_CHANGED); // ignore if any

    fcl.printAll(LOG);
    assertEquals("No other events", 0, fcl.checkAll());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:FileUtilAddRecursiveListenerTest.java

示例4: testRefreshRecursively

import org.openide.filesystems.FileObject; //导入方法依赖的package包/类
public void testRefreshRecursively() throws IOException {
    FileObject fo = getVersionedFolder();
    fo = fo.createFolder("folder");
    VCSFileProxy proxy = VCSFileProxy.createFileProxy(fo);
    logHandler.clear();
    
    fo.addRecursiveListener(new FileChangeAdapter()); 
    assertTrue(inteceptor.getRefreshRecursivelyFiles().contains(VCSFileProxy.createFileProxy(fo)));     
    
    // XXX listFiles called twice on adding the listener. is this realy necessary
    assertInterceptedCalls(
        1, 2, 
        f(listFilesFormat, proxy)
    );            
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:VCSInterceptorTestCase.java


注:本文中的org.openide.filesystems.FileObject.addRecursiveListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。