|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.io.apple.AppleFile
public abstract class AppleFile
This abstract class handles AppleSingle/Double files. It contains a common method to verify the Apple file, and figure out if it is an AppleSingle or AppleDouble formatted file.
The AppleSingle format is a representation of Macintosh files as one consecutive stream of bytes. AppleSingle combines the data fork, resource fork and the related Finder meta-file information into a single file.
The AppleDouble format stores the data fork, resource fork as two separate files. AppleDouble leaves the data fork in its original format, and the resource fork and Finder information were combined into a second file.
Apple defined the magic number for the AppleSingle format as 0x00051600, and the magic number for the AppleDouble format as 0x00051607.
AppleSingle file header: Field Length ----- ------ Magic number ------- 4 bytes Version number ------ 4 bytes Filler ------------- 16 bytes Number of entries ----- 2 bytes Entry descriptor for each entry: Entry ID ------ 4 bytes Offset -------- 4 bytes Length -------- 4 bytes Apple reserved entry IDs: Data Fork -------- 1 Data fork Resource Fork ----- 2 Resource fork Real Name -------- 3 File's name as created on home file system Comment --------- 4 Standard Macintosh comment Icon, B&W -------- 5 Standard Macintosh black and white icon Icon, Color -------- 6 Macintosh color icon File Dates Info ------8 File creation date, modification date, and so on Finder Info -------- 9 Standard Macintosh Finder information Macintosh File Info ---10 Macintosh file information, attributes, and so on ProDOS File Info -----11 ProDOS file information, attributes, and so on MS-DOS File Info ----12 MS-DOS file information, attributes, and so on Short Name --------13 AFP short name AFP File Info ------- 14 AFP file information, attributes, and so on Directory ID --------15 AFP directory IDSee RFC 1740 for reference: http://tools.ietf.org/html/rfc1740
Nested Class Summary | |
---|---|
class |
AppleFile.FileDatesInfoEntry
This class represents the file dates. |
static class |
AppleFile.FileFormat
The Apple file format. |
Field Summary | |
---|---|
protected AppleFileData |
afpFileInfo
Entry 14: AFP file information, attributes, and so on. |
protected AppleFileData |
comment
Entry 4: Standard Macintosh comment. |
protected AppleFileData |
dataFork
Entry 1: Data fork. |
protected AppleFileData |
directoryID
Entry 15: AFP directory ID. |
protected AppleFileData |
fileData
The raw Apple file. |
protected AppleFileData |
fileDatesInfo
Entry 8: File creation date, modification date, and so on. |
protected AppleFile.FileDatesInfoEntry |
fileDatesInfoEntry
The file dates info entry. |
protected AppleFileData |
finderInfo
Entry 9: Standard Macintosh Finder information. |
protected AppleFile.FileFormat |
format
The Apple file format: AppleSingle, AppleDouble, default to unknown. |
protected AppleFileData |
iconBW
Entry 5: Standard Macintosh black and white icon. |
protected AppleFileData |
iconColor
Entry 6: Macintosh color icon. |
protected AppleFileData |
macintoshInfo
Entry 10: Macintosh file information, attributes, and so on. |
protected AppleFileData |
msDOSFileInfo
Entry 12: MS-DOS file information, attributes, and so on. |
protected int |
numEntries
The num entries. |
protected AppleFileData |
proDOSFileInfo
Entry 11: ProDOS file information, attributes, and so on. |
protected AppleFileData |
realName
Entry 3: File's name as created on home file system. |
protected AppleFileData |
resourceFork
Entry 2: Resource fork. |
protected AppleFileData |
shortName
Entry 13: AFP short name. |
Constructor Summary | |
---|---|
AppleFile()
|
Method Summary | |
---|---|
protected void |
extractFileDates(byte[] data,
int offset,
int length)
Extract file dates. |
AppleFileData |
getAfpFileInfo()
Gets the afp file info. |
AppleFileData |
getComment()
Gets the comment. |
AppleFileData |
getDataFork()
Gets the data fork. |
AppleFileData |
getDirectoryID()
Gets the directory id. |
AppleFileData |
getFileData()
Gets the file data. |
AppleFileData |
getFileDatesInfo()
Gets the file dates info. |
AppleFileData |
getFinderInfo()
Gets the finder info. |
AppleFile.FileFormat |
getFormat()
Gets the format. |
AppleFileData |
getIconBW()
Gets the icon bw. |
AppleFileData |
getIconColor()
Gets the icon color. |
AppleFileData |
getMacintoshInfo()
Gets the macintosh info. |
AppleFileData |
getMsDOSFileInfo()
Gets the ms dos file info. |
int |
getNumEntries()
Gets the num entries. |
AppleFileData |
getProDOSFileInfo()
Gets the pro dos file info. |
AppleFileData |
getRealName()
Gets the real name. |
AppleFileData |
getResourceFork()
Gets the resource fork. |
AppleFileData |
getShortName()
Gets the short name. |
void |
setAfpFileInfo(AppleFileData afpFileInfo)
Sets the afp file info. |
void |
setComment(AppleFileData comment)
Sets the comment. |
void |
setDataFork(AppleFileData dataFork)
Sets the data fork. |
void |
setDirectoryID(AppleFileData directoryID)
Sets the directory id. |
void |
setFileData(AppleFileData fileData)
Sets the file data. |
void |
setFileDatesInfo(AppleFileData fileDatesInfo)
Sets the file dates info. |
void |
setFinderInfo(AppleFileData finderInfo)
Sets the finder info. |
void |
setFormat(AppleFile.FileFormat format)
Sets the format. |
void |
setIconBW(AppleFileData iconBW)
Sets the icon bw. |
void |
setIconColor(AppleFileData iconColor)
Sets the icon color. |
void |
setMacintoshInfo(AppleFileData macintoshInfo)
Sets the macintosh info. |
void |
setMsDOSFileInfo(AppleFileData msDOSFileInfo)
Sets the ms dos file info. |
void |
setNumEntries(int numEntries)
Sets the num entries. |
void |
setProDOSFileInfo(AppleFileData proDOSFileInfo)
Sets the pro dos file info. |
void |
setRealName(AppleFileData realName)
Sets the real name. |
void |
setResourceFork(AppleFileData resourceFork)
Sets the resource fork. |
void |
setShortName(AppleFileData shortName)
Sets the short name. |
protected void |
verify()
Verify the validity of the Apple file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AppleFile.FileFormat format
protected AppleFileData fileData
protected AppleFileData dataFork
protected AppleFileData resourceFork
protected AppleFileData realName
protected AppleFileData comment
protected AppleFileData iconBW
protected AppleFileData iconColor
protected AppleFileData fileDatesInfo
protected AppleFile.FileDatesInfoEntry fileDatesInfoEntry
protected AppleFileData finderInfo
protected AppleFileData macintoshInfo
protected AppleFileData proDOSFileInfo
protected AppleFileData msDOSFileInfo
protected AppleFileData shortName
protected AppleFileData afpFileInfo
protected AppleFileData directoryID
protected int numEntries
Constructor Detail |
---|
public AppleFile()
Method Detail |
---|
public void setNumEntries(int numEntries)
numEntries
- the new num entriesprotected void verify() throws FileDecoderException
FileDecoderException
- the file decoder exceptionprotected void extractFileDates(byte[] data, int offset, int length)
data
- the dataoffset
- the offsetlength
- the lengthpublic AppleFile.FileFormat getFormat()
public void setFormat(AppleFile.FileFormat format)
format
- the new formatpublic AppleFileData getFileData()
public void setFileData(AppleFileData fileData)
fileData
- the new file datapublic AppleFileData getDataFork()
public void setDataFork(AppleFileData dataFork)
dataFork
- the new data forkpublic AppleFileData getResourceFork()
public void setResourceFork(AppleFileData resourceFork)
resourceFork
- the new resource forkpublic AppleFileData getRealName()
public void setRealName(AppleFileData realName)
realName
- the new real namepublic AppleFileData getComment()
public void setComment(AppleFileData comment)
comment
- the new commentpublic AppleFileData getIconBW()
public void setIconBW(AppleFileData iconBW)
iconBW
- the new icon bwpublic AppleFileData getIconColor()
public void setIconColor(AppleFileData iconColor)
iconColor
- the new icon colorpublic AppleFileData getFileDatesInfo()
public void setFileDatesInfo(AppleFileData fileDatesInfo)
fileDatesInfo
- the new file dates infopublic AppleFileData getFinderInfo()
public void setFinderInfo(AppleFileData finderInfo)
finderInfo
- the new finder infopublic AppleFileData getMacintoshInfo()
public void setMacintoshInfo(AppleFileData macintoshInfo)
macintoshInfo
- the new macintosh infopublic AppleFileData getProDOSFileInfo()
public void setProDOSFileInfo(AppleFileData proDOSFileInfo)
proDOSFileInfo
- the new pro dos file infopublic AppleFileData getMsDOSFileInfo()
public void setMsDOSFileInfo(AppleFileData msDOSFileInfo)
msDOSFileInfo
- the new ms dos file infopublic AppleFileData getShortName()
public void setShortName(AppleFileData shortName)
shortName
- the new short namepublic AppleFileData getAfpFileInfo()
public void setAfpFileInfo(AppleFileData afpFileInfo)
afpFileInfo
- the new afp file infopublic AppleFileData getDirectoryID()
public void setDirectoryID(AppleFileData directoryID)
directoryID
- the new directory idpublic int getNumEntries()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |