cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Directory

Former Member
0 Kudos

Hi guys,

how delete folder in SAP MII?

I´m create the code bellow with success, but when I executed the url http://<<servername>>:[porta]/XMII/Catalog?Mode=blowout&folder=PRJ the directory is back.


<%
  String dir = getServletContext().getRealPath("/");

  File diretorio = new File(dir+"/CM/PRJ/DIRETORIO");

 if(diretorio.delete()){
    out.println("Diretório excluído com sucesso!");
 }else{
   out.println("Não foi possível excluir o diretório!");
 }
%>

Thanks,

Danilo Santos

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

.

Edited by: Danilo Santos on Oct 19, 2011 3:47 PM

Former Member
0 Kudos

Hello Danilo,

You should be able to delete a directory using the "Delete File" Action Block. Think of a directory just as a special file. Interesting to say is that you don't even need to delete its contents. If the directory is not empty, all files inside it will be deleted. Just tested it inside a BLS a moment ago.

Regards

Former Member
0 Kudos

Hi davidflam,

Sorry I did not say which version I use. I'm using MII - 12.0.4 Build(120).

In version 12.1 this works well.

so I decided to create this JSP.

Danilo Santos

Former Member
0 Kudos

Danilo,

I don't know if it's the patch level of SAP MII, but I successfully tested my sample "Delete Dir" BLS using SAP MII Version 12.0.9 Build(7). If possible, try to update it.

About the JSP solution, I guess the directory is coming back because you are only deleting the physical file (directory in this case). I think SAP MII keeps somekind of metadata in order to publish files and etc. This metadata reference is not deleted, so the directory gets created again.

Regards

Former Member
0 Kudos

Davidflam,

This action "Delete File" works to erase files, but not in directories for this version 12.0.4.

Otherwise I will solve this problem. "workaround"

Tks,

Danilo Santos