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


Java URLMapper.findFileObjects方法代码示例

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


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

示例1: getFileObjects

import org.openide.filesystems.URLMapper; //导入方法依赖的package包/类
/** Get an array of FileObjects for this url
 * @param url to wanted FileObjects
 * @return a suitable array of FileObjects, or null
 */
public FileObject[] getFileObjects(URL url) {
    String path = url.getPath();

    // remove the wrapper servlet URI
    String wrapper = httpserverSettings().getWrapperBaseURL ();
    if (path == null || !path.startsWith(wrapper))
        return null;
    path = path.substring(wrapper.length());
    
    // resource name
    if (path.startsWith ("/")) path = path.substring (1); // NOI18N
    if (path.length() == 0) {
        return new FileObject[0];
    }
    // decode path to EXTERNAL/INTERNAL type of URL
    URL u = decodeURL(path);
    if (u == null) {
        return new FileObject[0];
    }
    return URLMapper.findFileObjects(u);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:HttpServerURLMapper.java

示例2: createRefParser

import org.openide.filesystems.URLMapper; //导入方法依赖的package包/类
private TCRefParser createRefParser (String path, String name) {
    URL url;
    url = TCRefParserTest.class.getResource(path);
    assertNotNull("url not found.",url);
    
    FileObject [] foArray = URLMapper.findFileObjects(url);
    assertNotNull("Test parent folder not found. Array is null.",foArray);
    assertTrue("Test parent folder not found. Array is empty.",foArray.length > 0);
    
    FileObject parentFolder = foArray[0];
    assertNotNull("Test parent folder not found. ParentFolder is null.",parentFolder);
    
    TCRefParser tcRefParser = new TCRefParser(name);
    tcRefParser.setInLocalFolder(true);
    tcRefParser.setLocalParentFolder(parentFolder);
    
    return tcRefParser;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:TCRefParserTest.java

示例3: createWMParser

import org.openide.filesystems.URLMapper; //导入方法依赖的package包/类
private WindowManagerParser createWMParser (String path, String name) {
    URL url;
    url = WindowManagerParserTest.class.getResource(path);
    assertNotNull("url not found.",url);
    
    FileObject [] foArray = URLMapper.findFileObjects(url);
    assertNotNull("Test parent folder not found. Array is null.",foArray);
    assertTrue("Test parent folder not found. Array is empty.",foArray.length > 0);
    
    FileObject parentFolder = foArray[0];
    assertNotNull("Test parent folder not found. ParentFolder is null.",parentFolder);
    
    PersistenceManager.getDefault().setRootModuleFolder(parentFolder);
    PersistenceManager.getDefault().setRootLocalFolder(parentFolder);
    
    WindowManagerParser wmParser = new WindowManagerParser(PersistenceManager.getDefault(),name);
    
    return wmParser;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:WindowManagerParserTest.java

示例4: createGroupParser

import org.openide.filesystems.URLMapper; //导入方法依赖的package包/类
private TCGroupParser createGroupParser (String path, String name) {
    URL url;
    url = TCGroupParserTest.class.getResource(path);
    assertNotNull("url not found.",url);
    
    FileObject [] foArray = URLMapper.findFileObjects(url);
    assertNotNull("Test parent folder not found. Array is null.",foArray);
    assertTrue("Test parent folder not found. Array is empty.",foArray.length > 0);
    
    FileObject parentFolder = foArray[0];
    assertNotNull("Test parent folder not found. ParentFolder is null.",parentFolder);
    
    TCGroupParser tcGroupParser = new TCGroupParser(name);
    tcGroupParser.setInLocalFolder(true);
    tcGroupParser.setLocalParentFolder(parentFolder);
    
    return tcGroupParser;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:TCGroupParserTest.java


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