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

Recent Posts

  • Java Compact Source File: No Class, No Static Main
  • Java Scoped Values Example
  • Spring Boot RAG Example with Spring AI
  • Java AtomicInteger Example
  • Java Virtual Threads Example
  • Spring Boot Supabase CRUD Example
  • Spring Boot REST Docs Example
  • How to Install Java on Windows (Step-by-Step Guide)

© 2008–2026 mkyong.com

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