[JGIT PATCH 10/22] Added class FileTreeIterable.
Signed-off-by: Florian Koeberle <florianskarten@web.de>
---
.../jgit/lib/fileiteration/FileTreeIterable.java | 48 ++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/fileiteration/FileTreeIterable.java
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/fileiteration/FileTreeIterable.java b/org.spearce.jgit/src/org/spearce/jgit/lib/fileiteration/FileTreeIterable.java
new file mode 100644
index 0000000..6922162
--- /dev/null
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/fileiteration/FileTreeIterable.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 Florian Köberle
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License, version 2, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ */
+package org.spearce.jgit.lib.fileiteration;
+
+import java.io.File;
+import java.util.Iterator;
+
+/**
+ * Use this class to iterate over some by rules determined files in a project
+ * directory.
+ *
+ * @author Florian Köberle
+ *
+ */
+class FileTreeIterable implements Iterable<File> {
+ private final File projectDirectory;
+
+ private final Rules ignoreRules;
+
+ private final boolean includeRootDirectory;
+
+ FileTreeIterable(File projectDirectory, Rules ignoreRules,
+ boolean includeRootDirectory) {
+ this.projectDirectory = projectDirectory;
+ this.ignoreRules = ignoreRules;
+ this.includeRootDirectory = includeRootDirectory;
+ }
+
+ public Iterator<File> iterator() {
+ return new FileTreeIterator(projectDirectory, ignoreRules,
+ includeRootDirectory);
+ }
+
+}
--
1.5.2.5