OrnidroidIOServiceImpl implements IOrnidroidIOService { public void checkAndCreateDirectory(final File fileDirectory) throws OrnidroidException { try { if (!fileDirectory.exists()) { FileHelper.forceMkdir(fileDirectory); } final File noMediaFile = new File(fileDirectory, BasicConstants.NO_MEDIA_FILENAME); FileHelper.createEmptyFile(noMediaFile); } catch (final IOException e) { if (!BasicConstants.isJunitContext()) { Log.e(BasicConstants.LOG_TAG, e.getMessage(), e); } throw new OrnidroidException( OrnidroidError.ORNIDROID_HOME_NOT_FOUND, e); } } OrnidroidIOServiceImpl(); void addCustomMediaFile(final String birdDirectory,
			final OrnidroidFileType fileType, final String selectedFileName,
			final File selectedFile, final String comment); void checkAndCreateDirectory(final File fileDirectory); void checkOrnidroidHome(final String ornidroidHome); void downloadMediaFiles(final String mediaHomeDirectory,
			final Bird bird, final OrnidroidFileType fileType); List<String> filesToUpdate(final String mediaHomeDirectory,
			final Bird bird, final OrnidroidFileType fileType); void loadMediaFiles(final String fileDirectory, final Bird bird,
			final OrnidroidFileType fileType); void removeCustomMediaFile(final OrnidroidFile ornidroidFile); @Override void resetExistingDirectory(File directoryToReset); void downloadZipPackage(String zipname, String mediaHomeDirectory); boolean isEnoughFreeSpace(OrnidroidFileType fileType); ZipPackage getZipname(OrnidroidFileType fileType); int getZipDownloadProgressPercent(OrnidroidFileType fileType,
			int folderSizeBeforeDownload); int getInstallProgressPercent(OrnidroidFileType fileType);  }
@Test public void testCheckAndCreateDirectory() throws OrnidroidException { File testDir = new File(TEST_DIRECTORY); this.ornidroidIOService.checkAndCreateDirectory(testDir); File noMediaFile = new File(testDir, BasicConstants.NO_MEDIA_FILENAME); Assert.assertTrue(noMediaFile.exists()); testDir = new File(TEST_DIRECTORY + File.separator + "unknown_directory"); this.ornidroidIOService.checkAndCreateDirectory(testDir); noMediaFile = new File(testDir, BasicConstants.NO_MEDIA_FILENAME); Assert.assertTrue(noMediaFile.exists()); }