Browse Source

TarResource: make linkName and linkFlag accessible

master
Marc Strapetz 4 years ago
parent
commit
304b3d7136
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      src/main/org/apache/tools/ant/types/resources/TarResource.java

+ 21
- 0
src/main/org/apache/tools/ant/types/resources/TarResource.java View File

@@ -26,6 +26,7 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.tar.TarConstants;
import org.apache.tools.tar.TarEntry;
import org.apache.tools.tar.TarInputStream;

@@ -39,6 +40,8 @@ public class TarResource extends ArchiveResource {
private String groupName = "";
private long uid;
private long gid;
private byte linkFlag = TarConstants.LF_NORMAL;
private String linkName = "";

/**
* Default constructor.
@@ -172,6 +175,22 @@ public class TarResource extends ArchiveResource {
return (int) getLongGid();
}

/**
* @return the link "name" (=path) of this entry; an empty string if this is no link
* @since 1.10.10
*/
public String getLinkName() {
return linkName;
}

/**
* @return the link "flag" (=type) of this entry
* @since 1.10.10
*/
public byte getLinkFlag() {
return linkFlag;
}

/**
* fetches information from the named entry inside the archive.
*/
@@ -213,6 +232,8 @@ public class TarResource extends ArchiveResource {
groupName = e.getGroupName();
uid = e.getLongUserId();
gid = e.getLongGroupId();
linkName = e.getLinkName();
linkFlag = e.getLinkFlag();
}

}

Loading…
Cancel
Save