8 Replies Latest reply: Nov 21, 2012 4:25 AM by 800381 RSS

    Get hard disk letter (C:\ or D:\) only from the path

    Ravi_Teja
      I have a requirement in my project to display only hard disk letter (C:\ or D:\) even when the user selects the directory/files inside the disk.
      This need to work on both Windows and MAC OS. Is there a way to achieve this in Java?

      E.g. If the user selected D:\Test\Test1 then we need to get only D:\