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


        int statusCode;
        try {
            statusCode = httpClient.executeMethod(method);
        } catch (HttpException e) {
            s_logger.error("CAStor loadObjectRange failure", e);
            throw new FileNotExistException("CAStor loadObjectRange failure: " + e);
        } catch (IOException e) {
            s_logger.error("CAStor loadObjectRange failure", e);
            throw new FileNotExistException("CAStor loadObjectRange failure: " + e);
        }
        if (statusCode < HTTP_OK || statusCode >= HTTP_UNSUCCESSFUL) {
            s_logger.error("CAStor loadObjectRange response: "+  statusCode);
            throw new FileNotExistException("CAStor loadObjectRange response: " + statusCode);
        }
        DataHandler ret = new DataHandler(new ScspDataSource(method));
        method.releaseConnection();
        return ret;
    }
View Full Code Here

  public DataHandler loadObject(String mountedRoot, String bucket, String fileName) {
    File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName);
    try {
      return new DataHandler(file.toURL());
    } catch (MalformedURLException e) {
      throw new FileNotExistException("Unable to open underlying object file");
    }
  }
View Full Code Here

    File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName);
    try {
      DataSource ds = new FileRangeDataSource(file, startPos, endPos);
      return new DataHandler(ds);
    } catch (MalformedURLException e) {
      throw new FileNotExistException("Unable to open underlying object file");
    } catch(IOException e) {
      throw new FileNotExistException("Unable to open underlying object file");
    }
  }
View Full Code Here

    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

        int statusCode;
        try {
            statusCode = httpClient.executeMethod(method);
        } catch (HttpException e) {
            s_logger.error("CAStor loadObjectRange failure", e);
            throw new FileNotExistException("CAStor loadObjectRange failure: " + e);
        } catch (IOException e) {
            s_logger.error("CAStor loadObjectRange failure", e);
            throw new FileNotExistException("CAStor loadObjectRange failure: " + e);
        }
        if (statusCode < HTTP_OK || statusCode >= HTTP_UNSUCCESSFUL) {
            s_logger.error("CAStor loadObjectRange response: " + statusCode);
            throw new FileNotExistException("CAStor loadObjectRange response: " + statusCode);
        }
        DataHandler ret = new DataHandler(new ScspDataSource(method));
        method.releaseConnection();
        return ret;
    }
View Full Code Here

    public DataHandler loadObject(String mountedRoot, String bucket, String fileName) {
        File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName);
        try {
            return new DataHandler(file.toURL());
        } catch (MalformedURLException e) {
            throw new FileNotExistException("Unable to open underlying object file");
        }
    }
View Full Code Here

        File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName);
        try {
            DataSource ds = new FileRangeDataSource(file, startPos, endPos);
            return new DataHandler(ds);
        } catch (MalformedURLException e) {
            throw new FileNotExistException("Unable to open underlying object file");
        } catch (IOException e) {
            throw new FileNotExistException("Unable to open underlying object file");
        }
    }
View Full Code Here

  public DataHandler loadObject(String mountedRoot, String bucket, String fileName) {
    File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName);
    try {
      return new DataHandler(file.toURL());
    } catch (MalformedURLException e) {
      throw new FileNotExistException("Unable to open underlying object file");
    }
  }
View Full Code Here

    File file = new File(getBucketFolderDir(mountedRoot, bucket) + File.separatorChar + fileName);
    try {
      DataSource ds = new FileRangeDataSource(file, startPos, endPos);
      return new DataHandler(ds);
    } catch (MalformedURLException e) {
      throw new FileNotExistException("Unable to open underlying object file");
    } catch(IOException e) {
      throw new FileNotExistException("Unable to open underlying object file");
    }
  }
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.