java represent file path in both ways code example Example: java string to path Path path = Paths.get(textPath);