Class SevenZArchiveEntry
java.lang.Object
org.apache.commons.compress.archivers.sevenz.SevenZArchiveEntry
- All Implemented Interfaces:
ArchiveEntry
An entry in a 7z archive.
- Since:
- 1.6
-
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.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.booleanReturns whether this entry has got an access date at all.booleanReturns whether this entry has got a crc.booleanReturns whether this entry has got a creation date at all.booleanReturns whether this entry has got a last modified date at all.booleanReturns whether this entry has windows attributes.Gets the last modified date.getName()Get this entry's name.longgetSize()Get this entry's file size.intGets the windows attributes.inthashCode()booleanWhether there is any content associated with this entry.booleanIndicates whether this is an "anti-item" used in differential backups, meaning it should delete the same file from a previous backup.booleanReturn whether or not this entry represents a directory.static longjavaTimeToNtfsTime(Date date) Converts Java time to NTFS time.static DatentfsTimeToJavaTime(long ntfsTime) Converts NTFS time (100 nanosecond units since 1 January 1601) to Java time.voidsetAccessDate(long ntfsAccessDate) Sets the access date using NTFS time (100 nanosecond units since 1 January 1601)voidsetAccessDate(Date accessDate) Sets the access date,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.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,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,voidSet this entry's name.voidsetSize(long size) Set this entry's file size.voidsetWindowsAttributes(int windowsAttributes) Sets the windows attributes.
-
Constructor Details
-
SevenZArchiveEntry
public SevenZArchiveEntry()
-
-
Method Details
-
getName
Get 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.
-
setName
Set this entry's name.- Parameters:
name- This entry's new name.
-
hasStream
Whether there is any content associated with this entry.- Returns:
- whether there is any content associated with this entry.
-
setHasStream
Sets whether there is any content associated with this entry.- Parameters:
hasStream- whether there is any content associated with this entry.
-
isDirectory
Return whether or not this entry represents a directory.- Specified by:
isDirectoryin interfaceArchiveEntry- Returns:
- True if this entry is a directory.
-
setDirectory
Sets whether or not this entry represents a directory.- Parameters:
isDirectory- True if this entry is a directory.
-
isAntiItem
Indicates 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
-
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
-
getHasCreationDate
Returns whether this entry has got a creation date at all.- Returns:
- whether the entry has got a creation date
-
setHasCreationDate
Sets whether this entry has got a creation date at all.- Parameters:
hasCreationDate- whether the entry has got a creation date
-
getCreationDate
Gets the creation date.- Returns:
- the creation date
- Throws:
UnsupportedOperationException- if the entry hasn't got a creation date.
-
setCreationDate
Sets the creation date using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsCreationDate- the creation date
-
setCreationDate
Sets the creation date,- Parameters:
creationDate- the creation date
-
getHasLastModifiedDate
Returns whether this entry has got a last modified date at all.- Returns:
- whether this entry has got a last modified date at all
-
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
-
getLastModifiedDate
Gets the last modified date.- Specified by:
getLastModifiedDatein interfaceArchiveEntry- Returns:
- the last modified date
- Throws:
UnsupportedOperationException- if the entry hasn't got a last modified date.
-
setLastModifiedDate
Sets the last modified date using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsLastModifiedDate- the last modified date
-
setLastModifiedDate
Sets the last modified date,- Parameters:
lastModifiedDate- the last modified date
-
getHasAccessDate
Returns whether this entry has got an access date at all.- Returns:
- whether this entry has got an access date at all.
-
setHasAccessDate
Sets whether this entry has got an access date at all.- Parameters:
hasAcessDate- whether this entry has got an access date at all.
-
getAccessDate
Gets the access date.- Returns:
- the access date
- Throws:
UnsupportedOperationException- if the entry hasn't got a access date.
-
setAccessDate
Sets the access date using NTFS time (100 nanosecond units since 1 January 1601)- Parameters:
ntfsAccessDate- the access date
-
setAccessDate
Sets the access date,- Parameters:
accessDate- the access date
-
getHasWindowsAttributes
Returns whether this entry has windows attributes.- Returns:
- whether this entry has windows attributes.
-
setHasWindowsAttributes
Sets whether this entry has windows attributes.- Parameters:
hasWindowsAttributes- whether this entry has windows attributes.
-
getWindowsAttributes
Gets the windows attributes.- Returns:
- the windows attributes
-
setWindowsAttributes
Sets the windows attributes.- Parameters:
windowsAttributes- the windows attributes
-
getHasCrc
Returns 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.
-
setHasCrc
Sets whether this entry has got a crc.- Parameters:
hasCrc- whether this entry has got a crc.
-
getCrc
Deprecated.use getCrcValue instead.Gets the CRC.- Returns:
- the CRC
-
setCrc
Deprecated.use setCrcValue instead.Sets the CRC.- Parameters:
crc- the CRC
-
getCrcValue
Gets the CRC.- Returns:
- the CRC
- Since:
- Compress 1.7
-
setCrcValue
Sets the CRC.- Parameters:
crc- the CRC- Since:
- Compress 1.7
-
getSize
Get this entry's file size.- Specified by:
getSizein interfaceArchiveEntry- Returns:
- This entry's file size.
-
setSize
Set this entry's file size.- Parameters:
size- This entry's new file size.
-
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
-
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
-
hashCode
-
equals
-
ntfsTimeToJavaTime
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
-
javaTimeToNtfsTime
Converts Java time to NTFS time.- Parameters:
date- the Java time- Returns:
- the NTFS time
-