@Test public void testLoadMediaFilesBirdWithoutFiles() throws OrnidroidException { final Bird bird = this.birdFactory .createBird(1, "taxon", "", null, "bird_without_pictures", "", null, "", "", "", null, null, null); Assert.assertNull("list of pictures should be null", bird.getPictures()); this.ornidroidIOService.loadMediaFiles(TEST_DIRECTORY, bird, OrnidroidFileType.PICTURE); Assert.assertNotNull(bird.getPictures()); Assert.assertTrue(bird.getNumberOfPictures() == 0); }
public void loadMediaFiles(final String fileDirectory, final Bird bird, final OrnidroidFileType fileType) throws OrnidroidException { switch (fileType) { case PICTURE: bird.setPictures(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.PICTURE, false)); break; case AUDIO: bird.setSounds(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.AUDIO, false)); break; case WIKIPEDIA_PAGE: bird.setWikipediaPage(getLocalWikipediaPage(bird)); break; } }
OrnidroidIOServiceImpl implements IOrnidroidIOService { public void loadMediaFiles(final String fileDirectory, final Bird bird, final OrnidroidFileType fileType) throws OrnidroidException { switch (fileType) { case PICTURE: bird.setPictures(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.PICTURE, false)); break; case AUDIO: bird.setSounds(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.AUDIO, false)); break; case WIKIPEDIA_PAGE: bird.setWikipediaPage(getLocalWikipediaPage(bird)); break; } } }
OrnidroidIOServiceImpl implements IOrnidroidIOService { public void loadMediaFiles(final String fileDirectory, final Bird bird, final OrnidroidFileType fileType) throws OrnidroidException { switch (fileType) { case PICTURE: bird.setPictures(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.PICTURE, false)); break; case AUDIO: bird.setSounds(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.AUDIO, false)); break; case WIKIPEDIA_PAGE: bird.setWikipediaPage(getLocalWikipediaPage(bird)); break; } } OrnidroidIOServiceImpl(); }
OrnidroidIOServiceImpl implements IOrnidroidIOService { public void loadMediaFiles(final String fileDirectory, final Bird bird, final OrnidroidFileType fileType) throws OrnidroidException { switch (fileType) { case PICTURE: bird.setPictures(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.PICTURE, false)); break; case AUDIO: bird.setSounds(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.AUDIO, false)); break; case WIKIPEDIA_PAGE: bird.setWikipediaPage(getLocalWikipediaPage(bird)); break; } } 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 loadMediaFiles(final String fileDirectory, final Bird bird, final OrnidroidFileType fileType) throws OrnidroidException { switch (fileType) { case PICTURE: bird.setPictures(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.PICTURE, false)); break; case AUDIO: bird.setSounds(lookForOrnidroidFiles(fileDirectory, bird.getBirdDirectoryName(), OrnidroidFileType.AUDIO, false)); break; case WIKIPEDIA_PAGE: bird.setWikipediaPage(getLocalWikipediaPage(bird)); break; } } 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);  }