Package com.cloud.bridge.service.exception

Examples of com.cloud.bridge.service.exception.FileNotExistException


    public DataHandler loadObject(String mountedRoot, String bucket, String fileName) {
        try {
            return new DataHandler(new URL(castorURL(mountedRoot, bucket, fileName)));
        } catch (MalformedURLException e) {
            s_logger.error("Failed to loadObject from CAStor", e);
            throw new FileNotExistException("Unable to load object from CAStor: " + e.getMessage());
        }
    }
View Full Code Here


            GetMethod method = new GetMethod(castorURL(mountedRoot, bucket, fileName));
            method.addRequestHeader("Range", "bytes=" + startPos + "-" + endPos);
            int statusCode = httpClient.executeMethod(method);
            if (statusCode < HTTP_OK || statusCode >= HTTP_UNSUCCESSFUL) {
                s_logger.error("CAStor loadObjectRange response: "+  statusCode);
                throw new FileNotExistException("CAStor loadObjectRange response: " + statusCode);
            }
            return new DataHandler(new ScspDataSource(method));
        } catch (Exception e) {
            s_logger.error("CAStor loadObjectRange failure", e);
            throw new FileNotExistException("CAStor loadObjectRange failure: " + e);
        }
    }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.exception.FileNotExistException

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.