Эх сурвалжийг харах

rebased
create parent folder if needed
fix line breaks

Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>

tobiaskaminsky 7 жил өмнө
parent
commit
544c4723b9

+ 3 - 1
src/gplay/java/com/owncloud/android/utils/PushUtils.java

@@ -322,7 +322,9 @@ public class PushUtils {
         FileOutputStream keyFileOutputStream = null;
         try {
             if (!new File(path).exists()) {
-                new File(path).createNewFile();
+                File newFile = new File(path);
+                newFile.getParentFile().mkdirs();
+                newFile.createNewFile();
             }
             keyFileOutputStream = new FileOutputStream(path);
             keyFileOutputStream.write(encoded);

+ 3 - 4
src/main/java/com/owncloud/android/MainApp.java

@@ -221,9 +221,7 @@ public class MainApp extends MultiDexApplication {
             String storagePath = appPrefs.getString(Preferences.PreferenceKeys.STORAGE_PATH, "");
             if (TextUtils.isEmpty(storagePath)) {
                 if (appPrefs.getInt(WhatsNewActivity.KEY_LAST_SEEN_VERSION_CODE, 0) != 0) {
-                /*
-                    We already used the app, but no storage is set - fix that! :)
-                 */
+                    // We already used the app, but no storage is set - fix that!
                     appPrefs.edit().putString(Preferences.PreferenceKeys.STORAGE_PATH,
                             Environment.getExternalStorageDirectory().getAbsolutePath()).commit();
                     appPrefs.edit().remove(PreferenceManager.PREF__KEYS_MIGRATION).commit();
@@ -271,7 +269,8 @@ public class MainApp extends MultiDexApplication {
         updateAutoUploadEntries();
 
         if (getAppContext() != null) {
-            if (PermissionUtil.checkSelfPermission(getAppContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
+            if (PermissionUtil.checkSelfPermission(getAppContext(),
+                    Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
                 splitOutAutoUploadEntries();
             } else {
                 PreferenceManager.setAutoUploadSplitEntries(getAppContext(), true);

+ 2 - 1
src/main/java/com/owncloud/android/datastorage/providers/EnvironmentStoragePointProvider.java

@@ -53,7 +53,8 @@ public class EnvironmentStoragePointProvider extends AbstractStoragePointProvide
         if (env != null) {
             for (String p : env.split(":")) {
                 if (canBeAddedToAvailableList(result, p)) {
-                    result.add(new StoragePoint(p, p, StoragePoint.StorageType.EXTERNAL, StoragePoint.PrivacyType.PUBLIC));
+                    result.add(new StoragePoint(p, p, StoragePoint.StorageType.EXTERNAL,
+                            StoragePoint.PrivacyType.PUBLIC));
                 }
             }
         }

+ 2 - 1
src/main/java/com/owncloud/android/datastorage/providers/VDCStoragePointProvider.java

@@ -65,7 +65,8 @@ public class VDCStoragePointProvider extends AbstractCommandLineStoragePoint {
                 final String path = vdcLine[2];
 
                 if (canBeAddedToAvailableList(result, path)) {
-                    result.add(new StoragePoint(description, path, StoragePoint.StorageType.EXTERNAL, StoragePoint.PrivacyType.PRIVATE));
+                    result.add(new StoragePoint(description, path, StoragePoint.StorageType.EXTERNAL,
+                            StoragePoint.PrivacyType.PRIVATE));
                 }
 
             } catch (NumberFormatException e) {