Support Topics Documentation Slack YouTube Blog

Remove Directory Error


(Odhiambo George) #1

Greetings,

Am getting the error

{“code”:0,“message”:“com.backendless.Files.removeDirectory(Ljava/lang/String;)V”,“errorData”:{}}

trying to remove a directory from within a server code. The directory exists.

What could be wrong?

Regards,
George


(Anton Govorushkin) #2

Hi George

Have just successfully deleted a few directories using java service and java handler. It seems that we’d need more details in order to reproduce the problem

Anton


(Odhiambo George) #3
// creating my file path
String filesDirectoryPath = String.format("users/%s", userObjectId);

// saving a simple file
byte[] bytes = "Fox".getBytes();
savedFileURL = Backendless.Files.saveFile( filesDirectoryPath,"fox.txt", bytes, true );

// confirming the directory creation was succesful and removing
if (savedFileURL != null) {
	Backendless.Files.removeDirectory( filesDirectoryPath );
}

My app id=850D233C-6AC2-244C-FFC5-ED60D85BFB00


(Anton Govorushkin) #4

Still was not able to reproduce the error. The only difference is that I’m setting userObjectId manually
Could you please check the exact value of filesDirectoryPath?
I’ll make a few tests meanwhile

Anton