org.eclipse.rse.services.clientserver.archiveutils
Class TarEntry
java.lang.Object
org.eclipse.rse.services.clientserver.archiveutils.TarEntry
-
All Implemented Interfaces:
-
Cloneable
-
public class TarEntry
- extends
Object
- implements
Cloneable
This class represents a tar file entry.
-
Since:
- 3.0
Constructor Summary
|
TarEntry
(
String name)
Creates a new tar entry with the specified name. |
name
public byte[] name
mode
public byte[] mode
uid
public byte[] uid
gid
public byte[] gid
size
public byte[] size
mtime
public byte[] mtime
chksum
public byte[] chksum
typeflag
public byte typeflag
linkname
public byte[] linkname
magic
public byte[] magic
version
public byte[] version
uname
public byte[] uname
gname
public byte[] gname
devmajor
public byte[] devmajor
devminor
public byte[] devminor
prefix
public byte[] prefix
TarEntry
public TarEntry(
String name)
- Creates a new tar entry with the specified name. Use the setter methods to
populate the other fields of the entry.
-
Parameters:
-
name
- the name of the tar entry.
-
Throws:
-
NullPointerException
- if the name is null
.
-
IllegalArgumentException
- if the length of the name is greater that
setName
public void setName(
String fileName)
- Sets the name of the tar entry.
-
-
-
Parameters:
-
fileName
- the name for the tar entry.
-
Throws:
-
NullPointerException
- if the name is null
.
getName
public
String getName()
- Gets the name.
-
-
-
Returns:
- the name.
setUserMode
public void setUserMode(boolean canRead,
boolean canWrite,
boolean canExecute)
- Sets the user mod.
-
-
-
Parameters:
-
canRead
- true
if the user has read permission, false
otherwise. -
canWrite
- true
if the user has write permission, false
otherwise. -
canExecute
- true
if the user has execute permission, false
otherwise.
getMode
public
String getMode()
- Gets the mode in octal.
-
-
-
Returns:
- the mode.
getUID
public
String getUID()
- Gets the uid in octal.
-
-
-
Returns:
- the uid.
getGID
public
String getGID()
- Gets the gid in octal.
-
-
-
Returns:
- the gid.
setSize
public void setSize(long fileSize)
- Sets the file size in bytes.
-
-
-
Parameters:
-
fileSize
- the file size.
getSize
public long getSize()
- Gets the size in bytes.
-
-
-
Returns:
- the size.
setModificationTime
public void setModificationTime(long modTime)
- Sets the modification time.
-
-
-
Parameters:
-
modTime
- the modification time, in milliseconds since 00:00:00 GMT, January 1, 1970.
getModificationTime
public long getModificationTime()
- Gets the modification time, in milliseconds since 00:00:00 GMT, January 1, 1970.
-
-
-
Returns:
- the modification time.
getChecksum
public long getChecksum()
- Gets the checksum.
-
-
-
Returns:
- the checksum.
getTypeFlag
public char getTypeFlag()
- Gets the type of file archived.
-
-
-
Returns:
- the type flag.
getLinkName
public
String getLinkName()
- Gets the link name.
-
-
-
Returns:
- the link name.
getMagic
public
String getMagic()
- Returns whether the archive was output in the P1003 archive format.
This is not used.
-
-
-
Returns:
- the magic field.
getVersion
public
String getVersion()
- Gets the version in octal.
-
-
-
Returns:
- the version.
setUserName
public void setUserName(
String userName)
- Sets the user name of the tar entry.
-
-
-
Parameters:
-
userName
- the user name for the tar entry.
-
Throws:
-
NullPointerException
- if the user name is null
.
getUserName
public
String getUserName()
- Gets the user name.
-
-
-
Returns:
- the user name.
getGroupName
public
String getGroupName()
- Gets the group name.
-
-
-
Returns:
- the group name.
getDevMajor
public
String getDevMajor()
- Gets the major device number in octal.
-
-
-
Returns:
- the major device number.
getDevMinor
public
String getDevMinor()
- Gets the minor device number in octal.
-
-
-
Returns:
- the minor device number.
getPrefix
public
String getPrefix()
- Gets the prefix in octal.
-
-
-
Returns:
- the prefix.
isDirectory
public boolean isDirectory()
- Returns whether the entry represents a directory.
-
-
-
Returns:
-
true
if the entry represents a directory, false
otherwise.
writeFields
public void writeFields(
OutputStream outStream)
throws
IOException
- Write the fields to the given output stream.
-
-
-
Parameters:
-
outStream
- the output stream to write to.
-
Throws:
-
IOException
calculateChecksum
public void calculateChecksum()
- Calculates the checksum of the entry.
-
-
clone
public
Object clone()
throws
CloneNotSupportedException
-
-
Overrides:
-
clone
in class
Object
-
-
Throws:
-
CloneNotSupportedException
-
See Also:
-
Object.clone()
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.