Off the bat, your code contains no comments. Comments are useful to know what the code does.
Your code is very ambiguous. What is
String thing; // a username?or... it behooves you to name this more descriptively.
setLocation()I notice it sets the subdirectory. You can make this more specific.
URLEncoder.encodeis marked as deprecated in Netbeans 8. You'll probably want to look into a more forward-compatible alternative:public static String encode(String s, String enc);Strings are hardcoded all over. It's much easier to maintain code when you put all of those type of things in one place.
You are eating your errors. This is very bad. Errors tell you what is going wrong. When you eat errors you summon the wrath of the Gods; and you will never know when your code isn't working.