nit: I may have named this function myself, but getAbsoluteOrRelativePath sounds unecessarely complex.
Isn't it the kind of method we usually call "resolve"?
resolve(directory, path) that returns directory + / + path if path is relative or path if absolute.