+ /**
+ * Update the upload path checking that it is a correct path
+ * @param uploadPath: path write by user
+ * @return String: uploadPath
+ */
+ private String updateUploadPath(String uploadPath) {
+ String uploadPathInitialSlash = "/";
+ if (uploadPath.isEmpty()) {
+ uploadPath = getString(R.string.instant_upload_path);
+ } else if (!uploadPath.startsWith(uploadPathInitialSlash)) {
+ uploadPath = uploadPathInitialSlash.concat(uploadPath);
+ }
+ return uploadPath;
+ }
+
+ /**
+ * Load upload path set on preferences
+ */
+ private void loadUploadPath() {
+ SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ mUploadPath = appPrefs.getString("instant_upload_path", getString(R.string.instant_upload_path));
+ }