test_class.file: app/src/test/java/org/hwyl/sexytopo/control/io/UtilTest.java
test_class.identifier: UtilTest
test_case.body: @Test
      public void testGetNextAvailableNameSecond() throws Exception {
          String name = "foo";
  
          PowerMockito.spy(Util.class);
          PowerMockito.doReturn(true).when(Util.class, "doesSurveyExist", null, name + "-2");
          PowerMockito.doReturn(false).when(Util.class, "doesSurveyExist", null, name + "-3");
  
          String next = Util.getNextAvailableName(null, name);
          Assert.assertEquals("foo-3", next);
      }
test_case.class_method_signature: UtilTest.testGetNextAvailableNameSecond()
test_case.full_signature: @Test public void testGetNextAvailableNameSecond()
test_case.identifier: testGetNextAvailableNameSecond
test_case.invocations: spy when doReturn when doReturn getNextAvailableName assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetNextAvailableNameSecond()
focal_class.file: app/src/main/java/org/hwyl/sexytopo/control/io/Util.java
focal_class.identifier: Util
focal_class.class_method_signature: Util.ensureDirectoriesInPathExist(String path)
focal_class.full_signature: public static void ensureDirectoriesInPathExist(String path)
focal_class.identifier: ensureDirectoriesInPathExist
focal_class.modifiers: public static
focal_class.parameters: (String path)
focal_class.return: void
focal_class.signature: void ensureDirectoriesInPathExist(String path)
focal_class.class_method_signature: Util.ensureDirectoryExists(File directory)
focal_class.full_signature: private static void ensureDirectoryExists(File directory)
focal_class.identifier: ensureDirectoryExists
focal_class.modifiers: private static
focal_class.parameters: (File directory)
focal_class.return: void
focal_class.signature: void ensureDirectoryExists(File directory)
focal_class.class_method_signature: Util.ensureDataDirectoriesExist(Context context)
focal_class.full_signature: public static void ensureDataDirectoriesExist(Context context)
focal_class.identifier: ensureDataDirectoriesExist
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: void
focal_class.signature: void ensureDataDirectoriesExist(Context context)
focal_class.class_method_signature: Util.getSurveyDirectories(Context context)
focal_class.full_signature: public static File[] getSurveyDirectories(Context context)
focal_class.identifier: getSurveyDirectories
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File[]
focal_class.signature: File[] getSurveyDirectories(Context context)
focal_class.class_method_signature: Util.getCalibrationFiles(Context context)
focal_class.full_signature: public static File[] getCalibrationFiles(Context context)
focal_class.identifier: getCalibrationFiles
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File[]
focal_class.signature: File[] getCalibrationFiles(Context context)
focal_class.class_method_signature: Util.getImportFiles(Context context)
focal_class.full_signature: public static File[] getImportFiles(Context context)
focal_class.identifier: getImportFiles
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File[]
focal_class.signature: File[] getImportFiles(Context context)
focal_class.class_method_signature: Util.getNextDefaultSurveyName(Context context)
focal_class.full_signature: public static String getNextDefaultSurveyName(Context context)
focal_class.identifier: getNextDefaultSurveyName
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: String
focal_class.signature: String getNextDefaultSurveyName(Context context)
focal_class.class_method_signature: Util.getNextDefaultSurveyName(Context context, String defaultName)
focal_class.full_signature: public static String getNextDefaultSurveyName(Context context, String defaultName)
focal_class.identifier: getNextDefaultSurveyName
focal_class.modifiers: public static
focal_class.parameters: (Context context, String defaultName)
focal_class.return: String
focal_class.signature: String getNextDefaultSurveyName(Context context, String defaultName)
focal_class.class_method_signature: Util.getNextAvailableName(Context context, String basename)
focal_class.full_signature: public static String getNextAvailableName(Context context, String basename)
focal_class.identifier: getNextAvailableName
focal_class.modifiers: public static
focal_class.parameters: (Context context, String basename)
focal_class.return: String
focal_class.signature: String getNextAvailableName(Context context, String basename)
focal_class.class_method_signature: Util.getNextName(String basename)
focal_class.full_signature: public static String getNextName(String basename)
focal_class.identifier: getNextName
focal_class.modifiers: public static
focal_class.parameters: (String basename)
focal_class.return: String
focal_class.signature: String getNextName(String basename)
focal_class.class_method_signature: Util.doesSurveyExist(Context context, String name)
focal_class.full_signature: public static boolean doesSurveyExist(Context context, String name)
focal_class.identifier: doesSurveyExist
focal_class.modifiers: public static
focal_class.parameters: (Context context, String name)
focal_class.return: boolean
focal_class.signature: boolean doesSurveyExist(Context context, String name)
focal_class.class_method_signature: Util.isSurveyNameUnique(Context context, String name)
focal_class.full_signature: public static boolean isSurveyNameUnique(Context context, String name)
focal_class.identifier: isSurveyNameUnique
focal_class.modifiers: public static
focal_class.parameters: (Context context, String name)
focal_class.return: boolean
focal_class.signature: boolean isSurveyNameUnique(Context context, String name)
focal_class.class_method_signature: Util.getExistingSurveyNames(Context context)
focal_class.full_signature: private static Set<String> getExistingSurveyNames(Context context)
focal_class.identifier: getExistingSurveyNames
focal_class.modifiers: private static
focal_class.parameters: (Context context)
focal_class.return: Set<String>
focal_class.signature: Set<String> getExistingSurveyNames(Context context)
focal_class.class_method_signature: Util.getDirectoryPathForSurvey(Context context, String name)
focal_class.full_signature: public static String getDirectoryPathForSurvey(Context context, String name)
focal_class.identifier: getDirectoryPathForSurvey
focal_class.modifiers: public static
focal_class.parameters: (Context context, String name)
focal_class.return: String
focal_class.signature: String getDirectoryPathForSurvey(Context context, String name)
focal_class.class_method_signature: Util.getPathForSurveyFile(Context context, String name, String extension)
focal_class.full_signature: public static String getPathForSurveyFile(Context context, String name, String extension)
focal_class.identifier: getPathForSurveyFile
focal_class.modifiers: public static
focal_class.parameters: (Context context, String name, String extension)
focal_class.return: String
focal_class.signature: String getPathForSurveyFile(Context context, String name, String extension)
focal_class.class_method_signature: Util.getExportDirectoryPath(Context context, String exportFormat, String name)
focal_class.full_signature: public static String getExportDirectoryPath(Context context, String exportFormat, String name)
focal_class.identifier: getExportDirectoryPath
focal_class.modifiers: public static
focal_class.parameters: (Context context, String exportFormat, String name)
focal_class.return: String
focal_class.signature: String getExportDirectoryPath(Context context, String exportFormat, String name)
focal_class.class_method_signature: Util.deleteSurvey(Context context, String name)
focal_class.full_signature: public static void deleteSurvey(Context context, String name)
focal_class.identifier: deleteSurvey
focal_class.modifiers: public static
focal_class.parameters: (Context context, String name)
focal_class.return: void
focal_class.signature: void deleteSurvey(Context context, String name)
focal_class.class_method_signature: Util.deleteFileAndAnyContents(File file)
focal_class.full_signature: private static void deleteFileAndAnyContents(File file)
focal_class.identifier: deleteFileAndAnyContents
focal_class.modifiers: private static
focal_class.parameters: (File file)
focal_class.return: void
focal_class.signature: void deleteFileAndAnyContents(File file)
focal_class.class_method_signature: Util.doesFileExist(String path)
focal_class.full_signature: public static boolean doesFileExist(String path)
focal_class.identifier: doesFileExist
focal_class.modifiers: public static
focal_class.parameters: (String path)
focal_class.return: boolean
focal_class.signature: boolean doesFileExist(String path)
focal_class.class_method_signature: Util.getImportSourceDirectoryPath(Context context, Survey survey)
focal_class.full_signature: public static String getImportSourceDirectoryPath(Context context, Survey survey)
focal_class.identifier: getImportSourceDirectoryPath
focal_class.modifiers: public static
focal_class.parameters: (Context context, Survey survey)
focal_class.return: String
focal_class.signature: String getImportSourceDirectoryPath(Context context, Survey survey)
focal_class.class_method_signature: Util.wasSurveyImported(Context context, Survey survey)
focal_class.full_signature: public static boolean wasSurveyImported(Context context, Survey survey)
focal_class.identifier: wasSurveyImported
focal_class.modifiers: public static
focal_class.parameters: (Context context, Survey survey)
focal_class.return: boolean
focal_class.signature: boolean wasSurveyImported(Context context, Survey survey)
focal_class.class_method_signature: Util.getFileSurveyWasImportedFrom(Context context, Survey survey)
focal_class.full_signature: public static File getFileSurveyWasImportedFrom(Context context, Survey survey)
focal_class.identifier: getFileSurveyWasImportedFrom
focal_class.modifiers: public static
focal_class.parameters: (Context context, Survey survey)
focal_class.return: File
focal_class.signature: File getFileSurveyWasImportedFrom(Context context, Survey survey)
focal_class.class_method_signature: Util.doWeHavePermissionToWriteToExternalStorage(Context context)
focal_class.full_signature: public static boolean doWeHavePermissionToWriteToExternalStorage(Context context)
focal_class.identifier: doWeHavePermissionToWriteToExternalStorage
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: boolean
focal_class.signature: boolean doWeHavePermissionToWriteToExternalStorage(Context context)
focal_class.class_method_signature: Util.isExternalStorageMounted()
focal_class.full_signature: public static boolean isExternalStorageMounted()
focal_class.identifier: isExternalStorageMounted
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isExternalStorageMounted()
focal_class.class_method_signature: Util.isExternalStorageWriteable(Context context)
focal_class.full_signature: public static boolean isExternalStorageWriteable(Context context)
focal_class.identifier: isExternalStorageWriteable
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: boolean
focal_class.signature: boolean isExternalStorageWriteable(Context context)
focal_class.class_method_signature: Util.isExternalStorageReadable()
focal_class.full_signature: public static boolean isExternalStorageReadable()
focal_class.identifier: isExternalStorageReadable
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isExternalStorageReadable()
focal_class.class_method_signature: Util.getDocumentRoot(Context context)
focal_class.full_signature: public static File getDocumentRoot(Context context)
focal_class.identifier: getDocumentRoot
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File
focal_class.signature: File getDocumentRoot(Context context)
focal_class.class_method_signature: Util.getInternalDirectory(Context context)
focal_class.full_signature: public static File getInternalDirectory(Context context)
focal_class.identifier: getInternalDirectory
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File
focal_class.signature: File getInternalDirectory(Context context)
focal_class.class_method_signature: Util.getExternalDirectory()
focal_class.full_signature: public static File getExternalDirectory()
focal_class.identifier: getExternalDirectory
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File getExternalDirectory()
focal_class.class_method_signature: Util.getSurveyDirectory(Context context)
focal_class.full_signature: public static File getSurveyDirectory(Context context)
focal_class.identifier: getSurveyDirectory
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File
focal_class.signature: File getSurveyDirectory(Context context)
focal_class.class_method_signature: Util.getImportDir(Context context)
focal_class.full_signature: public static File getImportDir(Context context)
focal_class.identifier: getImportDir
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File
focal_class.signature: File getImportDir(Context context)
focal_class.class_method_signature: Util.getExportDirectory(Context context)
focal_class.full_signature: public static File getExportDirectory(Context context)
focal_class.identifier: getExportDirectory
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File
focal_class.signature: File getExportDirectory(Context context)
focal_class.class_method_signature: Util.getLogDirectory(Context context)
focal_class.full_signature: public static File getLogDirectory(Context context)
focal_class.identifier: getLogDirectory
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File
focal_class.signature: File getLogDirectory(Context context)
focal_class.class_method_signature: Util.getCalibrationDirectory(Context context)
focal_class.full_signature: public static File getCalibrationDirectory(Context context)
focal_class.identifier: getCalibrationDirectory
focal_class.modifiers: public static
focal_class.parameters: (Context context)
focal_class.return: File
focal_class.signature: File getCalibrationDirectory(Context context)
focal_class.class_method_signature: Util.getAutosaveName(String filename)
focal_class.full_signature: public static String getAutosaveName(String filename)
focal_class.identifier: getAutosaveName
focal_class.modifiers: public static
focal_class.parameters: (String filename)
focal_class.return: String
focal_class.signature: String getAutosaveName(String filename)
focal_class.class_method_signature: Util.toMap(JSONObject object)
focal_class.full_signature: public static Map<String, JSONArray> toMap(JSONObject object)
focal_class.identifier: toMap
focal_class.modifiers: public static
focal_class.parameters: (JSONObject object)
focal_class.return: Map<String, JSONArray>
focal_class.signature: Map<String, JSONArray> toMap(JSONObject object)
focal_class.class_method_signature: Util.toList(JSONArray array)
focal_class.full_signature: public static List<JSONObject> toList(JSONArray array)
focal_class.identifier: toList
focal_class.modifiers: public static
focal_class.parameters: (JSONArray array)
focal_class.return: List<JSONObject>
focal_class.signature: List<JSONObject> toList(JSONArray array)
focal_class.class_method_signature: Util.toListOfStrings(JSONArray array)
focal_class.full_signature: public static List<String> toListOfStrings(JSONArray array)
focal_class.identifier: toListOfStrings
focal_class.modifiers: public static
focal_class.parameters: (JSONArray array)
focal_class.return: List<String>
focal_class.signature: List<String> toListOfStrings(JSONArray array)
focal_class.class_method_signature: Util.getPath(File directory, String filename)
focal_class.full_signature: public static String getPath(File directory, String filename)
focal_class.identifier: getPath
focal_class.modifiers: public static
focal_class.parameters: (File directory, String filename)
focal_class.return: String
focal_class.signature: String getPath(File directory, String filename)
focal_method.body: public static String getNextAvailableName(Context context, String basename) {
          String name = basename;
          do {
              name = getNextName(name);
          } while (doesSurveyExist(context, name));
          return  name;
      }
focal_method.class_method_signature: Util.getNextAvailableName(Context context, String basename)
focal_method.full_signature: public static String getNextAvailableName(Context context, String basename)
focal_method.identifier: getNextAvailableName
focal_method.invocations: getNextName doesSurveyExist
focal_method.modifiers: public static
focal_method.parameters: (Context context, String basename)
focal_method.return: String
focal_method.signature: String getNextAvailableName(Context context, String basename)