public void TestDeleteFolder() { const string bucketName = "TestDeleteFolder"; try { // Creates a bucket if it does not already exist. _helpers.EnsureBucketExists(bucketName); // Creates a bulk job with the server based on the files in a directory (recursively). var directoryObjects = FileHelpers.ListObjectsForDirectory(testDirectorySrc); Assert.Greater(directoryObjects.Count(), 0); var job = _helpers.StartWriteJob(bucketName, directoryObjects); // Transfer all of the files. job.Transfer(FileHelpers.BuildFilePutter(testDirectorySrc)); // all files there? var folderCount = ListBucketObjects(bucketName).Count(); Assert.AreEqual(folderCount, directoryObjects.Count()); // now it's there var anteFolder = ListBucketObjects(bucketName); var anteFolderCount = anteFolder.Count(); Assert.Greater(anteFolderCount, 0); // get all with folder name var folderItems = from o in anteFolder where o.Name.StartsWith(FOLDER) select o; folderCount = folderItems.Count(); Assert.Greater(folderCount, 0); // delete it var request = new DeleteFolderRecursivelySpectraS3Request(bucketName, FOLDER); _client.DeleteFolderRecursivelySpectraS3(request); // now it's gone var postFolderCount = ListBucketObjects(bucketName).Count(); Assert.AreEqual(anteFolderCount - postFolderCount, folderCount); } finally { Ds3TestUtils.DeleteBucket(_client, bucketName); } }
public void DeleteFolderRecursivelySpectraS3(DeleteFolderRecursivelySpectraS3Request request) { using (var response = _netLayer.Invoke(request)) { ResponseParseUtilities.HandleStatusCode(response, HttpStatusCode.NoContent); } }
public void runDeleteFolder(string bucketname, string folderName) { var request = new Ds3.Calls.DeleteFolderRecursivelySpectraS3Request(bucketname, folderName); _client.DeleteFolderRecursivelySpectraS3(request); }