Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Server API/Transfer API"

(New page: '''Under Construction: This API is not yet implemented''' The transfer API is used for batch import and export of directory trees to/from an Orion workspace. = Import = * POST request, ...)
 
(Import)
Line 4: Line 4:
  
 
= Import =
 
= Import =
 +
 +
== Starting a file upload ==
 +
 +
{{Orion/ServerAPI
 +
| method = POST
 +
| overview = An upload is initiated via a POST request. The request URL indicates where the file should be located once the upload is complete. An upload that is not completed in a timely fashion from the initial POST is discarded by the server.
 +
| reqhead = /xfer/MyProj/SomeFolder
 +
| resphead = 200 OK
 +
  Location: /xfer/import/23A43
 +
| explain = On success, the response body contains the raw file contents. A 304 response may be used to indicate an unchanged file when a conditional get is performed (such as using If-None-Match in conjunction with an ETag from a previous response).
 +
}}
  
 
* POST request, returns a URI for resumable upload (uploading in chunks will allow for progress reporting). Request indicates whether we are uploading a file that should be stored directly in the workspace, or whether it is an archive that will need to be extracted into the workspace on the server.
 
* POST request, returns a URI for resumable upload (uploading in chunks will allow for progress reporting). Request indicates whether we are uploading a file that should be stored directly in the workspace, or whether it is an archive that will need to be extracted into the workspace on the server.
Line 10: Line 21:
 
* Responses indicate what total range server already knows
 
* Responses indicate what total range server already knows
 
* Once server has all the bytes the file is stored or extracted into the workspace
 
* Once server has all the bytes the file is stored or extracted into the workspace
 
  
 
= Export =
 
= Export =

Revision as of 13:53, 17 January 2011

Under Construction: This API is not yet implemented

The transfer API is used for batch import and export of directory trees to/from an Orion workspace.

Import

Starting a file upload

Overview
An upload is initiated via a POST request. The request URL indicates where the file should be located once the upload is complete. An upload that is not completed in a timely fashion from the initial POST is discarded by the server.
HTTP Method
POST
Example Request
POST /xfer/MyProj/SomeFolder

  
Example Response
HTTP/1.1 200 OK
 Location: /xfer/import/23A43


Detailed Explanation
On success, the response body contains the raw file contents. A 304 response may be used to indicate an unchanged file when a conditional get is performed (such as using If-None-Match in conjunction with an ETag from a previous response).


  • POST request, returns a URI for resumable upload (uploading in chunks will allow for progress reporting). Request indicates whether we are uploading a file that should be stored directly in the workspace, or whether it is an archive that will need to be extracted into the workspace on the server.
  • POST Response Location indicates upload URL
  • Series of PUT requests to upload URL, using Content-Range header
  • Responses indicate what total range server already knows
  • Once server has all the bytes the file is stored or extracted into the workspace

Export

  • GET request /xfer/export/<filename.zip>
  • Request body contains:
    • Array of files/directories to export - depth infinity is assumed, children should be listed independently if depth infinity is not desired
    • Content type of response (zip, tar, etc)

Back to the top