How to Use File Separator to construct file path in java?

How to Use File Separator to construct file path in java?
DeeKay June 10, 2012 at 11:52 pm · java.io

Many java developers might have came across the code where the developer need to use file separator for the file path or directory path. Many of them are using “/” or “\” depending upon the operating system. Using the forward or backward slash is not a good practice while coding in the java,¬†because¬†your code may…
Continue Reading »


How to Read UTF-8 Data From a File Using Java ?

How to Read UTF-8 Data From a File Using Java ?
DeeKay June 10, 2012 at 11:08 pm · java.io

Below Java Code shows how to read UTF-8 encoded data from a text file –


How to Write UTF-8 Data into a File Using Java ?

How to Write UTF-8 Data into a File Using Java ?
DeeKay June 10, 2012 at 2:22 am · java.io

Below Java Code shows how to write UTF-8 data into a file using Java –


How to get the size of a file in java?

How to get the size of a file in java?
DeeKay April 7, 2012 at 2:42 am · java.io

Below java code shows how to get the size of file in bytes –


How to get the list of file system root in java?

How to get the list of file system root in java?
DeeKay April 7, 2012 at 2:28 am · java.io

Below java code show how to get the list of file system root –  


How to get current working directory in java?

How to get current working directory in java?
DeeKay April 6, 2012 at 2:39 am · java.io

You can get current working directory using System.getProperty(“user.dir”) function. Here current working directory means the root folder of your current Java project. Below java code shows how to get current working directory of user –   References: Oracle Java Docs for System Properties


How to check if a file exists in java?

How to check if a file exists in java?
DeeKay March 19, 2012 at 1:12 am · java.io

Below Java code shows how to check if a file exists –


How to create a directories recursively in java?

How to create a directories recursively in java?
DeeKay March 8, 2012 at 1:12 am · java.io

Below java code shows how to create directories recursively –


How to change a file attribute to read only in java?

How to change a file attribute to read only in java?
DeeKay March 8, 2012 at 12:58 am · java.io

Below java code shows how to change file attribute to read only –


How to find if a pathname is a directory in java?

How to find if a pathname is a directory in java?
DeeKay March 8, 2012 at 12:24 am · java.io

Below java code shows how to find whether the specified path is directory or file –