JDK-4120784 : java.net.UnknownServiceException: file protocol doesn't support output
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1998-03-18
  • Updated: 2001-10-12
  • Resolved: 2001-10-12
Related Reports
Duplicate :  
Description
The following testcase fails in sameJVM/otherJVM on Solaris.

The 'file' protocol doesn't support output so the following two testcases

javax/activation/URLDataSource/getInputStream_Test.java
javax/activation/URLDataSource/getOutputStream_Test.java

fail at line 81 in the testcase sources.

RUNTIME OUTPUT:
--------------
java.net.UnknownServiceException: protocol doesn't support output
        at java.net.URLConnection.getOutputStream(URLConnection.java)
        at javax.activation.URLDataSource.getOutputStream(URLDataSource.java:115)
        at javasoft.sqe.tests.api.javax.activation.URLDataSource.getInputStream_Test.testIO(getInputStream_Test.java:81)
        at javasoft.sqe.tests.api.javax.activation.URLDataSource.getInputStream_Test.getInputStreamTest1(getInputStream_Test.java:51)
        at javasoft.sqe.jck.lib.MultiTest.run(MultiTest.java:158)
        at javasoft.sqe.harness.lib.ExecJCKTestSameJVMCmd.executeStandardTest(ExecJCKTestSameJVMCmd.java:116)


The same thing occurs for getOutputStream_Test.java

-Kuldip

Comments
EVALUATION This is really an RFE for java.net. The Java(tm) Platform does not support writing to file URLs. ---- This will not be supported in 1.2, which is feature frozen at this time. benjamin.renaud@Eng 1998-05-06
06-05-1998

WORK AROUND Make a new File object, using the idiom: new File(url.getFile()) and write to it. benjamin.renaud@Eng 1998-05-06
06-05-1998