replace use of deprecated getRootDirectory() method