Methods Summary |
---|
public java.lang.String | getGname()Returns the string name of the group id
return new String(gname).trim();
|
public java.lang.String | getLinkName()Returns the name of the file this entry is a link to,
or null if this entry is not a link.
// if (isLink())
// return null;
return new String(linkName).trim();
|
public int | getMode()Returns the UNIX-specific "mode" (type+permissions) of the entry
try {
return Integer.parseInt(new String(mode).trim(), 8) & 0777;
} catch (IllegalArgumentException e) {
return 0;
}
|
public java.lang.String | getName()Returns the name of the file this entry represents.
return new String(name).trim();
|
public int | getSize()Returns the size of the entry
try {
return Integer.parseInt(new String(size).trim(), 8);
} catch (IllegalArgumentException e) {
return 0;
}
|
public long | getTime()Returns the modification time of the entry
try {
return Long.parseLong(new String(mtime).trim(),8);
} catch (IllegalArgumentException e) {
return 0;
}
|
public java.lang.String | getTypeName()
switch(type) {
case LF_OLDNORMAL:
case LF_NORMAL:
return "file";
case LF_LINK:
return "link w/in archive";
case LF_SYMLINK:
return "symlink";
case LF_CHR:
case LF_BLK:
case LF_FIFO:
return "special file";
case LF_DIR:
return "directory";
case LF_CONTIG:
return "contig";
default:
throw new IllegalStateException("TarEntry.getTypeName: type " + type + " invalid");
}
|
public java.lang.String | getUname()Returns the string name of the userid
return new String(uname).trim();
|
public int | getgid()Returns the numeric gid of the entry
try {
return Integer.parseInt(new String(gid).trim());
} catch (IllegalArgumentException e) {
return -1;
}
|
public int | getuid()Returns the numeric userid of the entry
try {
return Integer.parseInt(new String(uid).trim());
} catch (IllegalArgumentException e) {
return -1;
}
|
boolean | isDirectory()Returns true if this entry represents a directory
return type == LF_DIR;
|
boolean | isFile()Returns true if this entry represents a file
return type == LF_NORMAL || type == LF_OLDNORMAL;
|
boolean | isLink()Returns true if this a hard link (to a file in the archive)
return type == LF_LINK;
|
boolean | isSpecial()Returns true if this entry represents some type of UNIX special file
return type == LF_CHR || type == LF_BLK || type == LF_FIFO;
|
boolean | isSymLink()Returns true if this a symbolic link
return type == LF_SYMLINK;
|
public java.lang.String | toString()
return "TarEntry[" + getName() + ']";
|