Class SevenZArchiveEntry
- java.lang.Object
-
- kala.compress.archivers.sevenz.SevenZArchiveEntry
-
- All Implemented Interfaces:
ArchiveEntry
public class SevenZArchiveEntry extends java.lang.Object implements ArchiveEntry
An entry in a 7z archive.- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.attribute.FileTimeaccessTimeprivate longcompressedCrcprivate longcompressedSizeprivate java.lang.Iterable<? extends SevenZMethodConfiguration>contentMethodsprivate longcrcprivate java.nio.file.attribute.FileTimecreationTime(package private) static SevenZArchiveEntry[]EMPTY_SEVEN_Z_ARCHIVE_ENTRY_ARRAYprivate booleanhasAccessTimeprivate booleanhasCrcprivate booleanhasCreationTimeprivate booleanhasLastModifiedTimeprivate booleanhasStreamprivate booleanhasWindowsAttributesprivate booleanisAntiItemprivate booleanisDirectoryprivate java.nio.file.attribute.FileTimelastModifiedTimeprivate java.lang.Stringnameprivate longsizeprivate intwindowsAttributes-
Fields inherited from interface kala.compress.archivers.ArchiveEntry
SIZE_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description SevenZArchiveEntry()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)private booleanequalSevenZMethods(java.lang.Iterable<? extends SevenZMethodConfiguration> c1, java.lang.Iterable<? extends SevenZMethodConfiguration> c2)java.nio.file.attribute.FileTimegetAccessTime()Gets the access time.(package private) longgetCompressedCrc()Gets the compressed CRC.(package private) longgetCompressedSize()Gets this entry's compressed file size.java.lang.Iterable<? extends SevenZMethodConfiguration>getContentMethods()Gets the (compression) methods to use for entry's content - the default is LZMA2.longgetCrc()Gets the CRC.longgetCrcValue()Deprecated.UsegetCrc()java.nio.file.attribute.FileTimegetCreationTime()Gets the creation time.booleangetHasAccessTime()Gets whether this entry has got an access time at all.booleangetHasCrc()Gets whether this entry has got a crc.booleangetHasCreationTime()Gets whether this entry has got a creation time at all.booleangetHasLastModifiedTime()Gets whether this entry has got a last modified time at all.booleangetHasWindowsAttributes()Gets whether this entry has windows attributes.java.nio.file.attribute.FileTimegetLastModifiedTime()Gets the last modified time.java.lang.StringgetName()Gets this entry's name.longgetSize()Gets this entry's file size.intgetWindowsAttributes()Gets the windows attributes.inthashCode()booleanhasStream()Tests whether there is any content associated with this entry.booleanisAntiItem()Tests whether this is an "anti-item" used in differential backups, meaning it should delete the same file from a previous backup.booleanisDirectory()Tests whether or not this entry represents a directory.voidsetAccessTime(long ntfsAccessTime)Sets the access time using NTFS time (100 nanosecond units since 1 January 1601)voidsetAccessTime(java.nio.file.attribute.FileTime time)Sets the access time.voidsetAntiItem(boolean isAntiItem)Sets whether this is an "anti-item" used in differential backups, meaning it should delete the same file from a previous backup.(package private) voidsetCompressedCrc(long crc)Sets the compressed CRC.(package private) voidsetCompressedSize(long size)Sets this entry's compressed file size.voidsetContentMethods(java.lang.Iterable<? extends SevenZMethodConfiguration> methods)Sets the (compression) methods to use for entry's content - the default is LZMA2.voidsetContentMethods(SevenZMethodConfiguration... methods)Sets the (compression) methods to use for entry's content - the default is LZMA2.voidsetCrc(long crc)Sets the CRC.voidsetCrcValue(long crc)Deprecated.UsesetCrc(long)voidsetCreationTime(long ntfsCreationTime)Sets the creation time using NTFS time (100 nanosecond units since 1 January 1601)voidsetCreationTime(java.nio.file.attribute.FileTime time)Sets the creation time.voidsetDirectory(boolean isDirectory)Sets whether or not this entry represents a directory.voidsetHasAccessTime(boolean hasAcessTime)Sets whether this entry has got an access time at all.voidsetHasCrc(boolean hasCrc)Sets whether this entry has got a crc.voidsetHasCreationTime(boolean hasCreationTime)Sets whether this entry has got a creation time at all.voidsetHasLastModifiedTime(boolean hasLastModifiedTime)Sets whether this entry has got a last modified time at all.voidsetHasStream(boolean hasStream)Sets whether there is any content associated with this entry.voidsetHasWindowsAttributes(boolean hasWindowsAttributes)Sets whether this entry has windows attributes.voidsetLastModifiedTime(long ntfsLastModifiedTime)Sets the last modified time using NTFS time (100 nanosecond units since 1 January 1601)voidsetLastModifiedTime(java.nio.file.attribute.FileTime time)Sets the last modified time.voidsetName(java.lang.String name)Sets this entry's name.voidsetSize(long size)Sets this entry's file size.voidsetWindowsAttributes(int windowsAttributes)Sets the windows attributes.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface kala.compress.archivers.ArchiveEntry
resolveIn
-
-
-
-
Field Detail
-
EMPTY_SEVEN_Z_ARCHIVE_ENTRY_ARRAY
static final SevenZArchiveEntry[] EMPTY_SEVEN_Z_ARCHIVE_ENTRY_ARRAY
-
name
private java.lang.String name
-
hasStream
private boolean hasStream
-
isDirectory
private boolean isDirectory
-
isAntiItem
private boolean isAntiItem
-
hasCreationTime
private boolean hasCreationTime
-
hasLastModifiedTime
private boolean hasLastModifiedTime
-
hasAccessTime
private boolean hasAccessTime
-
creationTime
private java.nio.file.attribute.FileTime creationTime
-
lastModifiedTime
private java.nio.file.attribute.FileTime lastModifiedTime
-
accessTime
private java.nio.file.attribute.FileTime accessTime
-
hasWindowsAttributes
private boolean hasWindowsAttributes
-
windowsAttributes
private int windowsAttributes
-
hasCrc
private boolean hasCrc
-
crc
private long crc
-
compressedCrc
private long compressedCrc
-
size
private long size
-
compressedSize
private long compressedSize
-
contentMethods
private java.lang.Iterable<? extends SevenZMethodConfiguration> contentMethods
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
equalSevenZMethods
private boolean equalSevenZMethods(java.lang.Iterable<? extends SevenZMethodConfiguration> c1, java.lang.Iterable<? extends SevenZMethodConfiguration> c2)
-
getAccessTime
public java.nio.file.attribute.FileTime getAccessTime()
Gets the access time.- Returns:
- the access time
- Throws:
java.lang.UnsupportedOperationException- if the entry hasn't got an access time.- Since:
- 1.23
-
getCompressedCrc
long getCompressedCrc()
Gets the compressed CRC.- Returns:
- the CRC
- Since:
- 1.27.1-0
-
getCompressedSize
long getCompressedSize()
Gets this entry's compressed file size.- Returns:
- This entry's compressed file size.
-
getContentMethods
public java.lang.Iterable<? extends SevenZMethodConfiguration> getContentMethods()
Gets the (compression) methods to use for entry's content - the default is LZMA2.Currently only
SevenZMethod.COPY,SevenZMethod.LZMA2,SevenZMethod.BZIP2andSevenZMethod.DEFLATEare supported when writing archives.The methods will be consulted in iteration order to create the final output.
- Returns:
- the methods to use for the content
- Since:
- 1.8
-
getCrc
public long getCrc()
Gets the CRC.- Returns:
- the CRC
- Since:
- 1.27.1-0
-
getCrcValue
@Deprecated public long getCrcValue()
Deprecated.UsegetCrc()Gets the CRC.- Returns:
- the CRC
- Since:
- 1.7
-
getCreationTime
public java.nio.file.attribute.FileTime getCreationTime()
Gets the creation time.- Returns:
- the creation time
- Throws:
java.lang.UnsupportedOperationException- if the entry hasn't got a creation time.- Since:
- 1.23
-
getHasAccessTime
public boolean getHasAccessTime()
Gets whether this entry has got an access time at all.- Returns:
- whether this entry has got an access time at all.
-
getHasCrc
public boolean getHasCrc()
Gets whether this entry has got a crc.In general entries without streams don't have a CRC either.
- Returns:
- whether this entry has got a crc.
-
getHasCreationTime
public boolean getHasCreationTime()
Gets whether this entry has got a creation time at all.- Returns:
- whether the entry has got a creation time
-
getHasLastModifiedTime
public boolean getHasLastModifiedTime()
Gets whether this entry has got a last modified time at all.- Returns:
- whether this entry has got a last modified time at all
-
getHasWindowsAttributes
public boolean getHasWindowsAttributes()
Gets whether this entry has windows attributes.- Returns:
- whether this entry has windows attributes.
-
getLastModifiedTime
public java.nio.file.attribute.FileTime getLastModifiedTime()
Gets the last modified time.- Specified by:
getLastModifiedTimein interfaceArchiveEntry- Returns:
- the last modified time
- Throws:
java.lang.UnsupportedOperationException- if the entry hasn't got a last modified time.- Since:
- 1.23
-
getName
public java.lang.String getName()
Gets this entry's name.This method returns the raw name as it is stored inside of the archive.
- Specified by:
getNamein interfaceArchiveEntry- Returns:
- This entry's name.
-
getSize
public long getSize()
Gets this entry's file size.- Specified by:
getSizein interfaceArchiveEntry- Returns:
- This entry's file size.
-
getWindowsAttributes
public int getWindowsAttributes()
Gets the windows attributes.- Returns:
- the windows attributes
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
hasStream
public boolean hasStream()
Tests whether there is any content associated with this entry.- Returns:
- whether there is any content associated with this entry.
-
isAntiItem
public boolean isAntiItem()
Tests whether this is an "anti-item" used in differential backups, meaning it should delete the same file from a previous backup.- Returns:
- true if it is an anti-item, false otherwise
-
isDirectory
public boolean isDirectory()
Tests whether or not this entry represents a directory.- Specified by:
isDirectoryin interfaceArchiveEntry- Returns:
- True if this entry is a directory.
-
setAccessTime
public void setAccessTime(long ntfsAccessTime)
Sets the access time using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsAccessTime- the access time
-
setAccessTime
public void setAccessTime(java.nio.file.attribute.FileTime time)
Sets the access time.- Parameters:
time- the new access time- Since:
- 1.23
-
setAntiItem
public void setAntiItem(boolean isAntiItem)
Sets whether this is an "anti-item" used in differential backups, meaning it should delete the same file from a previous backup.- Parameters:
isAntiItem- true if it is an anti-item, false otherwise
-
setCompressedCrc
void setCompressedCrc(long crc)
Sets the compressed CRC.- Parameters:
crc- the CRC
-
setCompressedSize
void setCompressedSize(long size)
Sets this entry's compressed file size.- Parameters:
size- This entry's new compressed file size.
-
setContentMethods
public void setContentMethods(java.lang.Iterable<? extends SevenZMethodConfiguration> methods)
Sets the (compression) methods to use for entry's content - the default is LZMA2.Currently only
SevenZMethod.COPY,SevenZMethod.LZMA2,SevenZMethod.BZIP2andSevenZMethod.DEFLATEare supported when writing archives.The methods will be consulted in iteration order to create the final output.
- Parameters:
methods- the methods to use for the content- Since:
- 1.8
-
setContentMethods
public void setContentMethods(SevenZMethodConfiguration... methods)
Sets the (compression) methods to use for entry's content - the default is LZMA2.Currently only
SevenZMethod.COPY,SevenZMethod.LZMA2,SevenZMethod.BZIP2andSevenZMethod.DEFLATEare supported when writing archives.The methods will be consulted in iteration order to create the final output.
- Parameters:
methods- the methods to use for the content- Since:
- 1.22
-
setCrc
public void setCrc(long crc)
Sets the CRC.- Parameters:
crc- the CRC- Since:
- 1.27.1-0
-
setCrcValue
@Deprecated public void setCrcValue(long crc)
Deprecated.UsesetCrc(long)Sets the CRC.- Parameters:
crc- the CRC- Since:
- 1.7
-
setCreationTime
public void setCreationTime(long ntfsCreationTime)
Sets the creation time using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsCreationTime- the creation time- Since:
- 1.27.1-0
-
setCreationTime
public void setCreationTime(java.nio.file.attribute.FileTime time)
Sets the creation time.- Parameters:
time- the new creation time- Since:
- 1.23
-
setDirectory
public void setDirectory(boolean isDirectory)
Sets whether or not this entry represents a directory.- Parameters:
isDirectory- True if this entry is a directory.
-
setHasAccessTime
public void setHasAccessTime(boolean hasAcessTime)
Sets whether this entry has got an access time at all.- Parameters:
hasAcessTime- whether this entry has got an access time at all.- Since:
- 1.27.1-0
-
setHasCrc
public void setHasCrc(boolean hasCrc)
Sets whether this entry has got a crc.- Parameters:
hasCrc- whether this entry has got a crc.
-
setHasCreationTime
public void setHasCreationTime(boolean hasCreationTime)
Sets whether this entry has got a creation time at all.- Parameters:
hasCreationTime- whether the entry has got a creation time- Since:
- 1.27.1-0
-
setHasLastModifiedTime
public void setHasLastModifiedTime(boolean hasLastModifiedTime)
Sets whether this entry has got a last modified time at all.- Parameters:
hasLastModifiedTime- whether this entry has got a last modified time at all- Since:
- 1.27.1-0
-
setHasStream
public void setHasStream(boolean hasStream)
Sets whether there is any content associated with this entry.- Parameters:
hasStream- whether there is any content associated with this entry.
-
setHasWindowsAttributes
public void setHasWindowsAttributes(boolean hasWindowsAttributes)
Sets whether this entry has windows attributes.- Parameters:
hasWindowsAttributes- whether this entry has windows attributes.
-
setLastModifiedTime
public void setLastModifiedTime(long ntfsLastModifiedTime)
Sets the last modified time using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsLastModifiedTime- the last modified time
-
setLastModifiedTime
public void setLastModifiedTime(java.nio.file.attribute.FileTime time)
Sets the last modified time.- Parameters:
time- the new last modified time- Since:
- 1.23
-
setName
public void setName(java.lang.String name)
Sets this entry's name.- Parameters:
name- This entry's new name.
-
setSize
public void setSize(long size)
Sets this entry's file size.- Parameters:
size- This entry's new file size.
-
setWindowsAttributes
public void setWindowsAttributes(int windowsAttributes)
Sets the windows attributes.- Parameters:
windowsAttributes- the windows attributes
-
-