Package com.github.stephenc.javaisotools.sabre

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


                    bytesToRead = (int) lengthToWrite;
                }

                bytesHandled = inputStream.read(buffer, 0, bytesToRead);
                if (bytesHandled == -1) {
                    throw new HandlerException("Cannot read all data from reference.");
                }

                dataOutputStream.write(buffer, 0, bytesHandled);
                lengthToWrite -= bytesHandled;
                position += bytesHandled;
            }
            dataOutputStream.flush();
        } catch (IOException e) {
            throw new HandlerException(e);
        } finally {
            try {
                if (inputStream != null) {
                    inputStream.close();
                    inputStream = null;
View Full Code Here


    public void endDocument() throws HandlerException {
        try {
          this.raFile.close();
            this.dataOutputStream.close();
        } catch (IOException e) {
            throw new HandlerException(e);
        }
    }
View Full Code Here

            file.enforce8plus3(true);
            id = helper.getFilenameDataReference(file).getName();
            buf.put(helper.pad(id, 127));
            bytes = buf.array();
        } else {
            throw new HandlerException(
                    "String or ISO9660File expected in getIdOrFile, got "
                            + object.getClass());
        }

        return new ByteArrayDataReference(bytes);
View Full Code Here

            this.filenameDataReference = new ByteDataReference(0);
        } else if (object == ISO9660Constants.FI_DOTDOT) {
            // "dotdot", i.e. the parent directory
            this.filenameDataReference = new ByteDataReference(1);
        } else {
            throw new HandlerException("Unknown special directory type, neither ROOT nor DOT nor DOTDOT: " + object);
        }
    }
View Full Code Here

            this.filename = new ByteDataReference(0);
        } else if (object == ISO9660Constants.FI_DOTDOT) {
            // "dotdot", i.e. the parent directory
            this.filename = new ByteDataReference(1);
        } else {
            throw new HandlerException("Unknown special directory type, must be one of ROOT, DOT, DOTDOT: " + type);
        }

        setType(type);
        setParent(parent);
    }
View Full Code Here

    }

    private void setType(Object type) throws HandlerException {
        if (!type.equals(ISO9660Constants.TYPE_L_PT) &&
                !type.equals(ISO9660Constants.TYPE_M_PT)) {
            throw new HandlerException("Unknown Path Table type: " + type);
        }
        this.type = type;
    }
View Full Code Here

        this.type = type;
    }

    private void setParent(int parent) throws HandlerException {
        if (parent < 0) {
            throw new HandlerException("Invalid parent directory number.");
        }
        this.parent = parent;
    }
View Full Code Here

            Fixup ptLocationFixup = (Fixup) volumeFixups.get("typeMPTLocationFixup");
            ptLocationFixup.data(new WordDataReference(location));
            ptLocationFixup.close();
            volumeFixups.remove("typeMPTLocationFixup");
        } else {
            throw new HandlerException("Unknown Path Table Type: " + type);
        }

        HashMap parentMapper = new HashMap();
        ISO9660Directory dir = root;
        int dirNumber = 1;
View Full Code Here

                }
            } else if (object instanceof ISO9660File) {
                ISO9660File file = (ISO9660File) object;
                doDRLengthFixup(doDR(file));
            } else {
                throw new HandlerException("Neither file nor directory: " + object);
            }
        }

        streamHandler.endElement();
View Full Code Here

            streamHandler.data(new ByteDataReference(0));
            drLength++;
        }

        if (drLength > 0xFF) {
            throw new HandlerException("Invalid Directory Record Length: " + drLength);
        }

        // Write and close Directory Record Length Fixup
        Fixup drLengthFixup = (Fixup) memory.get("drLengthFixup");
        drLengthFixup.data(new ByteDataReference(drLength));
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.