`
qq123zhz
  • 浏览: 524403 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

RCP FileSystem 文件系统

 
阅读更多
public static File toLocalFile(String folderName){
		try {
			URL url = Activator.getDefault().getBundle().getEntry(folderName);
			url = FileLocator.toFileURL(url);
			IFileSystem fs = EFS.getLocalFileSystem();
			IFileStore file = fs.getStore(new Path(url.getPath()));
			IFileStore fileStore = file.getFileStore(new Path(""));
			File file2 =  fileStore.toLocalFile(EFS.NONE, null);
			 
			
			return file2;
		} catch (IOException e) {
			e.printStackTrace();
		} catch (CoreException e) {
			e.printStackTrace();
		}
		return null;
	}

 RCP在运行时环境获得jar包中的文件,开发时可以获得工程下的文件和文件夹

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics