Java - Delete directory - IOException: Unable to delete directory

You need to check the following to fix this issue:-

  1. User Id/account with which you are running your application must have permission to delete the below directory. If you are running the java application with your account then you must have permission to delete the below directory.

     /opt/appdata/conv/data/out/Job000000000676
    
  2. Add the account into the proper group. To do that first check with ls -ltr execute it inside /opt/appdata/conv/data/out and add your account to the group which has full permission to delete directories inside out directory

  3. Also check if Job000000000676 has sub directory inside it. In such a condition you can execute unix command like rm -rf /opt/appdata/conv/data/out/Job000000000676. See how to execute unix command from java application for detail.

Hope this will help you.

Tags:

Java