If you want a function that can parse an sh style line, with quoting, we have logic for that in Gerrit Code Review. Its Apache License 2.0 but I/Google would be willing to relicense it under EDL for use in JGit since it depends on JGit's QuotedPath code to handle the sh quoting rules anyway. :-)