Package com.github.stephenc.javaisotools.udflib.structures

Examples of com.github.stephenc.javaisotools.udflib.structures.FileSetDescriptor


    private void writeFilesetDescriptor(RandomAccessFile myRandomAccessFile, long targetBlock, long rootDirectoryBlock,
                                        int partitionNumber, long partitionStartingBlock,
                                        Calendar recordingTimeCalendar, int tagSerialNumber,
                                        byte[] udfVersionIdentifierSuffix, int descriptorVersion)
            throws Exception {
        FileSetDescriptor myFilesetDescriptor = new FileSetDescriptor();

        myFilesetDescriptor.DescriptorTag.TagSerialNumber = tagSerialNumber;
        myFilesetDescriptor.DescriptorTag.DescriptorVersion = descriptorVersion;
        myFilesetDescriptor.DescriptorTag.TagLocation = targetBlock - partitionStartingBlock;

        myFilesetDescriptor.RecordingDateandTime.set(recordingTimeCalendar);
        myFilesetDescriptor.InterchangeLevel = 3;
        myFilesetDescriptor.MaximumInterchangeLevel = 3;
        myFilesetDescriptor.CharacterSetList = 1;
        myFilesetDescriptor.MaximumCharacterSetList = 1;
        myFilesetDescriptor.FileSetNumber = 0;
        myFilesetDescriptor.FileSetDescriptorNumber = 0;

        myFilesetDescriptor.setLogicalVolumeIdentifier(imageIdentifier);
        myFilesetDescriptor.setFileSetIdentifier(imageIdentifier);

        myFilesetDescriptor.RootDirectoryICB.ExtentLength = blockSize;
        myFilesetDescriptor.RootDirectoryICB.ExtentLocation.part_num = partitionNumber;
        myFilesetDescriptor.RootDirectoryICB.ExtentLocation.lb_num = rootDirectoryBlock - partitionStartingBlock;

        myFilesetDescriptor.DomainIdentifier.setIdentifier("*OSTA UDF Compliant");
        myFilesetDescriptor.DomainIdentifier.IdentifierSuffix = udfVersionIdentifierSuffix;

        myRandomAccessFile.seek(targetBlock * blockSize);
        myFilesetDescriptor.write(myRandomAccessFile, blockSize);
    }
View Full Code Here


                catch (IOException myIOException) {
                }
            }
        }

        FileSetDescriptor myFilesetDescriptor = new FileSetDescriptor();

        myFilesetDescriptor.RecordingDateandTime.set(recordingTimeCalendar);
        myFilesetDescriptor.InterchangeLevel = 3;
        myFilesetDescriptor.MaximumInterchangeLevel = 3;
        myFilesetDescriptor.CharacterSetList = 1;
        myFilesetDescriptor.MaximumCharacterSetList = 1;
        myFilesetDescriptor.FileSetNumber = 0;
        myFilesetDescriptor.FileSetDescriptorNumber = 0;

        myFilesetDescriptor.setLogicalVolumeIdentifier(imageIdentifier);
        myFilesetDescriptor.setFileSetIdentifier(imageIdentifier);

        myFilesetDescriptor.RootDirectoryICB.ExtentLength = blockSize;
        myFilesetDescriptor.RootDirectoryICB.ExtentLocation.part_num = partitionToStoreMetadataOn;
        myFilesetDescriptor.RootDirectoryICB.ExtentLocation.lb_num = rootDirectoryLocation;

        try {
            myFilesetDescriptor.DomainIdentifier.setIdentifier("*OSTA UDF Compliant");
        }
        catch (Exception myException) {
            throw new HandlerException(myException);
        }

        myFilesetDescriptor.DomainIdentifier.IdentifierSuffix = udfVersionIdentifierSuffix;

        /*
          // full element with descriptor tag
          myFilesetDescriptor.DescriptorTag.TagSerialNumber = tagSerialNumber;
          myFilesetDescriptor.DescriptorTag.DescriptorVersion = descriptorVersion;
          myFilesetDescriptor.DescriptorTag.TagLocation = tagLocation;
          super.data( new ByteArrayDataReference( myFilesetDescriptor.getBytes( blockSize ) ) );
          */

        // without descriptor tag (handled in next pipeline section)
        super.startElement(new SabreUDFElement(SabreUDFElement.UDFElementType.DescriptorTag));
        super.data(new WordDataReference(256));                    // tag identifier
        super.data(new WordDataReference(tagLocation));            // tag location
        super.data(new WordDataReference(tagSerialNumber));        // tag serial number
        super.data(new WordDataReference(descriptorVersion));    // descriptor version
        super.data(new ByteArrayDataReference(myFilesetDescriptor.getBytesWithoutDescriptorTag()));
        super.endElement();
    }
View Full Code Here

TOP

Related Classes of com.github.stephenc.javaisotools.udflib.structures.FileSetDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.