If you need to parametrize your test so different users would use different locations from the text file - you don't even need Beanshell. Take a look at __StringFromFile() function - it reads next line from the specified file each time it's being called.
If you still want to use Beanshell - just consider it Java as it's almost Java compliant. To be completely sure that your test will work - write it J2SE 1.4-way.
Be aware that if your script logic is complex and it does something "heavy" and/or if you plan to produce immense load - it's better to consider JSR223 PreProcessor and Groovy scripting language as:
- Groovy is even more Java-compliant than Beanshell
- Groovy engine performance is much higher
See Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For! guide for different scripting engines benchmarks, instructions on installation of groovy engine and scripting best practices.