Community
Participate
Working Groups
Hi, In Orion Wiki(http://wiki.eclipse.org/Orion/Server_API/File_API#Notes_on_POST_method) states that: "The entity body, if present, indicates attributes to be applied to the created resource. Attributes in the request body must conform to the file JSON representation." The attributes set during the creation of resources do not change the attributes. Please see an example request response below. Request attributes: { "Directory":"true", "Attributes":{ "ReadOnly":"true" } } Response attributes: { "Attributes": { "Executable": true, "ReadOnly": false, "SymLink": false }, Regards, Timur POST http://127.0.0.1:8080/file/timur/Container+1377698004940 Orion-Version: 1.0 Slug: aFolder1 Content-Type: text/xml { "Directory":"true", "Attributes":{ "ReadOnly":"true" } } -- response -- 201 Created Cache-Control: no-store Content-Type: application/json; charset=UTF-8 Location: /file/timur/Container+1377698004940/aFolder1 Content-Length: 474 Server: Jetty(8.1.10.v20130312) { "Attributes": { "Executable": true, "ReadOnly": false, "SymLink": false }, "ChildrenLocation": "/file/timur/Container+1377698004940/aFolder1?depth=1", "Directory": true, "ImportLocation": "/xfer/import/timur/Container+1377698004940/aFolder1", "Length": 4096, "LocalTimeStamp": 1377765980000, "Location": "/file/timur/Container+1377698004940/aFolder1", "Name": "Container+1377698004940", "Parents": [], "SearchLocation": "/filesearch?q=" }
Looks like a bug to me. Timur would you be interested in contributing a fix? It would go in performPost in this class: http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/tree/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/file/DirectoryHandlerV1.java Test class: http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/tree/tests/org.eclipse.orion.server.tests/src/org/eclipse/orion/server/tests/servlets/files/CoreFilesTest.java
Created attachment 239857 [details] Contains two test cases(test for directory + file) and the code for solving the bug. This is my second patch, ever. I hope is all ok.
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html