Examples of IOExceptionWithCause


Examples of org.apache.commons.io.IOExceptionWithCause

                                    }
                                } catch (Exception e) {
                                    String msg = "Error while storing blob. id="
                                            + state.getId() + " idx=" + i + " size=" + size;
                                    log.error(msg, e);
                                    throw new IOExceptionWithCause(msg, e);
                                }
                                try {
                                    // replace value instance with value
                                    // backed by resource in blob store and delete temp file
                                    if (blobStore instanceof ResourceBasedBLOBStore) {
                                        values[i] = InternalValue.create(((ResourceBasedBLOBStore) blobStore).getResource(blobId));
                                    } else {
                                        values[i] = InternalValue.create(blobStore.get(blobId));
                                    }
                                } catch (Exception e) {
                                    log.error("Error while reloading blob. truncating. id="
                                            + state.getId() + " idx=" + i + " size=" + size, e);
                                    values[i] = InternalValue.create(new byte[0]);
                                }
                                val.discard();
                            }
                            // store id of blob as property value
                            writeString(blobId);   // value
                        } else {
                            // delete evt. blob
                            byte[] data = writeSmallBinary(val, state, i);
                            // replace value instance with value
                            // backed by resource in blob store and delete temp file
                            values[i] = InternalValue.create(data);
                            val.discard();
                        }
                    } catch (RepositoryException e) {
                        String msg = "Error while storing blob. id="
                            + state.getId() + " idx=" + i + " value=" + val;
                        log.error(msg, e);
                        throw new IOExceptionWithCause(msg, e);
                    }
                    break;
                case PropertyType.DOUBLE:
                    try {
                        out.writeDouble(val.getDouble());
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

   
    private static IOException convertToIOException(int propertyType, Exception e) {
        String typeName = PropertyType.nameFromValue(propertyType);
        String message = "Unexpected error for property type "+ typeName +" value.";
        log.error(message, e);
        return new IOExceptionWithCause(message, e);
    }
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

            return data;
        } catch (Exception e) {
            String msg = "Error while storing blob. id="
                    + state.getId() + " idx=" + i + " value=" + value;
            log.error(msg, e);
            throw new IOExceptionWithCause(msg, e);
        }
    }
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

    public static Name indexToName(int index) throws IOException {
        try {
            return NAME_ARRAY[index];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new IOExceptionWithCause(
                    "Invalid common JCR name index: " + index, e);
        }
    }
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

                                val = InternalValue.create(new byte[0]);
                            } else {
                                throw e;
                            }
                        } catch (Exception e) {
                            throw new IOExceptionWithCause("Unable to create property value: " + e.toString(), e);
                        }
                    } else {
                        // short values into memory
                        byte[] data = new byte[size];
                        in.readFully(data);
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

    public void close() throws IOException {
        if (fs != null) {
            try {
                fs.close();
            } catch (FileSystemException e) {
                throw new IOExceptionWithCause(
                        "Unable to close search index file system: " + fs, e);
            }
        }
    }
View Full Code Here

Examples of org.apache.tika.io.IOExceptionWithCause

    @Override
    protected void startDocument(PDDocument pdf) throws IOException {
        try {
            handler.startDocument();
        } catch (SAXException e) {
            throw new IOExceptionWithCause("Unable to start a document", e);
        }
    }
View Full Code Here

Examples of org.apache.tika.io.IOExceptionWithCause

            if (config.getExtractAcroFormContent() == true){
                extractAcroForm(pdf, handler);
             }
            handler.endDocument();
        } catch (TikaException e){
           throw new IOExceptionWithCause("Unable to end a document", e);
        } catch (SAXException e) {
            throw new IOExceptionWithCause("Unable to end a document", e);
        }
    }
View Full Code Here

Examples of org.apache.tika.io.IOExceptionWithCause

    @Override
    protected void startPage(PDPage page) throws IOException {
        try {
            handler.startElement("div", "class", "page");
        } catch (SAXException e) {
            throw new IOExceptionWithCause("Unable to start a page", e);
        }
        writeParagraphStart();
    }
View Full Code Here

Examples of org.apache.tika.io.IOExceptionWithCause

                    }
                }
            }
            handler.endElement("div");
        } catch (SAXException e) {
            throw new IOExceptionWithCause("Unable to end a page", e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.