public DeleteContainerResponse Action() { DeleteContainerResponse response = new DeleteContainerResponse(); try { System.IO.DirectoryInfo dirctoryInfo = new DirectoryInfo(Path.Combine(DefaultNetDrive, _targetPath)); // check if exists if (!dirctoryInfo.Exists) { throw new FileNotFoundException(Resources.String1, _targetPath); } // Directory Delete Directory.Delete(dirctoryInfo.FullName, true); response.Code = "0000"; response.Message = Resources.infoDeleteContainer_001; } catch (Exception ex) { response.Code = "0001"; response.Message = ex.Message; } finally { DisConnectNetDrive(); } return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteContainerResponse response = new DeleteContainerResponse(); return response; }
public DeleteContainerResponse DeleteContainer(DeleteContainerRequest request) { DeleteContainerResponse response = new DeleteContainerResponse(); try { response = FileManagerService.RemoteFileCommand(request).Action(); } catch (Exception ex) { response.Code = "0001"; response.Message = ex.Message; } return(response); }
public DeleteContainerResponse DeleteContainer(DeleteContainerRequest request) { lock (deleteContainerActionLock) { if (deleteContainerAction == null) { deleteContainerAction = PolicyInjection.Create <BusinessActions.DeleteContainerAction>(); } } request.DeleteContainerParameters.ContainerName = GetUserContainerName(request.DeleteContainerParameters.ContainerName); BusinessEntities.DeleteContainerParameters parameters = DeleteContainerParametersTranslator.TranslateFromServiceToBusiness(request.DeleteContainerParameters); BusinessEntities.DeleteContainerResult result = deleteContainerAction.Execute(parameters); DeleteContainerResponse response = new DeleteContainerResponse(); response.DeleteContainerResult = DeleteContainerResultTranslator.TranslateFromBusinessToService(result); return(response); }