File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
test/jdk/sun/net/www/protocol/file Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2525 * @test
2626 * @bug 4474391
2727 * @summary url: file:///D|/Projects/tmp/test.html: urlConnection.getInputStream() broken.
28+ * @requires os.family == "windows"
2829 */
2930import java .io .*;
3031import java .net .*;
@@ -33,10 +34,7 @@ public class FileURLTest {
3334
3435 public static void main (String [] args )
3536 {
36- String name = System .getProperty ("os.name" );
37- if (name .startsWith ("Windows" )) {
3837 String urlStr = "file:///C|/nonexisted.txt" ;
39-
4038 try {
4139 URL url = new URL (urlStr );
4240 URLConnection urlConnection = url .openConnection ();
@@ -49,6 +47,5 @@ public static void main(String [] args)
4947 throw new RuntimeException ("Can't handle '|' in place of ':' in file urls" );
5048 }
5149 }
52- }
5350 }
5451}
You can’t perform that action at this time.
0 commit comments