Failed to remove Swift Object from Swift Container

I uploaded a malicious file into a soft container by mistake, and I try it.

I am trying to delete a file from the Malware_Files container. I know this because of the get command, but the delete command does not work.

I am executing 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 desired object, delete it, and then get it again and see that it is no more.

But this is my conclusion:

Got File! 710cca9062403470a68a9280538a237ec33dc773e9682e1b75b28ed6cb441b27 
at size 786432
Response: ActionResponse{success=false, fault=Not Found, code=404}
Got File! 710cca9062403470a68a9280538a237ec33dc773e9682e1b75b28ed6cb441b27 at size 786432

Also: I tried deleting another file that I am sure exists (I saw it in the GUI) and it works. Therefore, I assume that this is some kind of mistake. I opened this ticket .

Does anyone know if this is really a mistake? Or can it be solved differently?

+4
source share

Source: https://habr.com/ru/post/1695468/


All Articles