else
{
te.setMode(tarFileSet.getDirMode());
}
te.setUserName(tarFileSet.getUserName());
te.setGroupName(tarFileSet.getGroup());
te.setUserId(tarFileSet.getUid());
te.setGroupId(tarFileSet.getGid());
tOut.putNextEntry(te);
if (!file.isDirectory())
{
fIn = new FileInputStream(file);
final int byteSize = 8192;
byte[] buffer = new byte[byteSize];
int count = 0;
do
{
tOut.write(buffer, 0, count);
count = fIn.read(buffer, 0, buffer.length);
} while (count != -1);
}
tOut.closeEntry();
}
finally
{
if (fIn != null)
{
fIn.close();
}
}
}
/**
* Is the archive up to date in relationship to a list of files.
* @param files the files to check
* @return true if the archive is up to date.
* @deprecated use the two-arg version instead.
*/
protected boolean archiveIsUpToDate(String[] files)
{
return archiveIsUpToDate(files, baseDir);
}
打tar包工具TarUtil(7)
最新推荐文章于 2016-08-05 17:56:00 发布
