Package depskyDep

Examples of depskyDep.StorageCloudException


      GSObject objectComplete = gsService.getObject(bucketname, id);
      InputStream in = objectComplete.getDataInputStream();
      byte[] array = null;
      array = getBytesFromInputStream(in);
      if(array == null){
        throw new StorageCloudException("GoogleStorageException:: download data");
      }
      return array;
    } catch (ServiceException e) {
      throw new StorageCloudException("GoogleStorageException::" + e.getMessage());
    } catch (IOException e) {
      throw new StorageCloudException("GoogleStorageException::" + e.getMessage());
    }
  }
View Full Code Here


    try {
      if(gsService.isObjectInBucket(bucketname, id)){
        return new String[]{cid, id};
      }else{
        throw new StorageCloudException("RSException:: getContByName");
      }
    } catch (ServiceException e) {
      throw new StorageCloudException("AWSS3Exception:: Key not exist");
   
  }
View Full Code Here

      GSCredentials gsCredentials = new GSCredentials(accessKey, secretKey);
      gsService = new GoogleStorageService(gsCredentials);
    } catch (ServiceException e) {
      System.out.println("Cannot connect with Google Storage.");
      //e.printStackTrace();
      throw new StorageCloudException(StorageCloudException.INVALID_SESSION);
    }
    try {
      gsService.createBucket(bucketname);
    } catch (ServiceException e) {
    }
View Full Code Here

      object.setDataInputStream(in);
      object.setContentLength(data.length);
      gsService.putObject(bucketname, object);
      return id;
    } catch (ServiceException e) {
      throw new StorageCloudException("AWSS3Exception::" + e.getMessage());
    }
  }
View Full Code Here

      else if(permission.equals("w"))
        acl.grantPermission(new UserByIdGrantee(clientId), Permission.PERMISSION_WRITE);
      gsService.putBucketAcl(cid, acl);
      return true;
    } catch (ServiceException e) {
      throw new StorageCloudException("AWSS3Exception::" + e.getMessage());
    }
  }
View Full Code Here

    storage = context.getBlobStore();
    storage.createContainerInLocation(null, bucketname);
    }catch(Exception e){
      System.out.println("Cannot connect with Windows Azure.");
      //e.printStackTrace();
      throw new StorageCloudException(StorageCloudException.INVALID_SESSION);
    }
    session_key = "sid";   
    return "sid";
  }
View Full Code Here

      array = getBytesFromInputStream(in);
    } catch (IOException e) {
      e.printStackTrace();
    }
    if(array == null){
      throw new StorageCloudException("AWSS3Exception:: download data");
    }
    return array;
  }
View Full Code Here

  public String[] getContainerAndDataIDsByName(String sid, String cid, String idthrows StorageCloudException{

    if(storage.blobExists(cid, id)){   
      return new String[]{cid, id};
    }else{
      throw new StorageCloudException("WAException:: getContByName");
    }
  }
View Full Code Here

        array = getBytesFromInputStream(in);
      } catch (IOException e) {
        e.printStackTrace();
      }
      if(array == null){
        throw new StorageCloudException("AWSS3Exception:: download data");
      }
      return array;
    }else{
      return null;
    }
View Full Code Here

  public String[] getContainerAndDataIDsByName(String arg0, String cid, String id) throws StorageCloudException {

    if(swift.getApi().objectExists(cid, id)){
      return new String[]{cid, id};
    }else{
      throw new StorageCloudException("RSException:: getContByName");
    }   
  }
View Full Code Here

TOP

Related Classes of depskyDep.StorageCloudException

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.