1) There can be many ways but you can try to make a jar/zip/tar/gzip of the folder and upload that file instead of doing one by one and extract the same on the server. This will lead to an extra logic at the server.
2) You can try to upload recursively all single files included in that folder via "yourDir.listFiles()" something like:
public boolean uploadYourDir(...) {
....
File[] subFiles = yourDir.listFiles();
if (subFiles != null && subFiles.length > 0) {
for (File item : subFiles) {
//generate corresponding remote file path, write urself
String remotePath = createRemoteFilePath();
if (item.isFile()) {
//simple one
uploadSingleFile();
} else {
//create corresponding DIR name on remote
.....
//call this method itself
uploadYourDir(..);
}
.....
}
return isSuccess;
}