/**
* Is the archive up to date in relationship to a list of files.
* @param files the files to check
* @param dir the base directory for the files.
* @return true if the archive is up to date.
* @since Ant 1.5.2
*/
protected boolean archiveIsUpToDate(String[] files, File dir)
{
SourceFileScanner sfs = new SourceFileScanner(this);
MergingMapper mm = new MergingMapper();
mm.setTo(tarFileObj.getAbsolutePath());
return sfs.restrict(files, dir, null, mm).length == 0;
}
/**
* This is a FileSet with the option to specify permissions
* and other attributes.
*/
public static class TarFileSet extends FileSet
{
private String[] files = null;
private int fileMode = UnixStat.FILE_FLAG | UnixStat.DEFAULT_FILE_PERM;
private int dirMode = UnixStat.DIR_FLAG | UnixStat.DEFAULT_DIR_PERM;
private String userName = "";
private String groupName = "";
private int uid;
private int gid;
private String prefix = "";
private String fullpath = "";
private boolean preserveLeadingSlashes = false;
/**
* Creates a new <code>TarFileSet</code> instance.
* Using a fileset as a constructor argument.
*
* @param fileset a <code>FileSet</code> value
*/
public TarFileSet(FileSet fileset)
{
super(fileset);
}
/**
* Creates a new <code>TarFileSet</code> instance.
*
*/
public TarFileSet()
{
super();
}
打tar包工具TarUtil(8)
检查归档文件更新状态
最新推荐文章于 2025-06-25 16:04:59 发布
本文介绍了一种方法来检查给定文件列表相对于存档文件的更新状态。通过使用SourceFileScanner类和MergingMapper类,可以确定存档是否是最新的。
494

被折叠的 条评论
为什么被折叠?



