@Test public void testCheckOrnidroidHomeNoRightsToWrite() { final File ornidroidHome = new File(TEST_DIRECTORY); ornidroidHome.setReadOnly(); try { this.ornidroidIOService.checkOrnidroidHome(TEST_DIRECTORY); Assert.fail("an exception should have occurred"); } catch (final OrnidroidException e) { Assert.assertTrue("ok, normal exception", true); } }
public void checkOrnidroidHome(final String ornidroidHome) throws OrnidroidException { final File fileOrnidroidHome = new File(ornidroidHome); if (!fileOrnidroidHome.exists()) { checkAndCreateDirectory(fileOrnidroidHome); } checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.IMAGES_DIRECTORY)); checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.AUDIO_DIRECTORY)); }
OrnidroidIOServiceImpl implements IOrnidroidIOService { public void checkOrnidroidHome(final String ornidroidHome) throws OrnidroidException { final File fileOrnidroidHome = new File(ornidroidHome); if (!fileOrnidroidHome.exists()) { checkAndCreateDirectory(fileOrnidroidHome); } checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.IMAGES_DIRECTORY)); checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.AUDIO_DIRECTORY)); } }
OrnidroidIOServiceImpl implements IOrnidroidIOService { public void checkOrnidroidHome(final String ornidroidHome) throws OrnidroidException { final File fileOrnidroidHome = new File(ornidroidHome); if (!fileOrnidroidHome.exists()) { checkAndCreateDirectory(fileOrnidroidHome); } checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.IMAGES_DIRECTORY)); checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.AUDIO_DIRECTORY)); } OrnidroidIOServiceImpl(); }
OrnidroidIOServiceImpl implements IOrnidroidIOService { public void checkOrnidroidHome(final String ornidroidHome) throws OrnidroidException { final File fileOrnidroidHome = new File(ornidroidHome); if (!fileOrnidroidHome.exists()) { checkAndCreateDirectory(fileOrnidroidHome); } checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.IMAGES_DIRECTORY)); checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.AUDIO_DIRECTORY)); } 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); }
OrnidroidIOServiceImpl implements IOrnidroidIOService { public void checkOrnidroidHome(final String ornidroidHome) throws OrnidroidException { final File fileOrnidroidHome = new File(ornidroidHome); if (!fileOrnidroidHome.exists()) { checkAndCreateDirectory(fileOrnidroidHome); } checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.IMAGES_DIRECTORY)); checkAndCreateDirectory(new File(ornidroidHome + File.separator + BasicConstants.AUDIO_DIRECTORY)); } 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);  }