-1

I am facing issue with absolute/relative path and org.apache.commons.io.FileUtils on Unix box.

Issue is:-

I am using cleanDirectory(..) and copyDirectory(..) of FileUtils. It works fine if I use absolute path /userName/data/feeds but gives IllegalArgumentException when I use paths like /data/feeds and data/feeds.

Please suggest any probable solution. I don't want to use absolute path in my code!!!

Waiting for comments....

sKhan
  • 7,934
  • 16
  • 51
  • 51
SPS
  • 123
  • 1
  • 2
  • 9

1 Answers1

1

/data/feeds is an absolute path too. If the file path starts with an / then it means that it starts from the root directory. data/feeds probably does not work because you execute Java in a different directory than /userName, probably you start it from /home/userName ?

MartinS
  • 2,479
  • 1
  • 13
  • 23
  • even if I use /data/feeds above mentioned code still gives IllegalArgumentException......cannot find path data/feeds – SPS Feb 23 '16 at 07:09