encodeFilename may be a better method name. What do you think?

A little off-topic. Here you perfectly see the problem with filename and camel case. There is no rule if you should use filename or fileName. Both are "correct". But projectName seems to be the right notation. So, for me, it looks inconsistent. Nevertheless, it's nothing you have to worry about ^^