Code example for ArrayList

Methods: add, isEmpty, size, toArray

0
	private void copyResDir() throws IOException { 
		File androidResDir = fileHelper.getTargetAndroidResDir();
		File sourceResDir = fileHelper.getResDir();
 
		FileFilter filter = null;
		List<IOFileFilter> fileFilters = new ArrayList<IOFileFilter>();
 
		if (!appDetails.isListNavigation() && !appDetails.isTabNavigation() && appDetails.isSample()) {
			// Exclude arrays.xml from the copy 
			IOFileFilter resArraysFilter = FileFilterUtils.nameFileFilter("arrays.xml");
			IOFileFilter fileFilter = FileFilterUtils.notFileFilter(resArraysFilter);
			fileFilters.add(fileFilter);
		} 
 
		if (!appDetails.isViewPager() && appDetails.isSample()) {
			// Exclude fragment_sample.xml from the copy 
			IOFileFilter resFragmentSampleFilter = FileFilterUtils.nameFileFilter("fragment_sample.xml");
			IOFileFilter fileFilter = FileFilterUtils.notFileFilter(resFragmentSampleFilter);
			fileFilters.add(fileFilter);
		} 
		 
		if (!fileFilters.isEmpty()) {
			filter = FileFilterUtils.and(fileFilters.toArray(new IOFileFilter[fileFilters.size()]));
		} 
 
		FileUtils.copyDirectory(sourceResDir, androidResDir, filter);
	}