Replace deprecated FileSystem APIs