打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();
}
* 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(7)
- 打tar包工具TarUtil(15)
- 打tar包工具TarUtil(9)
- 打tar包工具TarUtil(16)
- 打tar包工具TarUtil(1)
- 打tar包工具TarUtil(10)
- 打tar包工具TarUtil(2)
- 打tar包工具TarUtil(3)
- 打tar包工具TarUtil(11)
- 打tar包工具TarUtil(4)
- 打tar包工具TarUtil(12)
- 打tar包工具TarUtil(5)
- 打tar包工具TarUtil(13)
- 打tar包工具TarUtil(6)
- 打tar包工具TarUtil(14)
- 解压tar包工具UntarUtil(1)
- 解压tar包工具UntarUtil(2)
- 解压tar包工具UntarUtil(3)
- 解压tar包工具UntarUtil(4)
- 极力推荐的开发工具 anjuta+glade