HardcodedStoragePointProvider.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Nextcloud Android client application
  3. *
  4. * @author Bartosz Przybylski
  5. * Copyright (C) 2016 Nextcloud
  6. * Copyright (C) 2016 Bartosz Przybylski
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. package com.owncloud.android.datastorage.providers;
  22. import com.owncloud.android.datastorage.StoragePoint;
  23. import java.util.Vector;
  24. /**
  25. * @author Bartosz Przybylski
  26. */
  27. public class HardcodedStoragePointProvider extends AbstractStoragePointProvider {
  28. static private final String[] sPaths = {
  29. "/mnt/external_sd/",
  30. "/mnt/extSdCard/",
  31. "/storage/extSdCard",
  32. "/storage/sdcard1/",
  33. "/storage/usbcard1/"
  34. };
  35. @Override
  36. public boolean canProvideStoragePoints() {
  37. return true;
  38. }
  39. @Override
  40. public Vector<StoragePoint> getAvailableStoragePoint() {
  41. Vector<StoragePoint> result = new Vector<>();
  42. for (String s : sPaths)
  43. if (canBeAddedToAvailableList(result, s))
  44. result.add(new StoragePoint(s, s));
  45. return result;
  46. }
  47. }