第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

AEM Asset API:根據(jù)需要創(chuàng)建中間目錄

AEM Asset API:根據(jù)需要創(chuàng)建中間目錄

小唯快跑啊 2023-06-14 16:30:01
我正在使用 AEM 6.3。我正在使用 Assets API 通過curl命令上傳資產(chǎn)。我就是這樣做的:curl -i 'http://localhost:4502/api/assets/newFolder' -H "Content-Type: application/json" -d '{"class":"assetFolder","properties":{"title":"New folder"}}' -u admin:admin如果它們不存在,我的用例需要創(chuàng)建中間目錄。是這樣的:curl -i 'http://localhost:4502/api/assets/intermediate1/intermediate2/newFolder' -H "Content-Type: application/json" -d '{"class":"assetFolder","properties":{"title":"New folder"}}' -u admin:admin在上面的示例中,中間件 1 和中間件 2 都不存在。卷曲不起作用,AEM 返回:HTTP/1.1 500 Server ErrorDate: Wed, 21 Aug 2019 14:13:35 GMTX-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINSet-Cookie: cq-authoring-mode=CLASSIC;Path=/;Expires=Wed, 28-Aug-2019 14:13:35 GMTExpires: Thu, 01 Jan 1970 00:00:00 GMTContent-Type: application/json; charset=UTF-8Transfer-Encoding: chunked{"class":["core/response"],"properties":{"path":"/api/assets/intermediate1/intermediate2/newFolder","parentLocation":"/api/assets/intermediate1/intermediate2.json","referer":"","changes":[],"location":"/api/assets/intermediate1/intermediate2/newFolder.json","status.code":500}}500錯誤很奇怪。從日志中我可以看到:21.08.2019 11:13:35.512 *ERROR* [0:0:0:0:0:0:0:1 [1566396815508] POST /api/assets/intermediate1/intermediate2/newFolder HTTP/1.1] com.adobe.granite.rest.impl.servlet.PostRequest Exception during request processing.java.lang.NullPointerException: null    at com.adobe.granite.rest.assets.impl.AssetResourceProvider.getDataPropertyKey(AssetResourceProvider.java:412)也許 AEM Assets API 不支持創(chuàng)建不存在的中間文件夾?也許 500 錯誤只是一個錯誤?
查看完整描述

1 回答

?
至尊寶的傳說

TA貢獻1789條經(jīng)驗 獲得超10個贊

有 2 個選項可以使用資產(chǎn) API。您可以嘗試以下任何一項:

下面的示例顯示了在資產(chǎn)層次結(jié)構(gòu)中創(chuàng)建 2 個新文件夾。

選項1

curl -u admin:admin  http://localhost:4502/api/assets/we-retail/* -F"name=newfolder" -F"title=New Folder"

結(jié)果:

{"class":["core/response"],"properties":{"path":"/api/assets/we-retail/*","parentLocation":"/api/assets/we-retail.json","referer":"","isCreate":true,"changes":[{"argument":"/api/assets/we-retail/newfolder","type":"created"}],"location":"/api/assets/we-retail/newfolder.json","status.message":"Created","title":"Content created /api/assets/we-retail/*","status.code":201}}

選項 2

curl -u admin:admin  http://localhost:4502/api/assets/we-retail/newfolder/images -H"Content-Type: application/json" -d "{"class":"assetFolder","properties":{"title":"Images"}}"

結(jié)果

{"class":["core/response"],"properties":{"path":"/api/assets/we-retail/newfolder/images","parentLocation":"/api/assets/we-retail/newfolder.json","referer":"","isCreate":true,"changes":[{"argument":"/api/assets/we-retail/newfolder/images","type":"created"}],"location":"/api/assets/we-retail/newfolder/images.json","status.message":"Created","title":"Content created /api/assets/we-retail/newfolder/images","status.code":201}}


命令提示符中默認不識別單引號。將其更改為雙引號應(yīng)該可以


另一種創(chuàng)建文件夾的方法,強制 primarytype 為整個層次結(jié)構(gòu)的 sling:folder

curl -u admin:admin -Fjcr:primaryType=sling:Folder localhost:4502/content/dam/mFolder/aFolder



查看完整回答
反對 回復(fù) 2023-06-14
  • 1 回答
  • 0 關(guān)注
  • 200 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號