org.apache.commons.compress.archivers.sevenz
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 String getName()
getName
in interface ArchiveEntry
public 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 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 ait-item, false otherwisepublic boolean getHasCreationDate()
public void setHasCreationDate(boolean hasCreationDate)
public Date getCreationDate()
UnsupportedOperationException
- if the entry hasn't got a
creation date.public void setCreationDate(long ntfsCreationDate)
public void setCreationDate(Date creationDate)
public boolean getHasLastModifiedDate()
public void setHasLastModifiedDate(boolean hasLastModifiedDate)
public Date getLastModifiedDate()
getLastModifiedDate
in interface ArchiveEntry
UnsupportedOperationException
- if the entry hasn't got a
last modified date.public void setLastModifiedDate(long ntfsLastModifiedDate)
public void setLastModifiedDate(Date lastModifiedDate)
public boolean getHasAccessDate()
public void setHasAccessDate(boolean hasAcessDate)
public Date getAccessDate()
UnsupportedOperationException
- if the entry hasn't got a
access date.public void setAccessDate(long ntfsAccessDate)
public void setAccessDate(Date accessDate)
public boolean getHasWindowsAttributes()
public void setHasWindowsAttributes(boolean hasWindowsAttributes)
public int getWindowsAttributes()
public void setWindowsAttributes(int windowsAttributes)
public boolean getHasCrc()
public void setHasCrc(boolean hasCrc)
@Deprecated public int getCrc()
@Deprecated public void setCrc(int crc)
public long getCrcValue()
public void setCrcValue(long crc)
public long getSize()
getSize
in interface ArchiveEntry
public 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.
The methods will be consulted in iteration order to create the final output.
public Iterable<? extends SevenZMethodConfiguration> getContentMethods()
Currently only SevenZMethod.COPY
, SevenZMethod.LZMA2
, SevenZMethod.BZIP2
and SevenZMethod.DEFLATE
are supported.
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 © 2014 The Apache Software Foundation. All rights reserved.