Class SevenZArchiveEntry
- All Implemented Interfaces:
ArchiveEntry
- Since:
- 1.6
- This class is not thread-safe
-
Field Summary
Fields inherited from interface org.apache.commons.compress.archivers.ArchiveEntry
SIZE_UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the access date.Gets the access time.Iterable<? extends SevenZMethodConfiguration>Gets the (compression) methods to use for entry's content - the default is LZMA2.intgetCrc()Deprecated.use getCrcValue instead.longGets the CRC.Gets the creation date.Gets the creation time.booleanGets whether this entry has got an access date at all.booleanGets whether this entry has got a crc.booleanGets whether this entry has got a creation date at all.booleanGets whether this entry has got a last modified date at all.booleanGets whether this entry has windows attributes.Gets the last modified date.Gets the last modified time.getName()Gets this entry's name.longgetSize()Gets this entry's file size.intGets the windows attributes.inthashCode()booleanTests whether there is any content associated with this entry.booleanTests whether this is an "anti-item" used in differential backups, meaning it should delete the same file from a previous backup.booleanTests whether or not this entry represents a directory.static longjavaTimeToNtfsTime(Date date) Deprecated.UseFileTimes.toNtfsTime(Date)instead.static DatentfsTimeToJavaTime(long ntfsTime) Deprecated.UseFileTimes.ntfsTimeToDate(long)instead.voidsetAccessDate(long ntfsAccessDate) Sets the access date using NTFS time (100 nanosecond units since 1 January 1601)voidsetAccessDate(Date accessDate) Sets the access date.voidsetAccessTime(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.voidsetContentMethods(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(int crc) Deprecated.use setCrcValue instead.voidsetCrcValue(long crc) Sets the CRC.voidsetCreationDate(long ntfsCreationDate) Sets the creation date using NTFS time (100 nanosecond units since 1 January 1601)voidsetCreationDate(Date creationDate) Sets the creation date.voidsetCreationTime(FileTime time) Sets the creation time.voidsetDirectory(boolean isDirectory) Sets whether or not this entry represents a directory.voidsetHasAccessDate(boolean hasAcessDate) Sets whether this entry has got an access date at all.voidsetHasCrc(boolean hasCrc) Sets whether this entry has got a crc.voidsetHasCreationDate(boolean hasCreationDate) Sets whether this entry has got a creation date at all.voidsetHasLastModifiedDate(boolean hasLastModifiedDate) Sets whether this entry has got a last modified date 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.voidsetLastModifiedDate(long ntfsLastModifiedDate) Sets the last modified date using NTFS time (100 nanosecond units since 1 January 1601)voidsetLastModifiedDate(Date lastModifiedDate) Sets the last modified date.voidsetLastModifiedTime(FileTime time) Sets the last modified time.voidSets 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, waitMethods inherited from interface org.apache.commons.compress.archivers.ArchiveEntry
resolveIn
-
Constructor Details
-
SevenZArchiveEntry
public SevenZArchiveEntry()Constructs a new instance.
-
-
Method Details
-
javaTimeToNtfsTime
Deprecated.UseFileTimes.toNtfsTime(Date)instead.Converts Java time to NTFS time.- Parameters:
date- the Java time- Returns:
- the NTFS time
- See Also:
-
ntfsTimeToJavaTime
Deprecated.UseFileTimes.ntfsTimeToDate(long)instead.Converts NTFS time (100 nanosecond units since 1 January 1601) to Java time.- Parameters:
ntfsTime- the NTFS time in 100 nanosecond units- Returns:
- the Java time
- See Also:
-
equals
-
getAccessDate
Gets the access date. This is equivalent togetAccessTime(), but precision is truncated to milliseconds.- Returns:
- the access date
- Throws:
UnsupportedOperationException- if the entry hasn't got an access date.- See Also:
-
getAccessTime
Gets the access time.- Returns:
- the access time
- Throws:
UnsupportedOperationException- if the entry hasn't got an access time.- Since:
- 1.23
-
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
Deprecated.use getCrcValue instead.Gets the CRC.- Returns:
- the CRC
-
getCrcValue
Gets the CRC.- Returns:
- the CRC
- Since:
- 1.7
-
getCreationDate
Gets the creation date. This is equivalent togetCreationTime(), but precision is truncated to milliseconds.- Returns:
- the new creation date
- Throws:
UnsupportedOperationException- if the entry hasn't got a creation date.- See Also:
-
getCreationTime
Gets the creation time.- Returns:
- the creation time
- Throws:
UnsupportedOperationException- if the entry hasn't got a creation time.- Since:
- 1.23
-
getHasAccessDate
Gets whether this entry has got an access date at all.- Returns:
- whether this entry has got an access date at all.
-
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.
-
getHasCreationDate
Gets whether this entry has got a creation date at all.- Returns:
- whether the entry has got a creation date
-
getHasLastModifiedDate
Gets whether this entry has got a last modified date at all.- Returns:
- whether this entry has got a last modified date at all
-
getHasWindowsAttributes
Gets whether this entry has windows attributes.- Returns:
- whether this entry has windows attributes.
-
getLastModifiedDate
Gets the last modified date. This is equivalent togetLastModifiedTime(), but precision is truncated to milliseconds.- Specified by:
getLastModifiedDatein interfaceArchiveEntry- Returns:
- the last modified date
- Throws:
UnsupportedOperationException- if the entry hasn't got a last modified date.- See Also:
-
getLastModifiedTime
Gets the last modified time.- Returns:
- the last modified time
- Throws:
UnsupportedOperationException- if the entry hasn't got a last modified time.- Since:
- 1.23
-
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
Gets this entry's file size.- Specified by:
getSizein interfaceArchiveEntry- Returns:
- This entry's file size.
-
getWindowsAttributes
Gets the windows attributes.- Returns:
- the windows attributes
-
hashCode
-
hasStream
Tests whether there is any content associated with this entry.- Returns:
- whether there is any content associated with this entry.
-
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
Tests whether or not this entry represents a directory.- Specified by:
isDirectoryin interfaceArchiveEntry- Returns:
- True if this entry is a directory.
-
setAccessDate
Sets the access date.- Parameters:
accessDate- the new access date- See Also:
-
setAccessDate
Sets the access date using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsAccessDate- the access date
-
setAccessTime
Sets the access time.- Parameters:
time- the new access time- Since:
- 1.23
-
setAntiItem
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
-
setContentMethods
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
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
Deprecated.use setCrcValue instead.Sets the CRC.- Parameters:
crc- the CRC
-
setCrcValue
Sets the CRC.- Parameters:
crc- the CRC- Since:
- 1.7
-
setCreationDate
Sets the creation date.- Parameters:
creationDate- the new creation date- See Also:
-
setCreationDate
Sets the creation date using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsCreationDate- the creation date
-
setCreationTime
Sets the creation time.- Parameters:
time- the new creation time- Since:
- 1.23
-
setDirectory
Sets whether or not this entry represents a directory.- Parameters:
isDirectory- True if this entry is a directory.
-
setHasAccessDate
Sets whether this entry has got an access date at all.- Parameters:
hasAcessDate- whether this entry has got an access date at all.
-
setHasCrc
Sets whether this entry has got a crc.- Parameters:
hasCrc- whether this entry has got a crc.
-
setHasCreationDate
Sets whether this entry has got a creation date at all.- Parameters:
hasCreationDate- whether the entry has got a creation date
-
setHasLastModifiedDate
Sets whether this entry has got a last modified date at all.- Parameters:
hasLastModifiedDate- whether this entry has got a last modified date at all
-
setHasStream
Sets whether there is any content associated with this entry.- Parameters:
hasStream- whether there is any content associated with this entry.
-
setHasWindowsAttributes
Sets whether this entry has windows attributes.- Parameters:
hasWindowsAttributes- whether this entry has windows attributes.
-
setLastModifiedDate
Sets the last modified date.- Parameters:
lastModifiedDate- the new last modified date- See Also:
-
setLastModifiedDate
Sets the last modified date using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsLastModifiedDate- the last modified date
-
setLastModifiedTime
Sets the last modified time.- Parameters:
time- the new last modified time- Since:
- 1.23
-
setName
Sets this entry's name.- Parameters:
name- This entry's new name.
-
setSize
Sets this entry's file size.- Parameters:
size- This entry's new file size.
-
setWindowsAttributes
Sets the windows attributes.- Parameters:
windowsAttributes- the windows attributes
-