diff options
author | Hemant Gupta <hemantg@codeaurora.org> | 2014-01-17 18:58:27 +0530 |
---|---|---|
committer | Hemant Gupta <hemantg@codeaurora.org> | 2014-01-23 13:27:40 +0530 |
commit | d46e9a40bad85d7396c8323c4c5ba31d1403d8dd (patch) | |
tree | 194771c54b71560879cda218cf9a18c089b2c9fc /src/org/codeaurora/bluetooth/ftp | |
parent | 399fd349944f78fda39ec39c38570d6d7d386aa8 (diff) | |
download | android_packages_apps_BluetoothExt-d46e9a40bad85d7396c8323c4c5ba31d1403d8dd.tar.gz android_packages_apps_BluetoothExt-d46e9a40bad85d7396c8323c4c5ba31d1403d8dd.tar.bz2 android_packages_apps_BluetoothExt-d46e9a40bad85d7396c8323c4c5ba31d1403d8dd.zip |
FTP Server: Don't send error in case folder already exists
This patch prevents FTP Server from responding with Error in case
FTP Client request to create a folder already present on DUT. Without
this patch it was observed that FTP Spec was being violated as spec
mandates that DUT should be able to set path to new folder even if folder
exists on DUT.
Change-Id: I2300b5fa674476ae339f340a073d0287e93a7baa
CRs-Fixed: 601861
Diffstat (limited to 'src/org/codeaurora/bluetooth/ftp')
-rw-r--r-- | src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java index 4a9acd8..2fdd0cb 100644 --- a/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java +++ b/src/org/codeaurora/bluetooth/ftp/BluetoothFtpObexServer.java @@ -642,19 +642,14 @@ public class BluetoothFtpObexServer extends ServerRequestHandler { * return ResponseCodes.OBEX_HTTP_NOT_FOUND */ if ((current_path_tmp != null && current_path_tmp.length() != 0)) { - if (create) { - if (FileUtils.doesPathExist(current_path_tmp)) { - if (D) Log.d(TAG, "Folder already exists"); - return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR; - } else { + if (!FileUtils.doesPathExist(current_path_tmp)) { + if (create) { File filecreate = new File(current_path_tmp); if (filecreate != null && !filecreate.mkdir()) { Log.e(TAG, "Could not create " + tmp_path); return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR; } - } - } else { - if (!FileUtils.doesPathExist(current_path_tmp)) { + } else { Log.e(TAG, "path: " + current_path_tmp + " not found"); return ResponseCodes.OBEX_HTTP_NOT_FOUND; } |