Exemple #1
0
 /**
  * Fulfill the ResourceCollection contract.
  *
  * @return number of elements as int.
  */
 public synchronized int size() {
   if (isReference()) {
     return getRef().size();
   }
   ensureDirectoryScannerSetup();
   ds.scan();
   return ds.getIncludedFilesCount() + ds.getIncludedDirsCount();
 }
Exemple #2
0
 /**
  * Fulfill the ResourceCollection contract.
  *
  * @return an Iterator of Resources.
  */
 public synchronized Iterator iterator() {
   if (isReference()) {
     return getRef().iterator();
   }
   ensureDirectoryScannerSetup();
   ds.scan();
   int fct = ds.getIncludedFilesCount();
   int dct = ds.getIncludedDirsCount();
   if (fct + dct == 0) {
     return EMPTY_ITERATOR;
   }
   FileResourceIterator result = new FileResourceIterator(getProject());
   if (fct > 0) {
     result.addFiles(ds.getIncludedFiles());
   }
   if (dct > 0) {
     result.addFiles(ds.getIncludedDirectories());
   }
   return result;
 }