fileType = 1;
}
if (myUDFImageBuilderFile.getFileType() == UDFImageBuilderFile.FileType.File) {
myStreamHandler.data(new FileDataReference(myUDFImageBuilderFile.getSourceFile())); // source file
myStreamHandler.data(new WordDataReference(dataLocation)); // data location
} else if (myUDFImageBuilderFile.getFileType() == UDFImageBuilderFile.FileType.Directory) {
// get child files and pass required information
UDFImageBuilderFile[] childUDFImageBuilderFiles = myUDFImageBuilderFile.getChilds();
for (int i = childUDFImageBuilderFiles.length - 1; i >= 0; --i) {
long childFileUniqueId = myUDFLayoutInformation.uniqueIds.get(childUDFImageBuilderFiles[i]);
long childFileLocation =
myUDFLayoutInformation.fileEntryPositions.get(childUDFImageBuilderFiles[i]).entryLocation;
int childFileType = -1;
if (childUDFImageBuilderFiles[i].getFileType() == UDFImageBuilderFile.FileType.File) {
childFileType = 0;
} else if (childUDFImageBuilderFiles[i].getFileType() == UDFImageBuilderFile.FileType.Directory) {
childFileType = 1;
}
myStreamHandler.data(new DWordDataReference(
childFileUniqueId)); // child file unique id
myStreamHandler.data(new WordDataReference(
childFileLocation)); // child fileentry location
myStreamHandler.data(new ByteArrayDataReference(
childUDFImageBuilderFiles[i].getIdentifier().getBytes())); // child file identifier
myStreamHandler.data(new WordDataReference(
childFileType)); // child file type
}
myStreamHandler
.data(new WordDataReference(childUDFImageBuilderFiles.length)); // number of child files
// get and pass parent directory information
long parentDirectoryUniqueId = 0;
long parentDirectoryLocation =
myUDFLayoutInformation.fileEntryPositions.get(myUDFImageBuilderFile).entryLocation;
if (myUDFImageBuilderFile.getParent() != null) {
parentDirectoryUniqueId = myUDFLayoutInformation.uniqueIds.get(myUDFImageBuilderFile.getParent());
parentDirectoryLocation =
myUDFLayoutInformation.fileEntryPositions.get(myUDFImageBuilderFile.getParent()).entryLocation;
}
myStreamHandler.data(new DWordDataReference(parentDirectoryUniqueId));
myStreamHandler.data(new WordDataReference(parentDirectoryLocation));
myStreamHandler.data(new WordDataReference(
myUDFLayoutInformation.partitionToStoreMetadataOn)); // partition to store metadata on
myStreamHandler
.data(new WordDataReference(dataLocation)); // data location
}
myStreamHandler.data(new WordDataReference(selfBlock)); // element location
myStreamHandler.data(new WordDataReference(fileLinkCount)); // file link count
myStreamHandler.data(new DWordDataReference(accessTimeMillis)); // access time
myStreamHandler.data(new DWordDataReference(modificationTimeMillis)); // modification time
myStreamHandler.data(new DWordDataReference(attributeTimeMillis)); // attribute time
myStreamHandler.data(new DWordDataReference(creationTimeMillis)); // creation time
myStreamHandler.data(new DWordDataReference(uniqueId)); // unique id
myStreamHandler
.data(new ByteArrayDataReference(applicationIdentifier.getBytes())); // application identifier
myStreamHandler.data(new ByteArrayDataReference(
applicationIdentifierSuffix)); // application identifier suffix
myStreamHandler.data(new WordDataReference(fileType)); // file type
myStreamHandler.data(new WordDataReference(
myUDFLayoutInformation.partitionToStoreMetadataOn)); // partition number of partition to store metadata on
}