Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.cpio

public Class CpioArchiveEntry

extends Object
implements CpioConstants, ArchiveEntry
Class Inheritance
All Implemented Interfaces
org.apache.commons.compress.archivers.ArchiveEntry, org.apache.commons.compress.archivers.cpio.CpioConstants
Imports
java.io.File, .IOException, java.nio.charset.Charset, java.nio.file.Files, .LinkOption, .Path, java.nio.file.attribute.FileTime, java.util.Date, .Objects, org.apache.commons.compress.archivers.ArchiveEntry, org.apache.commons.compress.utils.ExactMath, .TimeUtils

A cpio archive consists of a sequence of files. There are several types of headers defined in two categories of new and old format. The headers are recognized by magic numbers:

The old binary format is limited to 16 bits for user id, group id, device, and inode numbers. It is limited to 4 gigabyte file sizes. The old ASCII format is limited to 18 bits for the user id, group id, device, and inode numbers. It is limited to 8 gigabyte file sizes. The new ASCII format is limited to 4 gigabyte file sizes. CPIO 2.5 knows also about tar, but it is not recognized here.

OLD FORMAT

Each file has a 76 (ascii) / 26 (binary) byte header, a variable length, NUL terminated file name, and variable length file data. A header for a file name "TRAILER!!!" indicates the end of the archive.

All the fields in the header are ISO 646 (approximately ASCII) strings of octal numbers, left padded, not NUL terminated.

FIELDNAME        NOTES
c_magic          The integer value octal 070707.  This value can be used to deter-
                 mine whether this archive is written with little-endian or big-
                 endian integers.
c_dev            Device that contains a directory entry for this file
c_ino            I-node number that identifies the input file to the file system
c_mode           The mode specifies both the regular permissions and the file type.
c_uid            Numeric User ID of the owner of the input file
c_gid            Numeric Group ID of the owner of the input file
c_nlink          Number of links that are connected to the input file
c_rdev           For block special and character special entries, this field
                 contains the associated device number.  For all other entry types,
                 it should be set to zero by writers and ignored by readers.
c_mtime[2]       Modification time of the file, indicated as the number of seconds
                 since the start of the epoch, 00:00:00 UTC January 1, 1970.  The
                 four-byte integer is stored with the most-significant 16 bits
                 first followed by the least-significant 16 bits.  Each of the two
                 16 bit values are stored in machine-native byte order.
c_namesize       Length of the path name, including the terminating null byte
c_filesize[2]    Length of the file in bytes. This is the length of the data
                 section that follows the header structure. Must be 0 for
                 FIFOs and directories

All fields are unsigned short fields with 16-bit integer values
apart from c_mtime and c_filesize which are 32-bit integer values

If necessary, the file name and file data are padded with a NUL byte to an even length

Special files, directories, and the trailer are recorded with the h_filesize field equal to 0.

In the ASCII version of this format, the 16-bit entries are represented as 6-byte octal numbers, and the 32-bit entries are represented as 11-byte octal numbers. No padding is added.

NEW FORMAT

Each file has a 110 byte header, a variable length, NUL terminated file name, and variable length file data. A header for a file name "TRAILER!!!" indicates the end of the archive. All the fields in the header are ISO 646 (approximately ASCII) strings of hexadecimal numbers, left padded, not NUL terminated.

FIELDNAME        NOTES
c_magic[6]       The string 070701 for new ASCII, the string 070702 for new ASCII with CRC
c_ino[8]
c_mode[8]
c_uid[8]
c_gid[8]
c_nlink[8]
c_mtim[8]
c_filesize[8]    must be 0 for FIFOs and directories
c_maj[8]
c_min[8]
c_rmaj[8]        only valid for chr and blk special files
c_rmin[8]        only valid for chr and blk special files
c_namesize[8]    count includes terminating NUL in path name
c_check[8]       0 for "new" portable format; for CRC format
                 the sum of all the bytes in the file

