• <small id='DgJ5t'></small><noframes id='DgJ5t'>

      1. <legend id='DgJ5t'><style id='DgJ5t'><dir id='DgJ5t'><q id='DgJ5t'></q></dir></style></legend>

        <tfoot id='DgJ5t'></tfoot>

        <i id='DgJ5t'><tr id='DgJ5t'><dt id='DgJ5t'><q id='DgJ5t'><span id='DgJ5t'><b id='DgJ5t'><form id='DgJ5t'><ins id='DgJ5t'></ins><ul id='DgJ5t'></ul><sub id='DgJ5t'></sub></form><legend id='DgJ5t'></legend><bdo id='DgJ5t'><pre id='DgJ5t'><center id='DgJ5t'></center></pre></bdo></b><th id='DgJ5t'></th></span></q></dt></tr></i><div id='DgJ5t'><tfoot id='DgJ5t'></tfoot><dl id='DgJ5t'><fieldset id='DgJ5t'></fieldset></dl></div>
          <bdo id='DgJ5t'></bdo><ul id='DgJ5t'></ul>

      2. FileLocator.resolve(url) 的转义结果

        时间:2023-08-21

        <small id='jkii3'></small><noframes id='jkii3'>

            • <i id='jkii3'><tr id='jkii3'><dt id='jkii3'><q id='jkii3'><span id='jkii3'><b id='jkii3'><form id='jkii3'><ins id='jkii3'></ins><ul id='jkii3'></ul><sub id='jkii3'></sub></form><legend id='jkii3'></legend><bdo id='jkii3'><pre id='jkii3'><center id='jkii3'></center></pre></bdo></b><th id='jkii3'></th></span></q></dt></tr></i><div id='jkii3'><tfoot id='jkii3'></tfoot><dl id='jkii3'><fieldset id='jkii3'></fieldset></dl></div>
                • <bdo id='jkii3'></bdo><ul id='jkii3'></ul>
                  <tfoot id='jkii3'></tfoot>
                  <legend id='jkii3'><style id='jkii3'><dir id='jkii3'><q id='jkii3'></q></dir></style></legend>

                    <tbody id='jkii3'></tbody>
                • 本文介绍了FileLocator.resolve(url) 的转义结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  FileLocator.resolve(url) 方法可用于将地址 bundleentry://something/somewhere/x.txt 转换为适合 <代码>/mnt/foo/somewhere/x.txt.

                  The method FileLocator.resolve(url) can be used to translate an address bundleentry://something/somewhere/x.txt to a proper file URL for /mnt/foo/somewhere/x.txt.

                  但是,这也记录在 https://bugs.eclipse.org/bugs/show_bug.cgi?id=145096,URL 没有转义.例如,如果包含引用包的 Eclipse 安装位于包含空格的目录中,则 FileLocator.resolve 返回的 URL 仍然包含空格并调用 url.toURI()因此而失败.

                  However, which is also documented at https://bugs.eclipse.org/bugs/show_bug.cgi?id=145096, the URL is not escaped. As an example, if the Eclipse installation containing the referenced bundle is in a directory containing a space, the URL returned by FileLocator.resolve still contains the space and calling url.toURI() fails because of that.

                  • 如何手动转义 URL 中的所有个必要字符?
                  • 如何根据相对于当前路径的路径获取 File 对象捆绑?
                  • How can I manually escape all necessary characters in the URL?
                  • How can I get a File object based on a path relative to the current bundle?

                  作为参考,如果该文件位于包含空格的目录中,则尝试在插件的 .jar 文件中查找目录 dir 时失败的代码如下:

                  As reference, here is the code that fails when trying to find the directory dir inside my plugin's .jar file if that file is in a directory containing a space:

                      final IPath pathOfExampleProject = new Path("dir");
                      final Bundle bundle = Platform.getBundle(AproveIDs.PLUGIN_ID);
                      final URL url = FileLocator.find(bundle, pathOfExampleProject, null);
                      final URL url2 = FileLocator.toFileURL(url);
                      url2.toURI(); // Illegal character in path at index [...]
                  

                  推荐答案

                  我刚找到这段代码:

                  http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/BundledSystemLibrary.java?r=2057

                  相关行确实有帮助:

                  // We need to use the 3-arg constructor of URI in order to properly escape file system chars.
                  URI resolvedUri = new URI(resolvedUrl.getProtocol(), resolvedUrl.getPath(), null);
                  

                  这篇关于FileLocator.resolve(url) 的转义结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                • <tfoot id='Ik672'></tfoot>

                    <small id='Ik672'></small><noframes id='Ik672'>

                      <i id='Ik672'><tr id='Ik672'><dt id='Ik672'><q id='Ik672'><span id='Ik672'><b id='Ik672'><form id='Ik672'><ins id='Ik672'></ins><ul id='Ik672'></ul><sub id='Ik672'></sub></form><legend id='Ik672'></legend><bdo id='Ik672'><pre id='Ik672'><center id='Ik672'></center></pre></bdo></b><th id='Ik672'></th></span></q></dt></tr></i><div id='Ik672'><tfoot id='Ik672'></tfoot><dl id='Ik672'><fieldset id='Ik672'></fieldset></dl></div>

                    • <legend id='Ik672'><style id='Ik672'><dir id='Ik672'><q id='Ik672'></q></dir></style></legend>

                          <bdo id='Ik672'></bdo><ul id='Ik672'></ul>

                            <tbody id='Ik672'></tbody>