0

How are you?

I'm working into a Java Project and my IDE is Eclipse. What's going on is that I have a Constants.java to set some paths to get into other classes, but Eclipse can't locate the file I have to find.

The code line here is on Constants.java to get a spreadsheet that is in dataDriver inside my project.

public static final String File_Path = "../../../../../../dataDriver/DataFile.xlsx";

Anybody could help me getting this file?

BackSlash
  • 21,927
  • 22
  • 96
  • 136
  • For resources included within the project (somewhere in the class path) consider this [similar question](https://stackoverflow.com/questions/1464291/how-to-really-read-text-file-from-classpath-in-java). Also, if _dataDriver_ is a package name, then follow standard naming conventions and change the name to _datadriver_. – Andrew S Sep 17 '18 at 13:34

1 Answers1

0

If the file is in your project then use this:

public static final String File_Path = "./dataDriver/DataFile.xlsx";

'.' is used for current directory and '..' is used for parent directory.

Aagam Jain
  • 1,546
  • 1
  • 10
  • 18