org.at4j.zip
Class ZipInternalFileAttributes

java.lang.Object
  extended by org.at4j.zip.ZipInternalFileAttributes

public class ZipInternalFileAttributes
extends Object

This object represents a ZipEntry's internal file attributes. It contains boolean properties about the Zip entry.

Despite the "file" in the name, this kind of attributes is used for all Zip entry types.

Since:
1.0
Author:
Karl Gustafsson

Constructor Summary
ZipInternalFileAttributes()
          Create an internal file attributes object with all property values set to false.
ZipInternalFileAttributes(UnsignedShort s)
          Create an internal file attributes object with the property values parsed from the supplied short object read from a Zip file.
 
Method Summary
 UnsignedShort getEncodedValue()
          Get the internal file attributes encoded for storing in a Zip file.
 boolean isRecordsPrecededByLengthControlField()
           The 0x0002 bit of this field indicates, if set, that a 4 byte variable record length control field precedes each logical record indicating the length of the record.
 boolean isTextFile()
           The lowest bit of this field indicates, if set, that the file is apparently an ASCII or text file.
 void setRecordsPrecededByLengthControlField(boolean b)
           
 void setTextFile(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipInternalFileAttributes

public ZipInternalFileAttributes()
Create an internal file attributes object with all property values set to false.


ZipInternalFileAttributes

public ZipInternalFileAttributes(UnsignedShort s)
Create an internal file attributes object with the property values parsed from the supplied short object read from a Zip file.

Parameters:
s - The short object, read from a Zip file.
Method Detail

isTextFile

public boolean isTextFile()
 The lowest bit of this field indicates, if set, that
 the file is apparently an ASCII or text file.  If not
 set, that the file apparently contains binary data.
 The remaining bits are unused in version 1.0.
 

Returns:
true if the file is apparently an ASCII or text file.

setTextFile

public void setTextFile(boolean b)

isRecordsPrecededByLengthControlField

public boolean isRecordsPrecededByLengthControlField()
 The 0x0002 bit of this field indicates, if set, that a 
 4 byte variable record length control field precedes each 
 logical record indicating the length of the record. The 
 record length control field is stored in little-endian byte
 order.  This flag is independent of text control characters, 
 and if used in conjunction with text data, includes any 
 control characters in the total length of the record. This 
 value is provided for mainframe data transfer support.
 

Returns:
true if each logical record is preceded by a 4 byte variable record length control field.

setRecordsPrecededByLengthControlField

public void setRecordsPrecededByLengthControlField(boolean b)

getEncodedValue

public UnsignedShort getEncodedValue()
Get the internal file attributes encoded for storing in a Zip file.

Returns:
The numerical value for this set of internal file attributes.