maven - How to go back one directory from working directory in Java? -
i'm using code in order read file content in maven module. file stored in 1 directory working directory.
string configfilepath = system.getproperty("user.dir") + "../conf/gce-configuration.xml"; file configfile = new file(configfilepath);
then when try read file gives me file not found error.
file cannot found : /home/xxxx/bin../conf/gce-configuration.xml
i tried different ways still i'm getting error. i'm doing wrong here?
edit: seems forgot mention file name in assembly/bin.xml in maven module. xml file not include package. bad!
as want go 1 level above current dir can by
string configfilepath = new file(system.getproperty("user.dir")).getparent() + "/conf/gce-configuration.xml";
Comments
Post a Comment