After selecting the text in visual mode and entering ":" you should see ": '<,'>" already printed for you. This means between the beginning and the end of your visual choice. You can add "w β ~ / Documents / Test / test.java" after ": '<,'>". What you see before entering will be:
:'<,'>w >> ~/Documents/Test/test.java
If the file does not exist or you do not have the appropriate permissions, you will receive an error message, otherwise it should say βaddedβ and work. I tested this and it works on Vim 7.2.
source share