Yes, you can get it from the File
object by using File.toPath()
. Keep in mind that this is only for Java 7+. Java versions 6 and below do not have it.
Related Contents:
- How to construct a relative path in Java from two absolute paths (or URLs)?
- Check if a path represents a file or a folder
- Does Java have a path joining method? [duplicate]
- Using File.listFiles with FileNameExtensionFilter
- Convert URL to normal windows filename Java
- How to get the path of a running JAR file?
- How do I get the file extension of a file in Java?
- Standard concise way to copy a file in Java?
- How do I load a file from resource folder?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- How do I get the file name from a String containing the Absolute file path?
- In Java, how do I parse XML as a String instead of a file?
- Get keys from HashMap in Java
- How to find files that match a wildcard string in Java?
- Java NIO FileChannel versus FileOutputstream performance / usefulness
- How can I safely encode a string in Java to use as a filename?
- How to create a new java.io.File in memory? [duplicate]
- How to get absolute path to file in /resources folder of your project
- How to iterate over the files of a certain directory, in Java? [duplicate]
- How to get current working directory in Java?
- Java, List only subdirectories from a directory, not files
- Difference between getExternalFilesDir and getExternalStorageDirectory()
- Difference between java.io.PrintWriter and java.io.BufferedWriter?
- Java: splitting the filename into a base and extension
- Java’s createNewFile() – will it also create directories?
- How to check the extension of a Java 7 Path
- Create a file from a ByteArrayOutputStream
- File exists and IS directory, but listFiles() returns null
- How to convert InputStream to virtual File
- Platform independent paths in Java
- Android : How to read file in bytes?
- Get the file size in android sdk?
- Which JDK version (Language Level) is required for Android Studio?
- How do I delete files programmatically on Android?
- How should I load files into my Java application?
- Java sending and receiving file (byte[]) over sockets
- Eclipse reading stdin (System.in) from a file
- Quickly read the last line of a text file?
- How to copy file inside jar to outside the jar?
- File loading by getClass().getResource()
- Simple Java HTTPS server
- Why does Java read a big file faster than C++?
- Create intermediate folders if one doesn’t exist
- Proper way to implement RESTful large file upload
- Sort a file with huge volume of data given memory constraint
- How to use TLS 1.2 in Java 6
- Test if file exists
- Check line for unprintable characters while reading text file
- Mocking Files in Java – Mock Contents – Mockito
- Nested/Inner class in external file