打tar包工具TarUtil(6)
2009-11-05 14:17
246 查看
if (vPath.startsWith("/") && !tarFileSet.isPreserveLeadingSlashes())
{
int l = vPath.length();
if (l <= 1)
{
// we would end up adding "" to the archive
return;
}
vPath = vPath.substring(1, l);
}
try
{
if (vPath.length() >= TarConstants.NAMELEN)
{
if (longFileMode.isOmitMode())
{
return;
}
else if (longFileMode.isWarnMode())
{
if (!longWarningGiven)
{
longWarningGiven = true;
}
}
else if (longFileMode.isFailMode())
{
throw new IOException("Entry: " + vPath + " longer than "
+ TarConstants.NAMELEN + "characters.");
}
}
TarEntry te = new TarEntry(vPath);
te.setModTime(file.lastModified());
if (!file.isDirectory())
{
te.setSize(file.length());
te.setMode(tarFileSet.getMode());
}
{
int l = vPath.length();
if (l <= 1)
{
// we would end up adding "" to the archive
return;
}
vPath = vPath.substring(1, l);
}
try
{
if (vPath.length() >= TarConstants.NAMELEN)
{
if (longFileMode.isOmitMode())
{
return;
}
else if (longFileMode.isWarnMode())
{
if (!longWarningGiven)
{
longWarningGiven = true;
}
}
else if (longFileMode.isFailMode())
{
throw new IOException("Entry: " + vPath + " longer than "
+ TarConstants.NAMELEN + "characters.");
}
}
TarEntry te = new TarEntry(vPath);
te.setModTime(file.lastModified());
if (!file.isDirectory())
{
te.setSize(file.length());
te.setMode(tarFileSet.getMode());
}
相关文章推荐
- 打tar包工具TarUtil(8)
- 打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(7)
- 打tar包工具TarUtil(14)
- 解压tar包工具UntarUtil(1)
- 解压tar包工具UntarUtil(2)
- 解压tar包工具UntarUtil(3)
- 解压tar包工具UntarUtil(4)
- 让敏捷工具在敏捷开发中发挥高效作用