(File baseDir, String subDir)
| 770 | final static int CACHE_DIR_SIZE = 32000000; |
| 771 | |
| 772 | private String createCacheDir(File baseDir, String subDir) { |
| 773 | String cacheDirName = null; |
| 774 | if (baseDir.isDirectory()) { |
| 775 | if (baseDir.canWrite()) { |
| 776 | if (subDir != null) { |
| 777 | baseDir = new File(baseDir, subDir); |
| 778 | baseDir.mkdir(); |
| 779 | } |
| 780 | if (baseDir.exists() && baseDir.canWrite()) { |
| 781 | File cacheDir = new File(baseDir, "cache"); |
| 782 | if (cacheDir.exists() || cacheDir.mkdirs()) { |
| 783 | if (cacheDir.canWrite()) { |
| 784 | cacheDirName = cacheDir.getAbsolutePath(); |
| 785 | CR3_SETTINGS_DIR_NAME = baseDir.getAbsolutePath(); |
| 786 | } |
| 787 | } |
| 788 | } |
| 789 | } else { |
| 790 | log.i(baseDir.toString() + " is read only"); |
| 791 | } |
| 792 | } else { |
| 793 | log.i(baseDir.toString() + " is not found"); |
| 794 | } |
| 795 | return cacheDirName; |
| 796 | } |
| 797 | |
| 798 | public static String getExternalSettingsDirName() { |
| 799 | return CR3_SETTINGS_DIR_NAME; |
no test coverage detected