path = path.substring(0,path.lastIndexOf("")+1);
path.dirname("/home/workspace/filename.txt") // '/home/workspace/'