您的位置:首页 > 其它

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

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