declare
    l_file_text clob;
    l_file blob;
begin
    -- l_file := 
     l_file_text :=apex_web_service.make_rest_request (
                p_url => 'https://frhqaxi5sgcg.objectstorage.eu-frankfurt-1.oci.customer-oci.com/n/frhqaxi5sgcg/b/INKA_NET_STORAGE/o/'
                ,p_http_method => 'GET'
                ,p_credential_static_id => 'OCI_INKA_NET_STORE'
                ,p_wallet_path => 'file:/u01/app/oracle/product/19.0.0.0/dbhome_1/wallets/digicert-global-root-g2-wallet'
            );

    --dbms_output.put_line('File size: ' || dbms_lob.getlength(l_file) );  
    dbms_output.put_line('Response: ' || l_file_text);
end;
/


declare
begin
    for rec in (select object_name, object_size, last_modified, is_folder 
                 from pck_net_storage.f_list_objects (i_parent_folder => 'testmandant-42/BA/Eingang/Verarbeitet 2026/', i_include_subfolders => 'N')) --i_parent_folder => 'testmandant-42/BA/Eingang/Verarbeitet 2026/'
    loop
        --dbms_output.put_line('Obj: ' || rec.object_name || ', object_size: ' || rec.object_size || ', last_modified: ' || rec.last_modified|| ', is_folder: ' || rec.is_folder);
        dbms_output.put_line('is_folder: ' || rec.is_folder || ', name: ' || rec.object_name || ', object_size: ' || rec.object_size || ', last_modified: ' || to_char(rec.last_modified, 'DD.MM.YYYY HH24:MI:SS'));
    end loop;             
end;
/