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

public Interface ArchiveEntry

Known Direct Implementers
org.apache.commons.compress.archivers.ar.ArArchiveEntry, org.apache.commons.compress.archivers.arj.ArjArchiveEntry, org.apache.commons.compress.archivers.cpio.CpioArchiveEntry, org.apache.commons.compress.archivers.dump.DumpArchiveEntry, org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry, org.apache.commons.compress.archivers.tar.TarArchiveEntry, org.apache.commons.compress.archivers.zip.ZipArchiveEntry
Imports
java.io.IOException, java.nio.file.Path, java.util.Date

An entry of an archive.

Field Summary

Modifier and TypeField and Description
public static final long
SIZE_UNKNOWN

Special value (-1) indicating that the size is unknown.

Method Summary

Modifier and TypeMethod and Description
public Date

Returns:

the last modified date of this entry.
getLastModifiedDate
()

Gets the last modified date of this entry.

public String

Returns:

The name of this entry in the archive.
getName
()

Gets the name of the entry in this archive.

public long

Returns:

the uncompressed size of this entry.
getSize
()

Gets the uncompressed size of this entry.

public boolean

Returns:

true if this entry refers to a directory.
isDirectory
()

Tests whether this entry refers to a directory (true).

public default Path

Returns:

a resolved and normalized Path.
resolveIn
(final Path
the Path#resolve(Path) receiver.
parentPath
)

Resolves this entry in the given parent Path.

Field Detail

SIZE_UNKNOWNback to summary
public static final long SIZE_UNKNOWN

Special value (-1) indicating that the size is unknown.

Method Detail

getLastModifiedDateback to summary
public Date getLastModifiedDate()

Gets the last modified date of this entry.

Returns:Date

the last modified date of this entry.

Since
1.1
getNameback to summary
public String getName()

Gets the name of the entry in this archive. May refer to a file or directory or other item.

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

Returns:String

The name of this entry in the archive.

getSizeback to summary
public long getSize()

Gets the uncompressed size of this entry. May be -1 (SIZE_UNKNOWN) if the size is unknown

Returns:long

the uncompressed size of this entry.

isDirectoryback to summary
public boolean isDirectory()

Tests whether this entry refers to a directory (true).

Returns:boolean

true if this entry refers to a directory.

resolveInback to summary
public default Path resolveIn(final Path parentPath) throws IOException

Resolves this entry in the given parent Path.

Parameters
parentPath:Path

the Path#resolve(Path) receiver.

Returns:Path

a resolved and normalized Path.

Exceptions
IOException:
if this method detects a Zip slip.
Since
1.26.0