rename und delete object getestet
This commit is contained in:
@@ -127,6 +127,8 @@ create or replace package body pck_net_storage as
|
|||||||
l_header_index := l_header_index + 1;
|
l_header_index := l_header_index + 1;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
apex_debug.info('url: ' || i_url);
|
||||||
|
|
||||||
l_response := apex_web_service.make_rest_request(
|
l_response := apex_web_service.make_rest_request(
|
||||||
p_url => i_url
|
p_url => i_url
|
||||||
,p_http_method => i_method
|
,p_http_method => i_method
|
||||||
@@ -522,11 +524,10 @@ create or replace package body pck_net_storage as
|
|||||||
pck_mitarbeiterrecht.p_hat_recht('ADMIN');
|
pck_mitarbeiterrecht.p_hat_recht('ADMIN');
|
||||||
p_assert_allowed(i_object_key);
|
p_assert_allowed(i_object_key);
|
||||||
|
|
||||||
-- TEST
|
l_response := f_make_request(
|
||||||
--l_response := f_make_request(
|
i_method => 'DELETE'
|
||||||
-- i_method => 'DELETE'
|
,i_url => f_build_url(i_object_key)
|
||||||
-- ,i_url => f_build_url(i_object_key)
|
);
|
||||||
--);
|
|
||||||
|
|
||||||
l_obj_path := f_split_object_key(i_object_key);
|
l_obj_path := f_split_object_key(i_object_key);
|
||||||
pck_log.p_info(
|
pck_log.p_info(
|
||||||
@@ -600,7 +601,6 @@ create or replace package body pck_net_storage as
|
|||||||
-- SCK 2026-04-08 Prozedur erstellt
|
-- SCK 2026-04-08 Prozedur erstellt
|
||||||
------------------------------------------------------------------------------------------------Kopf*/
|
------------------------------------------------------------------------------------------------Kopf*/
|
||||||
is
|
is
|
||||||
l_prefix varchar2(1024);
|
|
||||||
l_new_key varchar2(1024);
|
l_new_key varchar2(1024);
|
||||||
l_body clob;
|
l_body clob;
|
||||||
l_response clob;
|
l_response clob;
|
||||||
@@ -616,20 +616,18 @@ create or replace package body pck_net_storage as
|
|||||||
|
|
||||||
if instr(i_new_name, '/') > 0
|
if instr(i_new_name, '/') > 0
|
||||||
then
|
then
|
||||||
raise_application_error(-20014, 'Dateiname darf keinen Schrägstrich enthalten — zum Verschieben p_move_object verwenden');
|
raise_application_error(-20014, 'Dateiname darf keinen Schrägstrich enthalten — zum Verschieben explizite Verschieben-Funktion verwenden');
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Verzeichnispfad aus dem aktuellen Key extrahieren
|
l_obj_path := f_split_object_key(i_object_key);
|
||||||
if instr(i_object_key, '/') > 0
|
l_new_key := l_obj_path.path || i_new_name;
|
||||||
then
|
|
||||||
l_prefix := substr(i_object_key, 1, instr(i_object_key, '/', -1));
|
|
||||||
else
|
|
||||||
l_prefix := null;
|
|
||||||
end if;
|
|
||||||
|
|
||||||
l_new_key := l_prefix || i_new_name;
|
|
||||||
p_assert_allowed(l_new_key);
|
p_assert_allowed(l_new_key);
|
||||||
|
|
||||||
|
if l_new_key = i_object_key
|
||||||
|
then
|
||||||
|
raise_application_error(-20016, 'Der Dateiname darf beim Umbenennen nicht unverändert bleiben.');
|
||||||
|
end if;
|
||||||
|
|
||||||
select json_object(
|
select json_object(
|
||||||
'sourceName' value i_object_key
|
'sourceName' value i_object_key
|
||||||
,'newName' value l_new_key
|
,'newName' value l_new_key
|
||||||
@@ -637,15 +635,13 @@ create or replace package body pck_net_storage as
|
|||||||
into l_body
|
into l_body
|
||||||
from dual;
|
from dual;
|
||||||
|
|
||||||
-- TEST
|
l_response := f_make_request(
|
||||||
--l_response := f_make_request(
|
i_method => 'POST'
|
||||||
-- i_method => 'POST'
|
,i_url => f_build_url(i_action => 'renameObject')
|
||||||
-- ,i_url => f_build_url(i_action => 'renameObject')
|
,i_body_clob => l_body
|
||||||
-- ,i_body_clob => l_body
|
,i_content_type => 'application/json'
|
||||||
-- ,i_content_type => 'application/json'
|
);
|
||||||
--);
|
|
||||||
|
|
||||||
l_obj_path := f_split_object_key(i_object_key);
|
|
||||||
pck_log.p_info(
|
pck_log.p_info(
|
||||||
i_module => c_log_module
|
i_module => c_log_module
|
||||||
,i_action => 'RENAME'
|
,i_action => 'RENAME'
|
||||||
|
|||||||
Reference in New Issue
Block a user