I uploaded malware file into benign container by mistake, and I'm trying it.
I'm trying to remove file from 'Malware_Files' container. I know it's there because of the 'get' command, but the 'delete' command wouldn't work.
I'm performing this code:
ObjectStorageService objectStorageService =
ObjectStorage.authenticateAndGetObjectStorageService();
String container = "Malware_Files";
String fileName = "710cca9062403470a68a9280538a237ec33dc773e9682e1b75b28ed6cb441b27";
SwiftObject fileObj = objectStorageService.objects().get(container,fileName);
System.out.println("Got File!" + fileObj.getName() + " at size " + fileObj.getSizeInBytes());
ActionResponse response = objectStorageService.objects().delete(container, fileObj.getName());
System.out.println("Response: " + response);
SwiftObject fileObjAGAIN = objectStorageService.objects().get(container,fileName);
System.out.println("Got File!" + fileObjAGAIN.getName() + " at size " +
fileObjAGAIN.getSizeInBytes());
Which should get the object wanted, delete it, and then get it again and to see that it's not there anymore.
But this is my output:
Got File! 710cca9062403470a68a9280538a237ec33dc773e9682e1b75b28ed6cb441b27
at size 786432
Response: ActionResponse{success=false, fault=Not Found, code=404}
Got File! 710cca9062403470a68a9280538a237ec33dc773e9682e1b75b28ed6cb441b27 at size 786432
In addition: I tried to delete another file that I'm sure that exists (I've seen it in the GUI) and it works. So I guess it's some kind of bug. I opened this ticket.
Do someone know if it's truly a bug? Or can it be solved in another way?