git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275189 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -59,6 +59,7 @@ import org.apache.tools.ant.BuildException; | |||||
| import org.apache.tools.ant.taskdefs.condition.Os; | import org.apache.tools.ant.taskdefs.condition.Os; | ||||
| import org.apache.tools.ant.util.IdentityMapper; | import org.apache.tools.ant.util.IdentityMapper; | ||||
| import org.apache.tools.ant.util.FileNameMapper; | import org.apache.tools.ant.util.FileNameMapper; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| import java.io.File; | import java.io.File; | ||||
| @@ -78,9 +79,7 @@ public abstract class MappingSelector extends BaseSelector { | |||||
| * | * | ||||
| */ | */ | ||||
| public MappingSelector() { | public MappingSelector() { | ||||
| if (Os.isFamily("dos")) { | |||||
| granularity = 2000; | |||||
| } | |||||
| granularity=(int) FileUtils.newFileUtils().getFileTimestampGranularity(); | |||||
| } | } | ||||
| @@ -111,6 +111,11 @@ public class FileUtils { | |||||
| private static char[] escapedChar1 = new char[256]; | private static char[] escapedChar1 = new char[256]; | ||||
| private static char[] escapedChar2 = new char[256]; | private static char[] escapedChar2 = new char[256]; | ||||
| /** | |||||
| * the granularity of timestamps under FAT | |||||
| */ | |||||
| public static final long FAT_FILE_TIMESTAMP_GRANULARITY=2000; | |||||
| // stolen from FilePathToURI of the Xerces-J team | // stolen from FilePathToURI of the Xerces-J team | ||||
| static { | static { | ||||
| @@ -1328,5 +1333,12 @@ public class FileUtils { | |||||
| } | } | ||||
| } | } | ||||
| public long getFileTimestampGranularity() { | |||||
| if(Os.isFamily("dos")) { | |||||
| return FAT_FILE_TIMESTAMP_GRANULARITY; | |||||
| } else { | |||||
| return 0; | |||||
| } | |||||
| } | |||||
| } | } | ||||