diff --git a/src/main/org/apache/tools/ant/taskdefs/Tar.java b/src/main/org/apache/tools/ant/taskdefs/Tar.java index 51bb8cdb6..737e68cfd 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Tar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Tar.java @@ -461,9 +461,9 @@ public class Tar extends MatchingTask { if (r instanceof TarResource) { final TarResource tr = (TarResource) r; te.setUserName(tr.getUserName()); - te.setUserId(tr.getUid()); + te.setUserId(tr.getLongUid()); te.setGroupName(tr.getGroup()); - te.setGroupId(tr.getGid()); + te.setGroupId(tr.getLongGid()); } } diff --git a/src/main/org/apache/tools/ant/types/resources/TarResource.java b/src/main/org/apache/tools/ant/types/resources/TarResource.java index 36b0e3853..1279bd860 100644 --- a/src/main/org/apache/tools/ant/types/resources/TarResource.java +++ b/src/main/org/apache/tools/ant/types/resources/TarResource.java @@ -37,8 +37,8 @@ public class TarResource extends ArchiveResource { private String userName = ""; private String groupName = ""; - private int uid; - private int gid; + private long uid; + private long gid; /** * Default constructor. @@ -134,26 +134,44 @@ public class TarResource extends ArchiveResource { /** * @return the uid for the tar entry + * @since 1.10.4 */ - public int getUid() { + public long getLongUid() { if (isReference()) { - return getCheckedRef().getUid(); + return getCheckedRef().getLongUid(); } checkEntry(); return uid; } + /** + * @return the uid for the tar entry + */ + @Deprecated + public int getUid() { + return (int) getLongUid(); + } + /** * @return the gid for the tar entry + * @since 1.10.4 */ - public int getGid() { + public long getLongGid() { if (isReference()) { - return getCheckedRef().getGid(); + return getCheckedRef().getLongGid(); } checkEntry(); return gid; } + /** + * @return the uid for the tar entry + */ + @Deprecated + public int getGid() { + return (int) getLongGid(); + } + /** * fetches information from the named entry inside the archive. */ @@ -194,8 +212,8 @@ public class TarResource extends ArchiveResource { setMode(e.getMode()); userName = e.getUserName(); groupName = e.getGroupName(); - uid = e.getUserId(); - gid = e.getGroupId(); + uid = e.getLongUserId(); + gid = e.getLongGroupId(); } }