/**
* 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)
最新推荐文章于 2023-03-07 09:01:01 发布