New ASCII Format The "new" ASCII format uses 8-byte hexadecimal fields for all numbers and separates device numbers into separate fields for major and minor numbers.

The path name is followed by NUL bytes so that the total size of the fixed header plus path name is a multiple of four. Likewise, the file data is padded to a multiple of four bytes.

This class uses mutable fields and is not considered to be threadsafe.

Based on code from the jRPM project (https://jrpm.sourceforge.net).

The MAGIC numbers and other constants are defined in CpioConstants

N.B. does not handle the cpio "tar" format

See Also
https://people.freebsd.org/~kientzle/libarchive/man/cpio.5.txt

Field Summary

Modifier and TypeField and Description
private final int
alignmentBoundary

The boundary to which the header and data elements are aligned: 0, 2 or 4 bytes

private long
private final short
fileFormat

See CpioArchiveEntry(short) for possible values.

private long
filesize

Number of bytes in the file

private long
private final int
headerSize

The number of bytes in each header record; depends on the file format

private long
private long
private long
private long
private long
private String
private long
private long
private long
private long

Constructor Summary

AccessConstructor and Description
public
CpioArchiveEntry(final File
The file to gather information from.
inputFile
,
final String
The name of this entry.
entryName
)

Creates a CpioArchiveEntry with a specified name for a specified file.

public
CpioArchiveEntry(final Path
The file to gather information from.
inputPath
,
final String
The name of this entry.
entryName
,
final LinkOption...
options indicating how symbolic links are handled.
options
)

Creates a CpioArchiveEntry with a specified name for a specified file.

public
CpioArchiveEntry(final short
The cpio format for this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
              
format
)

Creates a CpioArchiveEntry with a specified format.

public
CpioArchiveEntry(final short
The cpio format for this entry.
format
,
final File
The file to gather information from.
inputFile
,
final String
The name of this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
                 
entryName
)

Creates a CpioArchiveEntry with a specified name for a specified file.

public
CpioArchiveEntry(final short
The cpio format for this entry.
format
,
final Path
The file to gather information from.
inputPath
,
final String
The name of this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
                 
entryName
,
final LinkOption...
options indicating how symbolic links are handled.
options
)

Creates a CpioArchiveEntry with a specified name for a specified path.

public
CpioArchiveEntry(final short
The cpio format for this entry.
format
,
final String
The name of this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
              
name
)

Creates a CpioArchiveEntry with a specified name.

public
CpioArchiveEntry(final short
The cpio format for this entry.
format
,
final String
The name of this entry.
name
,
final long
The size of this entry

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
              
size
)

Creates a CpioArchiveEntry with a specified name.

public
CpioArchiveEntry(final String
The name of this entry.
name
)

Creates a CpioArchiveEntry with a specified name.

public
CpioArchiveEntry(final String
The name of this entry.
name
,
final long
The size of this entry
size
)

Creates a CpioArchiveEntry with a specified name.

Method Summary

Modifier and TypeMethod and Description
private void
checkNewFormat()

Checks if the method is allowed for the defined format.

private void
checkOldFormat()

Checks if the method is allowed for the defined format.

public boolean
equals(final Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int

Returns:

the alignment boundary (0, 2, 4) in bytes
getAlignmentBoundary
()

Gets the alignment boundary for this CPIO format

public long

Returns:

the checksum.
getChksum
()

Gets the checksum.

public int

Returns:

the number of bytes needed to pad the data (0,1,2,3)
getDataPadCount
()

Gets the number of bytes needed to pad the data to the alignment boundary.

public long

Returns:

the device id.
getDevice
()

Gets the device id.

public long

Returns:

the major device id.
getDeviceMaj
()

Gets the major device id.

public long

Returns:

the minor device id.
getDeviceMin
()

Gets the minor device id

public short

Returns:

the format.
getFormat
()

Gets the format for this entry.

public long

Returns:

the group id.
getGID
()

Gets the group id.

public int

Returns:

the number of bytes needed to pad the header (0,1,2,3)
getHeaderPadCount
()

Deprecated This method doesn't properly work for multi-byte encodings.
Gets the number of bytes needed to pad the header to the alignment boundary.
public int

Returns:

the number of bytes needed to pad the header (0,1,2,3)
getHeaderPadCount
(final Charset
The character set used to encode the entry name in the stream.
charset
)

Gets the number of bytes needed to pad the header to the alignment boundary.

public int

Returns:

the number of bytes needed to pad the header (0,1,2,3)
getHeaderPadCount
(final long
The length of the name in bytes, as read in the stream. Without the trailing zero byte.
nameSize
)

Gets the number of bytes needed to pad the header to the alignment boundary.

public int

Returns:

the header size in bytes.
getHeaderSize
()

Gets the header size for this CPIO format

public long

Returns:

the inode.
getInode
()

Sets the inode.

public Date
public long

Returns:

the mode.
getMode
()

Gets the mode of this entry (e.g. directory, regular file).

public String

Returns:

the name.
getName
()

Implements org.apache.commons.compress.archivers.ArchiveEntry.getName.

Gets the name.
public long

Returns:

the remote device id.
getRemoteDevice
()

Gets the remote device id.

public long

Returns:

the remote major device id.
getRemoteDeviceMaj
()

Gets the remote major device id.

public long

Returns:

the remote minor device id.
getRemoteDeviceMin
()

Gets the remote minor device id.

public long

Returns:

the filesize.
getSize
()

Implements org.apache.commons.compress.archivers.ArchiveEntry.getSize.

Gets the filesize.
public long

Returns:

the time.
getTime
()

Gets the time in seconds.

public long

Returns:

the user id.
getUID
()

Gets the user id.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean

Returns:

TRUE if this entry is a block device.
isBlockDevice
()

Checks if this entry represents a block device.

public boolean

Returns:

TRUE if this entry is a character device.
isCharacterDevice
()

Checks if this entry represents a character device.

public boolean

Returns:

TRUE if this entry is a directory.
isDirectory
()

Implements org.apache.commons.compress.archivers.ArchiveEntry.isDirectory.

Checks if this entry represents a directory.
public boolean

Returns:

TRUE if this entry is a network device.
isNetwork
()

Checks if this entry represents a network device.

public boolean

Returns:

TRUE if this entry is a pipe.
isPipe
()

Checks if this entry represents a pipe.

public boolean

Returns:

TRUE if this entry is a regular file.
isRegularFile
()

Checks if this entry represents a regular file.

public boolean

Returns:

TRUE if this entry is a socket.
isSocket
()

Checks if this entry represents a socket.

public void
setChksum(final long
The checksum to set.
chksum
)

Sets the checksum.

public void
setDevice(final long
The device id to set.
device
)

Sets the device id.

public void
setDeviceMaj(final long
The major device id to set.
maj
)

Sets major device id.

public void
setDeviceMin(final long
The minor device id to set.
min
)

Sets the minor device id

public void
setGID(final long
The group id to set.
gid
)

Sets the group id.

public void
setInode(final long
The inode to set.
inode
)

Sets the inode.

public void
setMode(final long
The mode to set.
mode
)

Sets the mode of this entry (e.g. directory, regular file).

public void
setName(final String
The name to set.
name
)

Sets the name.

public void
setRemoteDevice(final long
The remote device id to set.
device
)

Sets the remote device id.

public void
setRemoteDeviceMaj(final long
The remote major device id to set.
rmaj
)

Sets the remote major device id.

public void
setRemoteDeviceMin(final long
The remote minor device id to set.
rmin
)

Sets the remote minor device id.

public void
setSize(final long
The filesize to set.
size
)

Sets the filesize.

public void
setTime(final FileTime
The time to set.
time
)

Sets the time.

public void
setTime(final long
The time to set.
time
)

Sets the time in seconds.

public void
setUID(final long
The user id to set.
uid
)

Sets the user id.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

alignmentBoundaryback to summary
private final int alignmentBoundary

The boundary to which the header and data elements are aligned: 0, 2 or 4 bytes

chksumback to summary
private long chksum
fileFormatback to summary
private final short fileFormat

See CpioArchiveEntry(short) for possible values.

filesizeback to summary
private long filesize

Number of bytes in the file

gidback to summary
private long gid
headerSizeback to summary
private final int headerSize

The number of bytes in each header record; depends on the file format

inodeback to summary
private long inode
majback to summary
private long maj
minback to summary
private long min
modeback to summary
private long mode
mtimeback to summary
private long mtime
nameback to summary
private String name
rmajback to summary
private long rmaj
rminback to summary
private long rmin
uidback to summary
private long uid

Constructor Detail

CpioArchiveEntryback to summary
public CpioArchiveEntry(final File inputFile, final String entryName)

Creates a CpioArchiveEntry with a specified name for a specified file. The format of this entry will be the new format.

Parameters
inputFile:File

The file to gather information from.

entryName:String

The name of this entry.

CpioArchiveEntryback to summary
public CpioArchiveEntry(final Path inputPath, final String entryName, final LinkOption... options) throws IOException

Creates a CpioArchiveEntry with a specified name for a specified file. The format of this entry will be the new format.

Parameters
inputPath:Path

The file to gather information from.

entryName:String

The name of this entry.

options:LinkOption[]

options indicating how symbolic links are handled.

Exceptions
IOException:
if an I/O error occurs
Since
1.21
CpioArchiveEntryback to summary
public CpioArchiveEntry(final short format)

Creates a CpioArchiveEntry with a specified format.

Parameters
format:short

The cpio format for this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
              
CpioArchiveEntryback to summary
public CpioArchiveEntry(final short format, final File inputFile, final String entryName)

Creates a CpioArchiveEntry with a specified name for a specified file.

Parameters
format:short

The cpio format for this entry.

inputFile:File

The file to gather information from.

entryName:String

The name of this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
                 
Since
1.1
CpioArchiveEntryback to summary
public CpioArchiveEntry(final short format, final Path inputPath, final String entryName, final LinkOption... options) throws IOException

Creates a CpioArchiveEntry with a specified name for a specified path.

Parameters
format:short

The cpio format for this entry.

inputPath:Path

The file to gather information from.

entryName:String

The name of this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
                 
options:LinkOption[]

options indicating how symbolic links are handled.

Exceptions
IOException:
if an I/O error occurs
Since
1.21
CpioArchiveEntryback to summary
public CpioArchiveEntry(final short format, final String name)

Creates a CpioArchiveEntry with a specified name.

Parameters
format:short

The cpio format for this entry.

name:String

The name of this entry.

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
              
Since
1.1
CpioArchiveEntryback to summary
public CpioArchiveEntry(final short format, final String name, final long size)

Creates a CpioArchiveEntry with a specified name.

Parameters
format:short

The cpio format for this entry.

name:String

The name of this entry.

size:long

The size of this entry

Possible format values are:

CpioConstants.FORMAT_NEW
CpioConstants.FORMAT_NEW_CRC
CpioConstants.FORMAT_OLD_BINARY
CpioConstants.FORMAT_OLD_ASCII
              
Since
1.1
CpioArchiveEntryback to summary
public CpioArchiveEntry(final String name)

Creates a CpioArchiveEntry with a specified name. The format of this entry will be the new format.

Parameters
name:String

The name of this entry.

CpioArchiveEntryback to summary
public CpioArchiveEntry(final String name, final long size)

Creates a CpioArchiveEntry with a specified name. The format of this entry will be the new format.

Parameters
name:String

The name of this entry.

size:long

The size of this entry

Method Detail

checkNewFormatback to summary
private void checkNewFormat()

Checks if the method is allowed for the defined format.

checkOldFormatback to summary
private void checkOldFormat()

Checks if the method is allowed for the defined format.

equalsback to summary
public boolean equals(final Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAlignmentBoundaryback to summary
public int getAlignmentBoundary()

Gets the alignment boundary for this CPIO format

Returns:int

the alignment boundary (0, 2, 4) in bytes

getChksumback to summary
public long getChksum()

Gets the checksum. Only supported for the new formats.

Returns:long

the checksum.

Exceptions
UnsupportedOperationException:
if the format is not a new format
getDataPadCountback to summary
public int getDataPadCount()

Gets the number of bytes needed to pad the data to the alignment boundary.

Returns:int

the number of bytes needed to pad the data (0,1,2,3)

getDeviceback to summary
public long getDevice()

Gets the device id.

Returns:long

the device id.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with a new format.
getDeviceMajback to summary
public long getDeviceMaj()

Gets the major device id.

Returns:long

the major device id.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with an old format.
getDeviceMinback to summary
public long getDeviceMin()

Gets the minor device id

Returns:long

the minor device id.

Exceptions
UnsupportedOperationException:
if format is not a new format
getFormatback to summary
public short getFormat()

Gets the format for this entry.

Returns:short

the format.

getGIDback to summary
public long getGID()

Gets the group id.

Returns:long

the group id.

getHeaderPadCountback to summary
public int getHeaderPadCount()

Deprecated

This method doesn't properly work for multi-byte encodings. And creates corrupt archives. Use getHeaderPadCount(Charset) or getHeaderPadCount(long) in any case.

Gets the number of bytes needed to pad the header to the alignment boundary.

Returns:int

the number of bytes needed to pad the header (0,1,2,3)

Annotations
@Deprecated
getHeaderPadCountback to summary
public int getHeaderPadCount(final Charset charset)

Gets the number of bytes needed to pad the header to the alignment boundary.

Parameters
charset:Charset

The character set used to encode the entry name in the stream.

Returns:int

the number of bytes needed to pad the header (0,1,2,3)

Since
1.18
getHeaderPadCountback to summary
public int getHeaderPadCount(final long nameSize)

Gets the number of bytes needed to pad the header to the alignment boundary.

Parameters
nameSize:long

The length of the name in bytes, as read in the stream. Without the trailing zero byte.

Returns:int

the number of bytes needed to pad the header (0,1,2,3)

Since
1.18
getHeaderSizeback to summary
public int getHeaderSize()

Gets the header size for this CPIO format

Returns:int

the header size in bytes.

getInodeback to summary
public long getInode()

Sets the inode.

Returns:long

the inode.

getLastModifiedDateback to summary
public Date getLastModifiedDate()

Implements org.apache.commons.compress.archivers.ArchiveEntry.getLastModifiedDate.

Doc from org.apache.commons.compress.archivers.ArchiveEntry.getLastModifiedDate.

Gets the last modified date of this entry.

Returns:Date

the last modified date of this entry.

Annotations
@Override
getModeback to summary
public long getMode()

Gets the mode of this entry (e.g. directory, regular file).

Returns:long

the mode.

getNameback to summary
public String getName()

Implements org.apache.commons.compress.archivers.ArchiveEntry.getName.

Gets the name.

This method returns the raw name as it is stored inside of the archive.

Returns:String

the name.

Annotations
@Override
getRemoteDeviceback to summary
public long getRemoteDevice()

Gets the remote device id.

Returns:long

the remote device id.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with a new format.
getRemoteDeviceMajback to summary
public long getRemoteDeviceMaj()

Gets the remote major device id.

Returns:long

the remote major device id.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with an old format.
getRemoteDeviceMinback to summary
public long getRemoteDeviceMin()

Gets the remote minor device id.

Returns:long

the remote minor device id.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with an old format.
getSizeback to summary
public long getSize()

Implements org.apache.commons.compress.archivers.ArchiveEntry.getSize.

Gets the filesize.

Returns:long

the filesize.

Annotations
@Override
See Also
org.apache.commons.compress.archivers.ArchiveEntry#getSize()
getTimeback to summary
public long getTime()

Gets the time in seconds.

Returns:long

the time.

getUIDback to summary
public long getUID()

Gets the user id.

Returns:long

the user id.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isBlockDeviceback to summary
public boolean isBlockDevice()

Checks if this entry represents a block device.

Returns:boolean

TRUE if this entry is a block device.

isCharacterDeviceback to summary
public boolean isCharacterDevice()

Checks if this entry represents a character device.

Returns:boolean

TRUE if this entry is a character device.

isDirectoryback to summary
public boolean isDirectory()

Implements org.apache.commons.compress.archivers.ArchiveEntry.isDirectory.

Checks if this entry represents a directory.

Returns:boolean

TRUE if this entry is a directory.

Annotations
@Override
isNetworkback to summary
public boolean isNetwork()

Checks if this entry represents a network device.

Returns:boolean

TRUE if this entry is a network device.

isPipeback to summary
public boolean isPipe()

Checks if this entry represents a pipe.

Returns:boolean

TRUE if this entry is a pipe.

isRegularFileback to summary
public boolean isRegularFile()

Checks if this entry represents a regular file.

Returns:boolean

TRUE if this entry is a regular file.

isSocketback to summary
public boolean isSocket()

Checks if this entry represents a socket.

Returns:boolean

TRUE if this entry is a socket.

setChksumback to summary
public void setChksum(final long chksum)

Sets the checksum. The checksum is calculated by adding all bytes of a file to transfer (crc += buf[pos] & 0xFF).

Parameters
chksum:long

The checksum to set.

setDeviceback to summary
public void setDevice(final long device)

Sets the device id.

Parameters
device:long

The device id to set.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with a new format.
setDeviceMajback to summary
public void setDeviceMaj(final long maj)

Sets major device id.

Parameters
maj:long

The major device id to set.

setDeviceMinback to summary
public void setDeviceMin(final long min)

Sets the minor device id

Parameters
min:long

The minor device id to set.

setGIDback to summary
public void setGID(final long gid)

Sets the group id.

Parameters
gid:long

The group id to set.

setInodeback to summary
public void setInode(final long inode)

Sets the inode.

Parameters
inode:long

The inode to set.

setModeback to summary
public void setMode(final long mode)

Sets the mode of this entry (e.g. directory, regular file).

Parameters
mode:long

The mode to set.

setNameback to summary
public void setName(final String name)

Sets the name.

Parameters
name:String

The name to set.

setRemoteDeviceback to summary
public void setRemoteDevice(final long device)

Sets the remote device id.

Parameters
device:long

The remote device id to set.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with a new format.
setRemoteDeviceMajback to summary
public void setRemoteDeviceMaj(final long rmaj)

Sets the remote major device id.

Parameters
rmaj:long

The remote major device id to set.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with an old format.
setRemoteDeviceMinback to summary
public void setRemoteDeviceMin(final long rmin)

Sets the remote minor device id.

Parameters
rmin:long

The remote minor device id to set.

Exceptions
UnsupportedOperationException:
if this method is called for a CpioArchiveEntry with an old format.
setSizeback to summary
public void setSize(final long size)

Sets the filesize.

Parameters
size:long

The filesize to set.

setTimeback to summary
public void setTime(final FileTime time)

Sets the time.

Parameters
time:FileTime

The time to set.

setTimeback to summary
public void setTime(final long time)

Sets the time in seconds.

Parameters
time:long

The time to set.

setUIDback to summary
public void setUID(final long uid)

Sets the user id.

Parameters
uid:long

The user id to set.