--
connect &DBA/&DBAPASSWORD@&TNSALIAS
--
declare
  non_existant_resource exception;
  PRAGMA EXCEPTION_INIT( non_existant_resource , -31001 );
begin
--
  begin
    dbms_xdb.deleteResource(:IMAGE_CATEGORIZATION_FOLDER,4);
  exception
    when non_existant_resource then
      null;
  end;
--
end;
/
declare
  HOME_FOLDER     varchar2(256) := '/home/' || :METADATAOWNER;
  PUBLIC_FOLDER   varchar2(256) := :PUBLISHED_CONTENT_FOLDER || '/' || :METADATAOWNER;
  
  PUBLIC_XSD_FOLDER      varchar2(256) := PUBLIC_FOLDER || '/xsd';
  PUBLIC_XML_FOLDER      varchar2(256) := PUBLIC_FOLDER || '/xml';
begin
  
  if dbms_xdb.existsResource(PUBLIC_XSD_FOLDER) then 
    dbms_xdb.deleteResource(PUBLIC_XSD_FOLDER);
  end if;
  
  if dbms_xdb.existsResource(PUBLIC_XML_FOLDER) then 
    dbms_xdb.deleteResource(PUBLIC_XML_FOLDER);
  end if;
  
  commit;
  
end;
/
disconnect
--
