本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}