JDK-4042001 : java.io.File: Add support for symbolic links
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.1.1,1.1.4,1.1.6,1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,solaris_2.5.1,solaris_2.6
  • CPU: generic,sparc
  • Submitted: 1997-03-28
  • Updated: 2000-03-10
  • Resolved: 2000-03-10
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
This is a request to add the ability to detect/create/delete symbolic links in the java.io.File class.

For example, one of our licensees would like to do:

How does one create symbolic link in java? Also how does one detect if a 
directory name is a symbolic link and get the link destination? 

I went through java.io.File class which does not seem to have any methods for 
these purposes.

In our installation program we have to do something like the following through a 
java program.

Assume that /var/opt/Xerox/MSS01 is a link to /opt/Xerox/MSS0101.

	Check to see if /var/opt/Xerox/MSS01 is a symbolic link
	If it is get the directory name it points to 
	Remove /var/opt/Xerox/MSS01 
	Create /var/opt/Xerox/MSS01 as a link to another directory 
/opt/Xerox/MSS0102

===============================================
Another report from ###@###.###:

It would be nice if Java had a concept of symbolic
link (java.io.symlink?). I believe symbolic links
are common to most major OS (aliases in Windows/Mac)
and this could be a no-op on other platforms.

It should probably be a subclass of java.io.File
and have methods to find what it is linked to.

brian.klock@eng 1997-11-20
==================================================================

Comments
EVALUATION The open RFE for JSR-203 to address this issue is 6350340.
11-04-2006

EVALUATION This issue will be addressed in the New I/O work. -- mr@eng 2000/3/9
03-08-0175