public class SevenZArchiveEntry extends java.lang.Object implements ArchiveEntry
SIZE_UNKNOWN
Constructor and Description |
---|
SevenZArchiveEntry() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Date |
getAccessDate()
Gets the access date.
|
java.lang.Iterable<? extends SevenZMethodConfiguration> |
getContentMethods()
Gets the (compression) methods to use for entry's content - the
default is LZMA2.
|
int |
getCrc()
Deprecated.
use getCrcValue instead.
|
long |
getCrcValue()
Gets the CRC.
|
java.util.Date |
getCreationDate()
Gets the creation date.
|
boolean |
getHasAccessDate()
Returns whether this entry has got an access date at all.
|
boolean |
getHasCrc()
Returns whether this entry has got a crc.
|
boolean |
getHasCreationDate()
Returns whether this entry has got a creation date at all.
|
boolean |
getHasLastModifiedDate()
Returns whether this entry has got a last modified date at all.
|
boolean |
getHasWindowsAttributes()
Returns whether this entry has windows attributes.
|
java.util.Date |
getLastModifiedDate()
Gets the last modified date.
|
java.lang.String |
getName()
Get this entry's name.
|
long |
getSize()
Get this entry's file size.
|
int |
getWindowsAttributes()
Gets the windows attributes.
|
int |
hashCode() |
boolean |
hasStream()
Whether there is any content associated with this entry.
|
boolean |
isAntiItem()
Indicates whether this is an "anti-item" used in differential backups,
meaning it should delete the same file from a previous backup.
|
boolean |
isDirectory()
Return whether or not this entry represents a directory.
|
static long |
javaTimeToNtfsTime(java.util.Date date)
Converts Java time to NTFS time.
|
static java.util.Date |
ntfsTimeToJavaTime(long ntfsTime)
Converts NTFS time (100 nanosecond units since 1 January 1601)
to Java time.
|
void |
setAccessDate(java.util.Date accessDate)
Sets the access date,
|
void |
setAccessDate(long ntfsAccessDate)
Sets the access date using NTFS time (100 nanosecond units
since 1 January 1601)
|
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.
|
void |
setContentMethods(java.lang.Iterable<? extends SevenZMethodConfiguration> methods)
Sets the (compression) methods to use for entry's content - the
default is LZMA2.
|
void |
setContentMethods(SevenZMethodConfiguration... methods)
Sets the (compression) methods to use for entry's content - the
default is LZMA2.
|
void |
setCrc(int crc)
Deprecated.
use setCrcValue instead.
|
void |
setCrcValue(long crc)
Sets the CRC.
|
void |
setCreationDate(java.util.Date creationDate)
Sets the creation date,
|
void |
setCreationDate(long ntfsCreationDate)
Sets the creation date using NTFS time (100 nanosecond units
since 1 January 1601)
|
void |
setDirectory(boolean isDirectory)
Sets whether or not this entry represents a directory.
|
void |
setHasAccessDate(boolean hasAcessDate)
Sets whether this entry has got an access date at all.
|
void |
setHasCrc(boolean hasCrc)
Sets whether this entry has got a crc.
|
void |
setHasCreationDate(boolean hasCreationDate)
Sets whether this entry has got a creation date at all.
|
void |
setHasLastModifiedDate(boolean hasLastModifiedDate)
Sets whether this entry has got a last modified date at all.
|
void |
setHasStream(boolean hasStream)
Sets whether there is any content associated with this entry.
|
void |
setHasWindowsAttributes(boolean hasWindowsAttributes)
Sets whether this entry has windows attributes.
|
void |
setLastModifiedDate(java.util.Date lastModifiedDate)
Sets the last modified date,
|
void |
setLastModifiedDate(long ntfsLastModifiedDate)
Sets the last modified date using NTFS time (100 nanosecond
units since 1 January 1601)
|
void |
setName(java.lang.String name)
Set this entry's name.
|
void |
setSize(long size)
Set this entry's file size.
|
void |
setWindowsAttributes(int windowsAttributes)
Sets the windows attributes.
|
public java.lang.String getName()
This method returns the raw name as it is stored inside of the archive.
getName
in interface ArchiveEntry
public void setName(java.lang.String name)
name
- This entry's new name.public boolean hasStream()
public void setHasStream(boolean hasStream)
hasStream
- whether there is any content associated with this entry.public boolean isDirectory()
isDirectory
in interface ArchiveEntry
public void setDirectory(boolean isDirectory)
isDirectory
- True if this entry is a directory.public boolean isAntiItem()
public void setAntiItem(boolean isAntiItem)
isAntiItem
- true if it is an anti-item, false otherwisepublic boolean getHasCreationDate()
public void setHasCreationDate(boolean hasCreationDate)
hasCreationDate
- whether the entry has got a creation datepublic java.util.Date getCreationDate()
java.lang.UnsupportedOperationException
- if the entry hasn't got a
creation date.public void setCreationDate(long ntfsCreationDate)
ntfsCreationDate
- the creation datepublic void setCreationDate(java.util.Date creationDate)
creationDate
- the creation datepublic boolean getHasLastModifiedDate()
public void setHasLastModifiedDate(boolean hasLastModifiedDate)
hasLastModifiedDate
- whether this entry has got a last
modified date at allpublic java.util.Date getLastModifiedDate()
getLastModifiedDate
in interface ArchiveEntry
java.lang.UnsupportedOperationException
- if the entry hasn't got a
last modified date.public void setLastModifiedDate(long ntfsLastModifiedDate)
ntfsLastModifiedDate
- the last modified datepublic void setLastModifiedDate(java.util.Date lastModifiedDate)
lastModifiedDate
- the last modified datepublic boolean getHasAccessDate()
public void setHasAccessDate(boolean hasAcessDate)
hasAcessDate
- whether this entry has got an access date at all.public java.util.Date getAccessDate()
java.lang.UnsupportedOperationException
- if the entry hasn't got a
access date.public void setAccessDate(long ntfsAccessDate)
ntfsAccessDate
- the access datepublic void setAccessDate(java.util.Date accessDate)
accessDate
- the access datepublic boolean getHasWindowsAttributes()
public void setHasWindowsAttributes(boolean hasWindowsAttributes)
hasWindowsAttributes
- whether this entry has windows attributes.public int getWindowsAttributes()
public void setWindowsAttributes(int windowsAttributes)
windowsAttributes
- the windows attributespublic boolean getHasCrc()
In general entries without streams don't have a CRC either.
public void setHasCrc(boolean hasCrc)
hasCrc
- whether this entry has got a crc.@Deprecated public int getCrc()
@Deprecated public void setCrc(int crc)
crc
- the CRCpublic long getCrcValue()
public void setCrcValue(long crc)
crc
- the CRCpublic long getSize()
getSize
in interface ArchiveEntry
public void setSize(long size)
size
- This entry's new file size.public void setContentMethods(java.lang.Iterable<? extends SevenZMethodConfiguration> methods)
Currently only SevenZMethod.COPY
, SevenZMethod.LZMA2
, SevenZMethod.BZIP2
and SevenZMethod.DEFLATE
are supported when writing archives.
The methods will be consulted in iteration order to create the final output.
methods
- the methods to use for the contentpublic void setContentMethods(SevenZMethodConfiguration... methods)
Currently only SevenZMethod.COPY
, SevenZMethod.LZMA2
, SevenZMethod.BZIP2
and SevenZMethod.DEFLATE
are supported when writing archives.
The methods will be consulted in iteration order to create the final output.
methods
- the methods to use for the contentpublic java.lang.Iterable<? extends SevenZMethodConfiguration> getContentMethods()
Currently only SevenZMethod.COPY
, SevenZMethod.LZMA2
, SevenZMethod.BZIP2
and SevenZMethod.DEFLATE
are supported when writing archives.
The methods will be consulted in iteration order to create the final output.
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.util.Date ntfsTimeToJavaTime(long ntfsTime)
ntfsTime
- the NTFS time in 100 nanosecond unitspublic static long javaTimeToNtfsTime(java.util.Date date)
date
- the Java timeCopyright © 2010 - 2023 Adobe. All Rights Reserved