Browse Source

factored out the FAT granularity constant into FileUtils, though I am sure it is used in many other places.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275189 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 22 years ago
parent
commit
6f50296c91
2 changed files with 14 additions and 3 deletions
  1. +2
    -3
      src/main/org/apache/tools/ant/types/selectors/MappingSelector.java
  2. +12
    -0
      src/main/org/apache/tools/ant/util/FileUtils.java

+ 2
- 3
src/main/org/apache/tools/ant/types/selectors/MappingSelector.java View File

@@ -59,6 +59,7 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.util.IdentityMapper;
import org.apache.tools.ant.util.FileNameMapper;
import org.apache.tools.ant.util.FileUtils;

import java.io.File;

@@ -78,9 +79,7 @@ public abstract class MappingSelector extends BaseSelector {
*
*/
public MappingSelector() {
if (Os.isFamily("dos")) {
granularity = 2000;
}
granularity=(int) FileUtils.newFileUtils().getFileTimestampGranularity();
}




+ 12
- 0
src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -111,6 +111,11 @@ public class FileUtils {
private static char[] escapedChar1 = 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
static {
@@ -1328,5 +1333,12 @@ public class FileUtils {
}
}

public long getFileTimestampGranularity() {
if(Os.isFamily("dos")) {
return FAT_FILE_TIMESTAMP_GRANULARITY;
} else {
return 0;
}
}
}


Loading…
Cancel
Save