Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. symbolic link

Tag: symbolic link

j
java June 1, 2010 4 min read by mkyong 14 comments

How to get the filepath of a file in Java

In Java, for NIO Path, we can use path.toAbsolutePath() to get the file path; For legacy IO File, we can use file.getAbsolutePath() to get the file path. For symbolic links or file path contains . or .., we can use path.toRealPath() or file.getCanonicalPath() to get the real file pah. Below is the mapping of File […]

Read more How to get the filepath of a file in Java

Java and Spring tutorials since 2008. Every example is a complete, runnable file, compiled and run on a real machine before it goes out.

About This Site

  • About
  • Editorial Policy
  • Contact
  • Code License
  • Privacy Policy
  • Terms of Use

© 2026 mkyong.com — Powered by WordPress

RSS