Package com.github.stephenc.javaisotools.sabre

Examples of com.github.stephenc.javaisotools.sabre.HandlerException


                }

                inputStream.close();
            }
        } catch (IOException e) {
            throw new HandlerException(e);
        }

        // Delegate to super class
        super.data(reference);
    }
View Full Code Here


    public void endDocument() throws HandlerException {
        try {
            this.outputStream.flush();
            this.outputStream.close();
        } catch (IOException e) {
            throw new HandlerException(e);
        }

        // Delegate to super class
        super.endDocument();
    }
View Full Code Here

        long length = 0;

        // Show what is happening
        length = reference.getLength();
        if (length == -1) {
            throw new HandlerException("Cannot fixup unknown length.");
        }
        System.out.println("fixup @" + this.position + " for " + length);

        // Delegate to super class
        fixup = super.fixup(reference);
View Full Code Here

        id = new Object();
        enforce8plus3 = false;
        isMovedDirectory = false;

        if (isDirectory()) {
            throw new HandlerException("Cannot wrap a directory in " + getClass());
        }
    }
View Full Code Here

     *
     * @throws HandlerException Invalid file version
     */
    public void setVersion(int version) throws HandlerException {
        if (version < 1 || version > ISO9660Constants.MAX_FILE_VERSION) {
            throw new HandlerException("Invalid file version: " + version);
        }
        this.version = version;

        if (parent != null) {
            parent.forceSort();
View Full Code Here

            tagLocation = BinaryTools.readUInt32AsLong(myInputStream);
            myInputStream.close();
            myInputStream = null;
        }
        catch (IOException myIOException) {
            throw new HandlerException(myIOException);
        }
        finally {
            if (myInputStream != null) {
                try {
                    myInputStream.close();
View Full Code Here

            tagLocation = BinaryTools.readUInt32AsLong(myInputStream);
            myInputStream.close();
            myInputStream = null;
        }
        catch (IOException myIOException) {
            throw new HandlerException(myIOException);
        }
        finally {
            if (myInputStream != null) {
                try {
                    myInputStream.close();
                }
                catch (IOException myIOException) {
                }
            }
        }

        PrimaryVolumeDescriptor myPrimaryVolumeDescriptor = new PrimaryVolumeDescriptor();

        myPrimaryVolumeDescriptor.VolumeDescriptorSequenceNumber = volumeDescriptorSequenceNumber;
        myPrimaryVolumeDescriptor.PrimaryVolumeDescriptorNumber = 0;
        myPrimaryVolumeDescriptor.VolumeSequenceNumber = 1;
        myPrimaryVolumeDescriptor.MaximumVolumeSequenceNumber = 1;
        myPrimaryVolumeDescriptor.InterchangeLevel = 2;
        myPrimaryVolumeDescriptor.MaximumInterchangeLevel = 3;
        myPrimaryVolumeDescriptor.CharacterSetList = 1;
        myPrimaryVolumeDescriptor.MaximumCharacterSetList = 1;

        String volumeSetIdentifier = Long.toHexString(recordingTimeCalendar.getTimeInMillis()) + " " + imageIdentifier;

        try {
            myPrimaryVolumeDescriptor.setVolumeIdentifier(imageIdentifier);
            myPrimaryVolumeDescriptor.setVolumeSetIdentifier(volumeSetIdentifier);
            myPrimaryVolumeDescriptor.ApplicationIdentifier.setIdentifier(applicationIdentifier);
            myPrimaryVolumeDescriptor.ImplementationIdentifier.setIdentifier(applicationIdentifier);
        }
        catch (Exception myException) {
            throw new HandlerException(myException);
        }

        myPrimaryVolumeDescriptor.ApplicationIdentifier.IdentifierSuffix = applicationIdentifierSuffix;

        myPrimaryVolumeDescriptor.RecordingDateandTime.set(recordingTimeCalendar);
View Full Code Here

            tagLocation = BinaryTools.readUInt32AsLong(myInputStream);
            myInputStream.close();
            myInputStream = null;
        }
        catch (IOException myIOException) {
            throw new HandlerException(myIOException);
        }
        finally {
            if (myInputStream != null) {
                try {
                    myInputStream.close();
                }
                catch (IOException myIOException) {
                }
            }
        }

        PartitionDescriptor myPartitionDescriptor = new PartitionDescriptor();

        myPartitionDescriptor.VolumeDescriptorSequenceNumber = volumeDescriptorSequenceNumber;
        myPartitionDescriptor.PartitionFlags = 1;
        myPartitionDescriptor.PartitionNumber = 0;

        try {
            myPartitionDescriptor.PartitionContents.setIdentifier("+NSR02");
            myPartitionDescriptor.ImplementationIdentifier.setIdentifier(applicationIdentifier);
        }
        catch (Exception myException) {
            throw new HandlerException(myException);
        }

        myPartitionDescriptor.AccessType = 1; // read only
        myPartitionDescriptor.PartitonStartingLocation = partitionStartingBlock;
        myPartitionDescriptor.PartitionLength = partitionEndingBlock - partitionStartingBlock;
View Full Code Here

            tagLocation = BinaryTools.readUInt32AsLong(myInputStream);
            myInputStream.close();
            myInputStream = null;
        }
        catch (IOException myIOException) {
            throw new HandlerException(myIOException);
        }
        finally {
            if (myInputStream != null) {
                try {
                    myInputStream.close();
                }
                catch (IOException myIOException) {
                }
            }
        }

        LogicalVolumeDescriptor myLogicalVolumeDescriptor = new LogicalVolumeDescriptor();

        try {

            myLogicalVolumeDescriptor.VolumeDescriptorSequenceNumber = volumeDescriptorSequenceNumber;
            myLogicalVolumeDescriptor.setLogicalVolumeIdentifier(imageIdentifier);
            myLogicalVolumeDescriptor.LogicalBlockSize = blockSize;

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

            myLogicalVolumeDescriptor.LogicalVolumeContentsUse.ExtentLength = blockSize;
            myLogicalVolumeDescriptor.LogicalVolumeContentsUse.ExtentLocation.part_num = fileSetDescriptorPartition;
            myLogicalVolumeDescriptor.LogicalVolumeContentsUse.ExtentLocation.lb_num = fileSetDescriptorLocation;

            myLogicalVolumeDescriptor.ImplementationIdentifier.setIdentifier(applicationIdentifier);
            myLogicalVolumeDescriptor.ImplementationIdentifier.IdentifierSuffix = applicationIdentifierSuffix;

            // partition map type 1, length 6, volume sequence number 0, partition number 0
            PartitionMapType1 myPartitionMapType1 = new PartitionMapType1();
            byte myPartitionMapType1Bytes[] = myPartitionMapType1.getBytes();

            if (mainMetadataFileLocation > 0) {
                PartitionMapType2 myPartitionMapType2 = new PartitionMapType2();
                EntityID partitionTypeIdentifier = new EntityID();
                partitionTypeIdentifier.setIdentifier("*UDF Metadata Partition");
                partitionTypeIdentifier.IdentifierSuffix = udfVersionIdentifierSuffix;
                myPartitionMapType2.setupMetadataPartitionMap(partitionTypeIdentifier, 1, 0, mainMetadataFileLocation,
                        mirrorMetadataFileLocation, 0xFFFFFFFF, metadataAllocationUnitSize, metadataAlignmentUnitSize,
                        (byte) 0);
                byte myPartitionMapType2Bytes[] = myPartitionMapType2.getBytes();

                myLogicalVolumeDescriptor.NumberofPartitionMaps = 2;
                myLogicalVolumeDescriptor.PartitionMaps =
                        new byte[myPartitionMapType1Bytes.length + myPartitionMapType2Bytes.length];

                System.arraycopy(myPartitionMapType1Bytes, 0, myLogicalVolumeDescriptor.PartitionMaps, 0,
                        myPartitionMapType1Bytes.length);
                System.arraycopy(myPartitionMapType2Bytes, 0, myLogicalVolumeDescriptor.PartitionMaps, 6,
                        myPartitionMapType2Bytes.length);
            } else {
                myLogicalVolumeDescriptor.NumberofPartitionMaps = 1;
                myLogicalVolumeDescriptor.PartitionMaps = myPartitionMapType1Bytes;
            }
        }
        catch (Exception myException) {
            throw new HandlerException(myException);
        }

        myLogicalVolumeDescriptor.MapTableLength = myLogicalVolumeDescriptor.PartitionMaps.length;

        myLogicalVolumeDescriptor.IntegritySequenceExtent.loc = logicalVolumeIntegritySequenceStartingBlock;
View Full Code Here

            tagLocation = BinaryTools.readUInt32AsLong(myInputStream);
            myInputStream.close();
            myInputStream = null;
        }
        catch (IOException myIOException) {
            throw new HandlerException(myIOException);
        }
        finally {
            if (myInputStream != null) {
                try {
                    myInputStream.close();
View Full Code Here

TOP

Related Classes of com.github.stephenc.javaisotools.sabre.HandlerException

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.