JDK-4191800 : FileURLConnection doesn't implement getOutputStream()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.0,1.1.6,1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_2.5.1,windows_2000
  • CPU: x86,sparc
  • Submitted: 1998-11-20
  • Updated: 2001-03-14
  • Resolved: 2001-03-14
Related Reports
Duplicate :  
Duplicate :  
Description

Name: jn10789			Date: 11/20/98


(Problem with both 1.1.6 and 1.2beta3)

Why doesn't
sun.net.www.protocol.file.FileURLConnection
support output to files?

The matching HTTP class does implement
getOutputStream(). Not supporting it for files
makes it impossible to use a URL transparently for
storing data which might be on a web server, FTP
server, or in the local filesystem.

Thanks,
(Review ID: 34970)
======================================================================

Comments
EVALUATION mayank.upadhyay@eng 2000-07-24 jdn@eng mentioned that our implementation of the security model might in some way depend on the FileURLConnection class being read only. This should be researched before any change is made. --------------------------------------------------------------- URLConnection.getPermission() allows applications to maintain caches of URLConnections and to check if successive codebases are allowed to re-use the connection. Currently, FileURLConnection can only be used for reading, and getPermission() always returns a FilePermission with "read" action. If we allow writing as well, then getPermission() will not know whether to return a "read" or "write" action (unless getXXXStream() has already been called). This could cause a compatibility problem with security implications. Since, java.io already provides APIs for manipulating files this change is considered to be too risky. michael.mcmahon@ireland 2001-03-14 --------------------------------------------------------------------
14-03-2001