Package
|
|------src/main/java
|------resources
|---- config.properties
In pom.xml, I have set resoucres directory as follows
<resources>
<resource>
<directory>resources</directory>
</resource>
</resources>
I'm able to get the absolute path of the file. But When I try to read or check whether it is a file or directory, it is return false.
sample.java
File configFile = new File("config.properties");
System.out.println("PATH="+newFile.getAbsolutePath());
System.out.println("IsFile="+newFile.isFile());
System.out.println("CanRead="+configFile.canRead());
Output
PATH=D:\JCB\MyWorkSpace_LunaJEE\MessageProcessor\config.properties
IsFile=false
CanRead=false
Any help will be appreciated.