public string Rename(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, IDev2CRUDOperationTO args) { string performRename() { if (src.PathIs(src.IOPath) != dst.PathIs(dst.IOPath)) { throw new Exception(ErrorResource.SourceAndDestinationNOTFilesOrDirectory); } if (dst.PathExist(dst.IOPath)) { if (!args.Overwrite) { throw new Exception(ErrorResource.DestinationDirectoryExist); } dst.Delete(dst.IOPath); } return(Move(src, dst, args)); } try { return(performRename()); } finally { RemoveAllTmpFiles(); } }
public void DeleteUNCWith_FilePresent_Expectd_DeleteSucessful() { IActivityIOPath path = ActivityIOFactory.CreatePathFromString(_uncfile1, "", ""); IActivityIOOperationsEndPoint FileSystemPro = ActivityIOFactory.CreateOperationEndPointFromIOPath(path); bool ok = FileSystemPro.Delete(path); Assert.IsTrue(ok); }
public void DeleteUNCWith_DirPresent_Expected_DeleteSuccesful() { IActivityIOPath path = ActivityIOFactory.CreatePathFromString(_uncdir1, "", ""); IActivityIOOperationsEndPoint FileSystemPro = ActivityIOFactory.CreateOperationEndPointFromIOPath(path) as Dev2FileSystemProvider; bool ok = FileSystemPro != null && FileSystemPro.Delete(path); Assert.IsTrue(ok); }
public void DeleteUNCValidUserWith_NoDirPresent_DeleteUnsuccesful() { string tmp = TestResource.PathOperations_UNC_Path_Secure + Guid.NewGuid() + "_dir"; IActivityIOPath path = ActivityIOFactory.CreatePathFromString(tmp, (_inDomain ? "DEV2\\" : ".\\") + TestResource.PathOperations_Correct_Username, TestResource.PathOperations_Correct_Password); IActivityIOOperationsEndPoint FileSystemPro = ActivityIOFactory.CreateOperationEndPointFromIOPath(path); bool ok = FileSystemPro.Delete(path); Assert.IsFalse(ok); }
public void DeleteUNCWith_NoDirPresent_Expected_DeleteUnsuccessful() { IActivityIOPath path = ActivityIOFactory.CreatePathFromString(_uncdir1, "", ""); Directory.Delete(_uncdir1, true); IActivityIOOperationsEndPoint FileSystemPro = ActivityIOFactory.CreateOperationEndPointFromIOPath(path); bool ok = FileSystemPro.Delete(path); Assert.IsFalse(ok); }
public void DeleteUNCWith_NoFilePresent_DeleteUnsucessful() { IActivityIOPath path = ActivityIOFactory.CreatePathFromString(_uncfile1 + "abc", "", ""); File.Delete(_tmpfile1); IActivityIOOperationsEndPoint FileSystemPro = ActivityIOFactory.CreateOperationEndPointFromIOPath(path); bool ok = FileSystemPro.Delete(path); Assert.IsFalse(ok); }
public void DeleteUNCValidUserWith_DirPresent_Expected_DeleteSuccessful() { string tmp = TestResource.PathOperations_UNC_Path_Secure + Guid.NewGuid() + "_dir"; PathIOTestingUtils.CreateAuthedUNCPath(tmp, true, _inDomain); IActivityIOPath path = ActivityIOFactory.CreatePathFromString(tmp, (_inDomain ? "DEV2\\" : ".\\") + TestResource.PathOperations_Correct_Username, TestResource.PathOperations_Correct_Password); IActivityIOOperationsEndPoint FileSystemPro = ActivityIOFactory.CreateOperationEndPointFromIOPath(path); bool ok = FileSystemPro.Delete(path); Assert.IsTrue(ok); }
public string Delete(IActivityIOOperationsEndPoint src) { var result = ResultOk; try { if (!src.Delete(src.IOPath)) { result = ResultBad; } } finally { _filesToDelete.ForEach(RemoveTmpFile); } return(result); }
public string Move(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, IDev2CRUDOperationTO args) { string result; try { result = Copy(src, dst, args); if (result.Equals(ActivityIOBrokerBaseDriver.ResultOk)) { src.Delete(src.IOPath); } } finally { RemoveAllTmpFiles(); } return(result); }
public string Delete(IActivityIOOperationsEndPoint src) { try { if (!src.Delete(src.IOPath)) { return(ActivityIOBrokerBaseDriver.ResultBad); } } catch { return(ActivityIOBrokerBaseDriver.ResultBad); } finally { RemoveAllTmpFiles(); } return(ActivityIOBrokerBaseDriver.ResultOk); }
string ValidateRenameSourceAndDesinationTypes(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, IDev2CRUDOperationTO args) { if (src.PathIs(src.IOPath) != dst.PathIs(dst.IOPath)) { throw new Exception(ErrorResource.SourceAndDestinationNOTFilesOrDirectory); } if (dst.PathExist(dst.IOPath)) { if (!args.Overwrite) { throw new Exception(ErrorResource.DestinationDirectoryExist); } dst.Delete(dst.IOPath); } return(Move(src, dst, args)); }
public string Move(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, IDev2CRUDOperationTO args) { string result; try { result = Copy(src, dst, args); if (result.Equals(ResultOk)) { src.Delete(src.IOPath); } } finally { _filesToDelete.ForEach(RemoveTmpFile); } return(result); }
public string Delete(IActivityIOOperationsEndPoint src) { try { if (!src.Delete(src.IOPath)) { return(ResultBad); } } catch { return(ResultBad); } finally { _filesToDelete.ForEach(RemoveTmpFile); } return(ResultOk); }
public string Move(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, Dev2CRUDOperationTO args) { string result; try { result = Copy(src, dst, args); if(result.Equals("Success")) { src.Delete(src.IOPath); } } finally { _filesToDelete.ForEach(RemoveTmpFile); } return result; }
public string Delete(IActivityIOOperationsEndPoint src) { var result = ResultOk; try { if(!src.Delete(src.IOPath)) { result = ResultBad; } } finally { _filesToDelete.ForEach(RemoveTmpFile); } return result; }
string ValidateRenameSourceAndDesinationTypes(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, Dev2CRUDOperationTO args) { //ensures that the source and destination locations are of the same type if(src.PathIs(src.IOPath) != dst.PathIs(dst.IOPath)) { throw new Exception("Source and destination need to be both files or directories"); } //Rename Tool if the file/folder exists then delete it and put the source there if(dst.PathExist(dst.IOPath)) { if(!args.Overwrite) { throw new Exception("Destination directory already exists and overwrite is set to false"); } //Clear the existing folder dst.Delete(dst.IOPath); } return Move(src, dst, args); }