comparison src/org/tmatesoft/hg/util/RegularFileInfo.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 909306e412e2
comparison
equal deleted inserted replaced
424:6437d261048a 425:48f993aa2f41
22 import java.io.IOException; 22 import java.io.IOException;
23 import java.nio.ByteBuffer; 23 import java.nio.ByteBuffer;
24 import java.nio.channels.ClosedChannelException; 24 import java.nio.channels.ClosedChannelException;
25 import java.nio.channels.ReadableByteChannel; 25 import java.nio.channels.ReadableByteChannel;
26 26
27 import org.tmatesoft.hg.core.SessionContext;
27 import org.tmatesoft.hg.internal.StreamLogFacility; 28 import org.tmatesoft.hg.internal.StreamLogFacility;
28 29
29 /** 30 /**
30 * 31 *
31 * @author Artem Tikhomirov 32 * @author Artem Tikhomirov
34 public class RegularFileInfo implements FileInfo { 35 public class RegularFileInfo implements FileInfo {
35 private final boolean supportsExec, supportsLink; 36 private final boolean supportsExec, supportsLink;
36 private final RegularFileStats fileFlagsHelper; // null if both supportsLink and supportExec are false 37 private final RegularFileStats fileFlagsHelper; // null if both supportsLink and supportExec are false
37 private File file; 38 private File file;
38 39
39 public RegularFileInfo() { 40 public RegularFileInfo(SessionContext ctx) {
40 this(false, false); 41 this(ctx, false, false);
41 } 42 }
42 public RegularFileInfo(boolean supportExecFlag, boolean supportSymlink) { 43 public RegularFileInfo(SessionContext ctx, boolean supportExecFlag, boolean supportSymlink) {
43 supportsLink = supportSymlink; 44 supportsLink = supportSymlink;
44 supportsExec = supportExecFlag; 45 supportsExec = supportExecFlag;
45 if (supportSymlink || supportExecFlag) { 46 if (supportSymlink || supportExecFlag) {
46 fileFlagsHelper = new RegularFileStats(); 47 fileFlagsHelper = new RegularFileStats(ctx);
47 } else { 48 } else {
48 fileFlagsHelper = null; 49 fileFlagsHelper = null;
49 } 50 }
50 } 51 }
51 52