Examples of BlobException


Examples of com.alexkasko.springjdbc.blob.BlobException

    /**
     * {@inheritDoc}
     */
    @Override
    public OutputStream wrapCompress(OutputStream out) {
        if(null == out) throw new BlobException("Provided OutputStream is null");
        try {
            return wrapCompressInternal(out);
        } catch (Exception e) {
            if(e instanceof BlobException) throw (BlobException) e;
            throw new BlobException("Error on compressing", e);
        }
    }
View Full Code Here

Examples of com.alexkasko.springjdbc.blob.BlobException

    /**
     * {@inheritDoc}
     */
    @Override
    public InputStream wrapDecompress(InputStream in) {
        if(null == in) throw new BlobException("Provided InputStream is null");
        try {
            return wrapDecompressInternal(in);
        } catch (Exception e) {
            if(e instanceof BlobException) throw (BlobException) e;
            throw new BlobException("Error on decompressing", e);
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.BlobException

        blobKey = Bytes.add(blobKey, Bytes.toBytes(uuid.getLeastSignificantBits()));
        FSDataOutputStream fsDataOutputStream;
        try {
            fsDataOutputStream = fileSystem.create(createPath(uuid));
        } catch (IOException e) {
            throw new BlobException("Failed to open an outputstream for blob '" + blob + "' on the DFS blobstore", e);
        }
        return new DFSBlobOutputStream(fsDataOutputStream, blobKey, blob);
    }
View Full Code Here

Examples of org.lilyproject.repository.api.BlobException

    public InputStream getInputStream(byte[] blobKey) throws BlobException {
        UUID uuid = decode(blobKey);
        try {
            return fileSystem.open(createPath(uuid));
        } catch (IOException e) {
            throw new BlobException("Failed to open an inputstream for blobkey '" + Hex.encodeHexString(blobKey) + "' on the DFS blobstore", e);
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.BlobException

    public void delete(byte[] blobKey) throws BlobException {
        UUID uuid = decode(blobKey);
        try {
            fileSystem.delete(createPath(uuid), false);
        } catch (IOException e) {
            throw new BlobException("Failed to delete blob with key '" + Hex.encodeHexString(blobKey) +"' from the DFS blobstore", e);
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.BlobException

        }
        Pair<String, byte[]> decodedKey;
        try {
            decodedKey = decode(blob.getValue());
        } catch (Exception e) {
            throw new BlobException("Failed to decode the blobkey of the blob '" + blob + "'", e);
        }
        return decodedKey;
    }
View Full Code Here

Examples of org.lilyproject.repository.api.BlobException

    @Override
    public BlobAccess getBlobAccess(Record record, QName fieldName, FieldType fieldType, int...indexes)
            throws BlobException {
        if (!(fieldType.getValueType().getDeepestValueType() instanceof BlobValueType)) {
            throw new BlobException("Cannot read a blob from a non-blob field type: " + fieldType.getName());
        }

        Blob blob = getBlobFromRecord(record, fieldName, fieldType, indexes);
        return registry.getBlobAccess(blob);
    }
View Full Code Here

Examples of org.lilyproject.repository.api.BlobException

        get.addColumn(BLOBS_COLUMN_FAMILY_BYTES, BLOB_COLUMN);
        Result result;
        try {
            result = table.get(get);
        } catch (IOException e) {
            throw new BlobException("Failed to open an inputstream for blobkey '" + Hex.encodeHexString(blobKey) + "' on the HBASE blobstore", e);
        }
        byte[] value = result.getValue(BLOBS_COLUMN_FAMILY_BYTES, BLOB_COLUMN);
        if (value == null) {
            throw new BlobException("Failed to open an inputstream for blobkey '" + Hex.encodeHexString(blobKey) + "' since no blob was found on the HBASE blobstore");
        }
        return new ByteArrayInputStream(value);
    }
View Full Code Here

Examples of org.lilyproject.repository.api.BlobException

    public void delete(byte[] blobKey) throws BlobException {
        Delete delete = new Delete(blobKey);
        try {
            table.delete(delete);
        } catch (IOException e) {
            throw new BlobException("Failed to delete blob with key '" + Hex.encodeHexString(blobKey) + "' from the DFS blobstore", 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.