public class SevenZArchiveEntry extends Object implements ArchiveEntry
SIZE_UNKNOWN
Constructor and Description |
---|
SevenZArchiveEntry() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Date |
getAccessDate()
Gets the access date.
|
FileTime |
getAccessTime()
Gets the access time.
|
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.
|
Date |
getCreationDate()
Gets the creation date.
|
FileTime |
getCreationTime()
Gets the creation time.
|
boolean |
getHasAccessDate()
Gets whether this entry has got an access date at all.
|
boolean |
getHasCrc()
Gets whether this entry has got a crc.
|
boolean |
getHasCreationDate()
Gets whether this entry has got a creation date at all.
|
boolean |
getHasLastModifiedDate()
Gets whether this entry has got a last modified date at all.
|
boolean |
getHasWindowsAttributes()
Gets whether this entry has windows attributes.
|
Date |
getLastModifiedDate()
Gets the last modified date.
|
FileTime |
getLastModifiedTime()
Gets the last modified time.
|
String |
getName()
Gets this entry's name.
|
long |
getSize()
Gets 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(Date date)
Deprecated.
Use
TimeUtils.toNtfsTime(Date) instead. |
static Date |
ntfsTimeToJavaTime(long ntfsTime)
Deprecated.
Use
TimeUtils.ntfsTimeToDate(long) instead. |
void |
setAccessDate(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 |
setAccessTime(FileTime time)
Sets the access time.
|
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(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(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 |
setCreationTime(FileTime time)
Sets the creation time.
|
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(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 |
setLastModifiedTime(FileTime time)
Sets the last modified time.
|
void |
setName(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 SevenZArchiveEntry()
@Deprecated public static long javaTimeToNtfsTime(Date date)
TimeUtils.toNtfsTime(Date)
instead.date
- the Java timeTimeUtils.toNtfsTime(Date)
@Deprecated public static Date ntfsTimeToJavaTime(long ntfsTime)
TimeUtils.ntfsTimeToDate(long)
instead.ntfsTime
- the NTFS time in 100 nanosecond unitsTimeUtils.ntfsTimeToDate(long)
public Date getAccessDate()
getAccessTime()
, but precision is truncated to milliseconds.UnsupportedOperationException
- if the entry hasn't got an access date.getAccessTime()
public FileTime getAccessTime()
UnsupportedOperationException
- if the entry hasn't got an access time.public 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.
@Deprecated public int getCrc()
public long getCrcValue()
public Date getCreationDate()
getCreationTime()
, but precision is truncated to milliseconds.UnsupportedOperationException
- if the entry hasn't got a creation date.getCreationTime()
public FileTime getCreationTime()
UnsupportedOperationException
- if the entry hasn't got a creation time.public boolean getHasAccessDate()
public boolean getHasCrc()
In general entries without streams don't have a CRC either.
public boolean getHasCreationDate()
public boolean getHasLastModifiedDate()
public boolean getHasWindowsAttributes()
public Date getLastModifiedDate()
getLastModifiedTime()
, but precision is truncated to milliseconds.getLastModifiedDate
in interface ArchiveEntry
UnsupportedOperationException
- if the entry hasn't got a last modified date.getLastModifiedTime()
public FileTime getLastModifiedTime()
UnsupportedOperationException
- if the entry hasn't got a last modified time.public String getName()
This method returns the raw name as it is stored inside of the archive.
getName
in interface ArchiveEntry
public long getSize()
getSize
in interface ArchiveEntry
public int getWindowsAttributes()
public boolean hasStream()
public boolean isAntiItem()
public boolean isDirectory()
isDirectory
in interface ArchiveEntry
public void setAccessDate(Date accessDate)
accessDate
- the new access datesetAccessTime(FileTime)
public void setAccessDate(long ntfsAccessDate)
ntfsAccessDate
- the access datepublic void setAccessTime(FileTime time)
time
- the new access timepublic void setAntiItem(boolean isAntiItem)
isAntiItem
- true if it is an anti-item, false otherwisepublic void setContentMethods(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 content@Deprecated public void setCrc(int crc)
crc
- the CRCpublic void setCrcValue(long crc)
crc
- the CRCpublic void setCreationDate(Date creationDate)
creationDate
- the new creation datesetCreationTime(FileTime)
public void setCreationDate(long ntfsCreationDate)
ntfsCreationDate
- the creation datepublic void setCreationTime(FileTime time)
time
- the new creation timepublic void setDirectory(boolean isDirectory)
isDirectory
- True if this entry is a directory.public void setHasAccessDate(boolean hasAcessDate)
hasAcessDate
- whether this entry has got an access date at all.public void setHasCrc(boolean hasCrc)
hasCrc
- whether this entry has got a crc.public void setHasCreationDate(boolean hasCreationDate)
hasCreationDate
- whether the entry has got a creation datepublic void setHasLastModifiedDate(boolean hasLastModifiedDate)
hasLastModifiedDate
- whether this entry has got a last
modified date at allpublic void setHasStream(boolean hasStream)
hasStream
- whether there is any content associated with this entry.public void setHasWindowsAttributes(boolean hasWindowsAttributes)
hasWindowsAttributes
- whether this entry has windows attributes.public void setLastModifiedDate(Date lastModifiedDate)
lastModifiedDate
- the new last modified datesetLastModifiedTime(FileTime)
public void setLastModifiedDate(long ntfsLastModifiedDate)
ntfsLastModifiedDate
- the last modified datepublic void setLastModifiedTime(FileTime time)
time
- the new last modified timepublic void setName(String name)
name
- This entry's new name.public void setSize(long size)
size
- This entry's new file size.public void setWindowsAttributes(int windowsAttributes)
windowsAttributes
- the windows attributesCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.