7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4797850
27 * @summary Security policy file does not grok hash mark in pathnames
28 */
29
30 import java.io.*;
31 import java.util.*;
32 import sun.security.provider.*;
33
34 public class EncodeURL {
35
36 // java.ext.dirs input and encoding
37 private static final String extInput = "foo bar";
38 private static final String extAnswer = "foo%20bar";
39 private static final String policy0 =
40 "grant codebase \"${java.ext.dirs}\" { permission java.security.AllPermission; };";
41
42 // keystore inputs and encodings
43 private static final String prop1 = "http://foobar";
44 private static final String answer1 = "http://foobar/foo";
45 private static final String policy1 =
46 "keystore \"${prop1}/foo\"; grant { permission java.security.AllPermission; };";
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4797850
27 * @modules java.base/sun.security.provider
28 * @summary Security policy file does not grok hash mark in pathnames
29 */
30
31 import java.io.*;
32 import java.util.*;
33 import sun.security.provider.*;
34
35 public class EncodeURL {
36
37 // java.ext.dirs input and encoding
38 private static final String extInput = "foo bar";
39 private static final String extAnswer = "foo%20bar";
40 private static final String policy0 =
41 "grant codebase \"${java.ext.dirs}\" { permission java.security.AllPermission; };";
42
43 // keystore inputs and encodings
44 private static final String prop1 = "http://foobar";
45 private static final String answer1 = "http://foobar/foo";
46 private static final String policy1 =
47 "keystore \"${prop1}/foo\"; grant { permission java.security.AllPermission; };";
|