Results 1 to 2 of 2
  1. #1
    itaipee is offline Member
    Join Date
    Dec 2008
    Rep Power

    Default ignore links when building file tree


    I'm building file system with java trees.
    I want to recognize if the file is symolic linlk - i didn't find an y methdos such as "File.isLink" - any idea how should i do it ?

    otherwise its become the running time become huge.. ( I program so it will stop if there will be loops but still it take lot of time )

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Rep Power


    From google:
    "The fix to the faulty algorithm sounds easy: Never descend into a directory via a symbolic link. Always simply delete symlinks, no matter if they reference directories or files. With that in mind, you check the API of for the isLink() method, just to find out... It does not exist! Right, the ability to identify links is missing and that has been an issue with Java for years. It is a problem, currently being worked on by JSR 203, but a solution will not be available till Java SE 7. So in the meantime, a work around is required and this means doing dirty work using JNI (Java Native Interface)."

    Here is a link:
    How to deal with filesystem softlinks/symbolic links in Java | Onyxbits

Similar Threads

  1. help to get links in html file
    By thangbomlennet in forum New To Java
    Replies: 13
    Last Post: 11-03-2012, 06:31 PM
  2. Help loading a Binary Tree from file
    By ExplosiveWeasel in forum Java 2D
    Replies: 16
    Last Post: 12-17-2008, 02:34 AM
  3. help needed regarding tree building
    By invincible_me in forum New To Java
    Replies: 2
    Last Post: 08-12-2008, 02:44 PM
  4. building file and variable names from variables
    By madad2005 in forum New To Java
    Replies: 2
    Last Post: 07-18-2007, 05:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts