您的位置:首页 > 其它

打tar包工具TarUtil(8)

2009-11-05 14:26 232 查看
/**

* 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();

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: