Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2179774 | 5.0-pool | Unassigned | P4 | Closed | Won't Fix | |
JDK-2179776 | 1.4-pool | Unassigned | P4 | Closed | Won't Fix |
Name: nt126004 Date: 07/31/2002
FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
Service Pack 2
A DESCRIPTION OF THE PROBLEM :
Calling URI.normalize() on a URI that was derived from a
file that is a UNC will ruin the URI.
I understand that URI.normalize() follows RFC 2396, and I have no problem with
that. I guess the issue is that File.toURI() creates a URI that may not
conform to the spec. If I do not normalize the URI I can use the URI to
create a File object later that correctly points to the UNC and I can access
it. Once normalize() has been called, and I want to call it to be sure
I have unique URIs for unique files, the File I construct from the URI will
no longer be able to access the UNC file.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the test program.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Start File: \\S840700\pub\request.asp
Start URI: file:////S840700/pub/request.asp
After normalization.
Result URI: file:/S840700/pub/request.asp
Result File: \S840700\pub\request.asp
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import java.net.URI;
public class TestFile {
public static final void main( String[] aaParamters ) {
File oStartFile = new File( "\\\\S840700\\pub\\request.asp" );
URI oStartURI = oStartFile.toURI();
String sStartString = oStartURI.toString();
System.out.println( "Start File: " + oStartFile );
System.out.println( "Start URI: " + oStartURI );
URI oURI = oStartURI.normalize();
File oFile = new File( oURI );
System.out.println( "After normalization." );
System.out.println( "Result URI: " + oURI );
System.out.println( "Result File: " + oFile );
}
}
---------- END SOURCE ----------
(Review ID: 159930)
======================================================================
###@###.### 10/13/04 06:29 GMT
FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
Service Pack 2
A DESCRIPTION OF THE PROBLEM :
Calling URI.normalize() on a URI that was derived from a
file that is a UNC will ruin the URI.
I understand that URI.normalize() follows RFC 2396, and I have no problem with
that. I guess the issue is that File.toURI() creates a URI that may not
conform to the spec. If I do not normalize the URI I can use the URI to
create a File object later that correctly points to the UNC and I can access
it. Once normalize() has been called, and I want to call it to be sure
I have unique URIs for unique files, the File I construct from the URI will
no longer be able to access the UNC file.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the test program.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Start File: \\S840700\pub\request.asp
Start URI: file:////S840700/pub/request.asp
After normalization.
Result URI: file:/S840700/pub/request.asp
Result File: \S840700\pub\request.asp
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import java.net.URI;
public class TestFile {
public static final void main( String[] aaParamters ) {
File oStartFile = new File( "\\\\S840700\\pub\\request.asp" );
URI oStartURI = oStartFile.toURI();
String sStartString = oStartURI.toString();
System.out.println( "Start File: " + oStartFile );
System.out.println( "Start URI: " + oStartURI );
URI oURI = oStartURI.normalize();
File oFile = new File( oURI );
System.out.println( "After normalization." );
System.out.println( "Result URI: " + oURI );
System.out.println( "Result File: " + oFile );
}
}
---------- END SOURCE ----------
(Review ID: 159930)
======================================================================
###@###.### 10/13/04 06:29 GMT
- backported by
-
JDK-2179774 URI.normalize() ruins URI built from UNC File
-
- Closed
-
-
JDK-2179776 URI.normalize() ruins URI built from UNC File
-
- Closed
-
- duplicates
-
JDK-4722752 spec for URI.normalize doesn't specify how empty segments are handled
-
- Closed
-
- relates to
-
JDK-5086147 File,URI,URL conversions are strange for UNC path
-
- Resolved
-
-
JDK-6916645 FileObject.toUri produces unusable URI for UNC paths
-
- Closed
-