added method getDirname and static methods filename and dirname