I'm trying to run rsync command with runtime in java. In my A.class file ``` @autowired B bclass; Public void testFileMove() { String srcPath="src/main/resources/tmp/" String destPath="src/main/resources/destTemp" ReflectionUtils.setField(bclass, "tempSrc", srcPath) ; ReflectionUtils.setField(bclass, "tempDest", destPath) ; bclass.execute(); } ``` In my B.class ``` String tempSrc; String tempDest; Public void execute() { String runtimeCmd= "rsync -avR --remove-source-files "+tempSrc+"/ "+tempDest Process process =Runtime.getRunyime.exec(runtimeCmd) ; Int exitCode=process.waitFor() ; Logger.Info(" Exit code is :"+exitCode) ; } ``` I always get **error code as 23** for above code. When i give source and destination path as full path it works well. Eg:tempSrc=/home/usr/desktop/temp tempSrc=/home/usr/desktop/destTemp I need the path to be in resources folder of project so that its not specific to system path. With resources folder it become generic to project resource folder and this helps my build in bamboo as well.
user.dir
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)