Here's a quick example of the method Tom mentions.
Step 1. Set your Brush Tool to the right brush, width, and color you would like to use for the stroke.
Step 2. CREATE A NEW LAYER. Select your Pen Tool. Set to 'path'. Create a path line to the shape you desire.
(note: I'm showing this away from the edge for demo only)
Step 3. Right click and choose 'stroke path'.
Step 4. Set the tool option to brush and click OK.
Should look like this........
Step 5. Use your Pen Tool and create a selection at the ends of the stroke. After creating the path, right click and choose 'make a selection'.
Then hit delete.
Hit Cmd/Cntrl + D to deselect.
Repeat step 5 for the bottom of the stroke. (note: You can use other tools for step 5 as well as a mask)