Access Information of Published Files

Version 1 by Robin Shen
on Dec 24, 2009 08:09.


 
compared with
Current by Robin Shen
on Jun 10, 2010 13:38.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 5 changes. View first change.

 h1. Syntax
 Information of build artifacts can be accessed by [build psuedo id|Interact with Builds#build psuedo id] using http GET method through below url:
 {code}http://localhost:8810/rest/files?id=<build psuedo id>&path=<path>{code}
 Here _<path>_ represents the relative path under publish directory of the specified build. The response is of mime type _application/xml_ and the content is xml representation of the information about files and directories under the specified path. A sample response is like below:
  Information of published files can be accessed by build id using http GET method through below url:
 {code}http://localhost:8810/rest/files?build_id=<build id>&path=<path>{code}
 Here _<path>_ represents the relative path under [publish directory|build publish directory] of the specified build. The response is of mime type _application/xml_ and the content is XML representation of the information about files and directories under the specified path. A sample response is like below:
 {code}
 <list>
<com.pmease.quickbuild.rest.FileInfo>
   <com.pmease.quickbuild.FileInfo>
  <name>file1.zip</name>
  
  <!-- size in bytes -->
  <size>287111</size>
  
  <!-- number of milliseconds since January 1, 1970, 00:00:00 GMT -->
  <lastModified>1258091663171</lastModified>
  
  <directory>false</directory>
  </com.pmease.quickbuild.rest.FileInfo>
  
  <com.pmease.quickbuild.rest.FileInfo>
  <name>dir1</name>
  <size>0</size>
 
  <!-- number of milliseconds since January 1, 1970, 00:00:00 GMT -->
  <lastModified>1258091663171</lastModified>
 
  <directory>true</directory>
  </com.pmease.quickbuild.rest.FileInfo>
 </list>
 {code}
  
 h1. Security
 You will need to use http BASIC authentication to login as an authorized QuickBuild user if the anonymous is not allowed to access artifacts of specified build.
  
 h1. Demo
 Below [curl|http://curl.haxx.se/] command demonstrates how to get information of artifacts in build with id _100_:
 {code}curl -u admin:admin "http://localhost:8810/rest/files?id=100&path=artifacts"{code}
  {code}curl -u admin:admin "http://localhost:8810/rest/files?build_id=100&path=artifacts"{code}