打tar包工具TarUtil(3)
来源:互联网 发布:淘宝导出数据包 编辑:程序博客网 时间:2024/05/01 09:40
List<TarFileSet> savedFileSets = (List<TarFileSet>)((ArrayList<TarFileSet>)filesets).clone();
if (baseDir != null)
{
if (!baseDir.exists())
{
throw new FileNotFoundException("basedir does not exist!");
}
// add the main fileset to the list of filesets to process.
TarFileSet mainFileSet = new TarFileSet(fileset);
mainFileSet.setDir(baseDir);
filesets.add(mainFileSet);
}
if (filesets.isEmpty())
{
throw new FileNotFoundException(
"You must supply either a basedir attribute or some nested filesets.");
}
Project project = new Project();
project.init();
this.setProject(project);
// check if tar is out of date with respect to each
// fileset
boolean upToDate = true;
Iterator<TarFileSet> elements = filesets.iterator();
while (elements.hasNext())
{
TarFileSet fs = (TarFileSet)elements.next();
String[] files = fs.getFiles(getProject());
if (!archiveIsUpToDate(files, fs.getDir(getProject())))
{
upToDate = false;
}
for (int i = 0; i < files.length; ++i)
{
if (tarFileObj.equals(new File(fs.getDir(getProject()),
files[i])))
{
throw new IOException("A tar file cannot include itself");
}
}
}
if (upToDate)
{
return;
}
TarOutputStream tOut = null;
- 打tar包工具TarUtil(3)
- 打tar包工具TarUtil(1)
- 打tar包工具TarUtil(2)
- 打tar包工具TarUtil(4)
- 打tar包工具TarUtil(5)
- 打tar包工具TarUtil(6)
- 打tar包工具TarUtil(7)
- 打tar包工具TarUtil(8)
- 打tar包工具TarUtil(9)
- 打tar包工具TarUtil(10)
- 打tar包工具TarUtil(11)
- 打tar包工具TarUtil(12)
- 打tar包工具TarUtil(13)
- 打tar包工具TarUtil(14)
- 打tar包工具TarUtil(15)
- 打tar包工具TarUtil(16)
- 解压tar包工具UntarUtil(3)
- 解压tar包工具UntarUtil(1)
- 第十三讲 基本语法练习(看看你会不会出错)
- 来CSDN了,不错!练习发表一篇笔记。
- 打tar包工具TarUtil(1)
- 打tar包工具TarUtil(2)
- 开始学习啦
- 打tar包工具TarUtil(3)
- 打tar包工具TarUtil(4)
- 打tar包工具TarUtil(5)
- 打tar包工具TarUtil(6)
- 打tar包工具TarUtil(7)
- 打tar包工具TarUtil(8)
- 打tar包工具TarUtil(9)
- 打tar包工具TarUtil(10)
- 打tar包工具TarUtil(11)