Example #1
0
 /// <summary>
 /// Deletes child object under given parent container
 /// </summary>
 /// <param name="childName">Name of child object to be deleted</param>
 /// <returns>True if deleted successfully
 /// False otherwise</returns>
 public Boolean deleteChildObject(String childName)
 {
     try
     {
         DelHTTPRequest request = new DelHTTPRequest(this.client);
         request.createHTTPRequest(path + "/" +
             childName, Resource1.ObjectRequest);
         ExecutionResult executionResult = request.executeRequest();
         return true;
     }
     catch (ExceptionHandler)
     {
         return false;
     }
 }
Example #2
0
 /// <summary>
 /// Delete an existing object from specified container
 /// </summary>
 /// <param name="containerName">Name of Container from which to delete an object</param>
 /// <param name="objectName">Name of object to be deleted</param>
 /// <returns>True if deleted successfully
 /// False otherwise</returns>
 public Boolean deleteObject(String containerName, String objectName)
 {
     try
     {
         path = CommonConstants.CDMI_PATH_CONSTANT + client.username +
             "/" + containerName + "/" + objectName;
         DelHTTPRequest request = new DelHTTPRequest(this.client);
         request.createHTTPRequest(path, Resource1.ObjectRequest);
         ExecutionResult executionResult = request.executeRequest();
         return true;
     }
     catch (ExceptionHandler)
     {
         return false;
     }
 }
Example #3
0
 /// <summary>
 /// Deletes child container under given parent container.
 /// </summary>
 /// <param name="childName">Name of child container to be deleted</param>
 /// <returns>True if deleted successfully
 /// False otherwise</returns>
 public Boolean deleteChildContainer(String childName)
 {
     try
     {
         Container container = getChildContainer(childName);
         if(container.isGetSuccessful())
             if (!container.getChildrenRange().Equals("0-0"))
             container.emptyContainer();
         DelHTTPRequest request = new DelHTTPRequest(this.client);
         request.createHTTPRequest(path + "/" + childName,
             Resource1.ContainerRequest);
         ExecutionResult executionResult = request.executeRequest();
         return true;
     }
     catch (ExceptionHandler)
     {
         return false;
     }
 }
Example #4
0
 /// <summary>
 /// Delete an existing container
 /// </summary>
 /// <param name="containerName">Name of container to be deleted</param>
 /// <returns>True if deleted successfully
 /// False otherwise</returns>
 public Boolean deleteContainer(String containerName)
 {
     try
     {
         path = CommonConstants.CDMI_PATH_CONSTANT + client.username
             + "/" + containerName;
         Container container = new Container(client,path);
         if(container.isGetSuccessful())
             if(!container.getChildrenRange().Equals("0-0"))
                 container.emptyContainer();
         DelHTTPRequest request = new DelHTTPRequest(this.client);
         request.createHTTPRequest(path, Resource1.ContainerRequest);
         ExecutionResult executionResult = request.executeRequest();
         return true;
     }
     catch (ExceptionHandler)
     {
         return false;
     }
 }