diff src/org/tmatesoft/hg/util/FileWalker.java @ 425:48f993aa2f41

FIXMEs: exceptions, javadoc
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 28 Mar 2012 18:39:29 +0200
parents 7f27122011c3
children 613c883e360e
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/util/FileWalker.java	Wed Mar 28 15:42:15 2012 +0200
+++ b/src/org/tmatesoft/hg/util/FileWalker.java	Wed Mar 28 18:39:29 2012 +0200
@@ -20,6 +20,7 @@
 import java.util.LinkedList;
 import java.util.NoSuchElementException;
 
+import org.tmatesoft.hg.core.SessionContext;
 import org.tmatesoft.hg.internal.Internals;
 
 /**
@@ -36,11 +37,12 @@
 	private final LinkedList<File> fileQueue;
 	private final Path.Matcher scope;
 	private final boolean execCap, linkCap;
+	private final SessionContext sessionContext;
 	private RegularFileInfo nextFile;
 	private Path nextPath;
 
-	public FileWalker(File dir, Path.Source pathFactory) {
-		this(dir, pathFactory, null);
+	public FileWalker(SessionContext ctx, File dir, Path.Source pathFactory) {
+		this(ctx, dir, pathFactory, null);
 	}
 
 	/**
@@ -51,7 +53,8 @@
 	 * also whether directories shall be traversed or not (Paths it gets in {@link Path.Matcher#accept(Path)} may 
 	 * point to directories)   
 	 */
-	public FileWalker(File dir, Path.Source pathFactory, Path.Matcher scopeMatcher) {
+	public FileWalker(SessionContext ctx, File dir, Path.Source pathFactory, Path.Matcher scopeMatcher) {
+		sessionContext = ctx;
 		startDir = dir;
 		pathHelper = pathFactory;
 		dirQueue = new LinkedList<File>();
@@ -66,7 +69,7 @@
 		fileQueue.clear();
 		dirQueue.clear();
 		dirQueue.add(startDir);
-		nextFile = new RegularFileInfo(supportsExecFlag(), supportsLinkFlag());
+		nextFile = new RegularFileInfo(sessionContext, supportsExecFlag(), supportsLinkFlag());
 		nextPath = null;
 	}