public class SevenZArchiveEntry extends Object implements ArchiveEntry
SIZE_UNKNOWN| Constructor and Description |
|---|
SevenZArchiveEntry() |
| Modifier and Type | Method and Description |
|---|---|
Date |
getAccessDate()
Gets the access date.
|
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.
|
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.
|
Date |
getLastModifiedDate()
Gets the last modified date.
|
String |
getName()
Get this entry's name.
|
long |
getSize()
Get this entry's file size.
|
int |
getWindowsAttributes()
Gets the windows attributes.
|
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)
Converts Java time to NTFS time.
|
static Date |
ntfsTimeToJavaTime(long ntfsTime)
Converts NTFS time (100 nanosecond units since 1 January 1601)
to Java time.
|
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 |
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 |
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 |
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 |
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()
public String getName()
This method returns the raw name as it is stored inside of the archive.
getName in interface ArchiveEntrypublic void setName(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 ArchiveEntrypublic 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 Date getCreationDate()
UnsupportedOperationException - if the entry hasn't got a
creation date.public void setCreationDate(long ntfsCreationDate)
ntfsCreationDate - the creation datepublic void setCreationDate(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 Date getLastModifiedDate()
getLastModifiedDate in interface ArchiveEntryUnsupportedOperationException - if the entry hasn't got a
last modified date.public void setLastModifiedDate(long ntfsLastModifiedDate)
ntfsLastModifiedDate - the last modified datepublic void setLastModifiedDate(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 Date getAccessDate()
UnsupportedOperationException - if the entry hasn't got a
access date.public void setAccessDate(long ntfsAccessDate)
ntfsAccessDate - the access datepublic void setAccessDate(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 ArchiveEntrypublic void setSize(long size)
size - This entry's new file size.public 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 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 static Date ntfsTimeToJavaTime(long ntfsTime)
ntfsTime - the NTFS time in 100 nanosecond unitspublic static long javaTimeToNtfsTime(Date date)
date - the Java timeCopyright © 2018 The Apache Software Foundation. All rights reserved.