The relative path works in in java using the . operator.
So the question is how do you know the path where the java is currently looking?
do a small experiment
File directory = new File("./");
System.out.println(directory.getAbsolutePath());
Observe the output , you will come to know the current directory where java is looking . From there , simply use the ./ operator to locate your file.
for example if the output is
G:\JAVA8Ws\MyProject\content.
and your file is present in the folder MyProject simply use
File resourceFile = new File("../myFile.txt");
Hope this helps