| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> |
| |
| <title>Archiva Web :: Web Common: Files and Libraries</title> |
| |
| <!-- Mobile viewport optimized: j.mp/bplateviewport --> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| <!-- Bootstrap core CSS --> |
| <!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> --> |
| |
| <!--custom css for these pages--> |
| <link rel="stylesheet" href="css/style.css"> |
| |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.css" type="text/css"> |
| |
| <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> |
| <!--[if lt IE 9]> |
| <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> |
| <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> |
| <![endif]--> |
| </head> |
| |
| <body class="home"> |
| <div class="container"> |
| <header> |
| |
| <div id="header" class="column first last span-20"> |
| <div id="site-name" class="column span-18 append-1 prepend-1 first last"><a href="index.html">Archiva Web :: Web Common: Files and Libraries</a></div> |
| <div id="primary" class="column span-18 append-1 prepend-1 first last"> |
| <ul class="navigation"> |
| <li id="nav-rest"><a href="resources.html">REST</a></li> |
| <li id="nav-data"><a href="data.html">Data Model</a></li> |
| </ul> |
| </div> |
| <div> |
| <ul class="xbreadcrumbs" id="breadcrumbs"> |
| <li> |
| <a href="index.html" class="home">Home</a> > |
| |
| </li> |
| <li class="current"> |
| <a href="downloads.html">Files and Libraries</a> |
| |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!--<nav class="navbar navbar-inverse navbar-fixed-top"> |
| <div class="container-fluid"> |
| <div class="navbar-header"> |
| <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| <a class="navbar-brand" href="index.html">Archiva Web :: Web Common: Files and Libraries</a> |
| </div> |
| <div id="navbar" class="navbar-collapse collapse"> |
| <ul class="nav navbar-nav navbar-right"> |
| <li><a href="resources.html">Resources</a></li> |
| <li><a href="data.html">Data Types</a></li> |
| <li><a href="downloads.html">Files and Libraries</a></li> |
| </ul> |
| </div> |
| </div> |
| </nav>--> |
| </header> |
| <div id="main" class="column first last span-20"> |
| |
| <h1 class="page-header">Files and Libraries</h1> |
| |
| <h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3> |
| <p class="lead">Created May 25, 2016</p> |
| <p> <p> |
| The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that |
| can be used to access the Web service API for this application. |
| </p> |
| |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">JSON Overlay Example</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-java"> |
| String url = ...; |
| RequestBuilder request = new RequestBuilder(RequestBuilder.GET, url); |
| request.sendRequest(null, new RequestCallback() { |
| public void onResponseReceived(Request request, Response response) { |
| if (200 == response.getStatusCode()) { |
| //handle the successful data... |
| JavaScriptObject data = JavaScriptObject.fromJson(response.getText()); |
| //handle the JavaScriptObject... |
| } |
| else { |
| //handle the error... |
| } |
| } |
| |
| public void onError(Request request, Throwable throwable) { |
| //handle the error... |
| } |
| }); |
| </pre> |
| </div> |
| </div> |
| </p> |
| <table class="table table-hover"> |
| <caption>Files</caption> |
| <thead> |
| <tr> |
| <th>name</th> |
| <th>size</th> |
| <th>description</th> |
| </tr> |
| </thead> |
| <tbody data-link="row" class="rowlink"> |
| <tr class="clickable-row" data-href="archiva-web-common-gwt-json-overlay.jar"> |
| <td>archiva-web-common-gwt-json-overlay.jar</td> |
| <td>45.11K</td> |
| <td>The sources for the GWT JSON overlay.</td> |
| </tr> |
| </tbody> |
| </table> |
| <h3 id="artifact_java_json_client_library">Java JSON Client Library</h3> |
| <p class="lead">Created May 25, 2016</p> |
| <p><p> |
| The Java client-side library is used to provide the set of Java objects that can be serialized |
| to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the |
| JSON REST endpoints that are published by this application. |
| </p> |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">Resources Example (Raw JAXB)</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-java"> |
| java.net.URL url = new java.net.URL(baseURL + "/archivaRuntimeConfigurationService/archivaRuntimeConfiguration"); |
| ObjectMapper mapper = new ObjectMapper(); |
| java.net.URLConnection connection = url.openConnection(); |
| connection.setDoOutput(true); |
| connection.connect(); |
| |
| mapper.writeValue(connection.getOutputStream(), archivaRuntimeConfiguration); |
| Object result = (Object) mapper.readValue( connection.getInputStream(), Object.class ); |
| //handle the result as needed... |
| </pre> |
| </div> |
| </div> |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">Resources Example (Jersey client)</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-java"> |
| javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient(); |
| |
| Object result = client.target(baseUrl + "/archivaRuntimeConfigurationService/archivaRuntimeConfiguration") |
| .put(javax.ws.rs.client.Entity.entity(archivaRuntimeConfiguration, "application/json"), Object.class); |
| |
| //handle the result as needed... |
| </pre> |
| </div> |
| </div> |
| </p> |
| <table class="table table-hover"> |
| <caption>Files</caption> |
| <thead> |
| <tr> |
| <th>name</th> |
| <th>size</th> |
| <th>description</th> |
| </tr> |
| </thead> |
| <tbody data-link="row" class="rowlink"> |
| <tr class="clickable-row" data-href="archiva-web-common-json-client.jar"> |
| <td>archiva-web-common-json-client.jar</td> |
| <td>61.58K</td> |
| <td>The binaries for the Java JSON client library.</td> |
| </tr> |
| <tr class="clickable-row" data-href="archiva-web-common-json-client-json-sources.jar"> |
| <td>archiva-web-common-json-client-json-sources.jar</td> |
| <td>47.93K</td> |
| <td>The sources for the Java JSON client library.</td> |
| </tr> |
| </tbody> |
| </table> |
| <h3 id="artifact_java_xml_client_library">Java XML Client Library</h3> |
| <p class="lead">Created May 25, 2016</p> |
| <p><p> |
| The Java client-side library is used to access the Web service API for this application using Java. |
| </p> |
| |
| <p> |
| The Java client-side library is used to provide the set of Java objects that can be serialized |
| to/from XML using <a href="https://jaxb.dev.java.net/">JAXB</a>. This is useful for accessing the |
| resources that are published by this application. |
| </p> |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">Resources Example (Raw JAXB)</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-java"> |
| java.net.URL url = new java.net.URL(baseURL + "/archivaRuntimeConfigurationService/archivaRuntimeConfiguration"); |
| JAXBContext context = JAXBContext.newInstance( byte[].class, byte[].class ); |
| java.net.URLConnection connection = url.openConnection(); |
| connection.setDoOutput(true); |
| connection.connect(); |
| |
| Unmarshaller unmarshaller = context.createUnmarshaller(); |
| Marshaller marshaller = context.createMarshaller(); |
| marshaller.marshal(archivaRuntimeConfiguration, connection.getOutputStream()); |
| Object result = (Object) unmarshaller.unmarshal( connection.getInputStream() ); |
| //handle the result as needed... |
| </pre> |
| </div> |
| </div> |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">Resources Example (Jersey client)</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-java"> |
| javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient(); |
| |
| Object result = client.target(baseUrl + "/archivaRuntimeConfigurationService/archivaRuntimeConfiguration") |
| .put(javax.ws.rs.client.Entity.entity(archivaRuntimeConfiguration, "application/xml"), Object.class); |
| |
| //handle the result as needed... |
| </pre> |
| </div> |
| </div> |
| </p> |
| <table class="table table-hover"> |
| <caption>Files</caption> |
| <thead> |
| <tr> |
| <th>name</th> |
| <th>size</th> |
| <th>description</th> |
| </tr> |
| </thead> |
| <tbody data-link="row" class="rowlink"> |
| <tr class="clickable-row" data-href="archiva-web-common-xml-client.jar"> |
| <td>archiva-web-common-xml-client.jar</td> |
| <td>57.79K</td> |
| <td>The binaries for the Java XML client library.</td> |
| </tr> |
| <tr class="clickable-row" data-href="archiva-web-common-xml-client-xml-sources.jar"> |
| <td>archiva-web-common-xml-client-xml-sources.jar</td> |
| <td>48.87K</td> |
| <td>The sources for the Java XML client library.</td> |
| </tr> |
| </tbody> |
| </table> |
| <h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3> |
| <p class="lead">Created May 25, 2016</p> |
| <p><p> |
| The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. |
| This is useful for accessing the resources that are published by this application, but only |
| those that produce a JSON representation of their resources (content type "application/json"). |
| </p> |
| |
| <p> |
| This library requires the <a href="http://php.net/manual/en/function.json-encode.php">json_encode</a> function which was included in PHP versions 5.2.0+. |
| </p> |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">PHP JSON Example</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-php"> |
| //read the resource in JSON: |
| $json = ...; |
| |
| //read the json as an array. |
| $parsed = json_decode($json, true); |
| |
| //read the json array as the object |
| $result = new Object($parsed); |
| |
| //open a writer for the json |
| $json = $result->toJson(); |
| </pre> |
| </div> |
| </div> |
| </p> |
| <table class="table table-hover"> |
| <caption>Files</caption> |
| <thead> |
| <tr> |
| <th>name</th> |
| <th>size</th> |
| <th>description</th> |
| </tr> |
| </thead> |
| <tbody data-link="row" class="rowlink"> |
| <tr class="clickable-row" data-href="archiva-web-common-php.zip"> |
| <td>archiva-web-common-php.zip</td> |
| <td>22.84K</td> |
| <td> </td> |
| </tr> |
| </tbody> |
| </table> |
| <h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3> |
| <p class="lead">Created May 25, 2016</p> |
| <p><p> |
| The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML. |
| This is useful for accessing the resources that are published by this application, but only |
| those that produce a XML representation of their resources. |
| </p> |
| |
| <p> |
| This library leverages the <a href="http://php.net/manual/en/book.xmlreader.php">XMLReader</a> and |
| <a href="http://php.net/manual/en/book.xmlwriter.php">XMLWriter</a> tools that were included in PHP |
| versions 5.1.0+. |
| </p> |
| |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">PHP XML Example</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-php"> |
| //read the resource in XML form: |
| $xml = ...; |
| |
| $reader = new \XMLReader(); |
| |
| if (!$reader->open($xml)) { |
| throw new \Exception('Unable to open ' . $xml); |
| } |
| $result = new Object($reader); |
| |
| //open a writer for the xml |
| $out = ...; |
| $writer = new \XMLWriter(); |
| $writer->openUri($out); |
| $writer->startDocument(); |
| $writer->setIndent(4); |
| $result->toXml($writer); |
| $writer->flush(); |
| </pre> |
| </div> |
| </div> |
| </p> |
| <table class="table table-hover"> |
| <caption>Files</caption> |
| <thead> |
| <tr> |
| <th>name</th> |
| <th>size</th> |
| <th>description</th> |
| </tr> |
| </thead> |
| <tbody data-link="row" class="rowlink"> |
| <tr class="clickable-row" data-href="archiva-web-common-php.zip"> |
| <td>archiva-web-common-php.zip</td> |
| <td>24.97K</td> |
| <td> </td> |
| </tr> |
| </tbody> |
| </table> |
| <h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3> |
| <p class="lead">Created May 25, 2016</p> |
| <p><p> |
| The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON. |
| This is useful for accessing the REST endpoints that are published by this application, but only |
| those that produce a JSON representation of their resources (content type "application/json"). |
| </p> |
| |
| <p> |
| This library leverages the <a href="http://json.rubyforge.org/">Ruby JSON Implementation</a>, which is |
| required in order to use this library. |
| </p> |
| |
| |
| <div class="panel panel-default"> |
| <div class="panel-heading">Ruby JSON Example</div> |
| <div class="panel-body"> |
| <pre class="prettyprint lang-ruby"> |
| require 'net/https' |
| require 'uri' |
| //... |
| |
| //read a resource from a REST url |
| url = URI.parse("...") |
| request = Net::HTTP::Put.new(url.request_uri) |
| input = Object.new |
| //set up the Object... |
| request.body = input.to_json |
| request['Content-Type'] = "application/json" |
| |
| http = Net::HTTP.new(url.host, url.port) |
| //set up additional http stuff... |
| res = http.start do |ht| |
| ht.request(request) |
| end |
| |
| result = Object.from_json(JSON.parse(res.body)) |
| |
| //handle the result as needed... |
| </pre> |
| </div> |
| </div> |
| </p> |
| <table class="table table-hover"> |
| <caption>Files</caption> |
| <thead> |
| <tr> |
| <th>name</th> |
| <th>size</th> |
| <th>description</th> |
| </tr> |
| </thead> |
| <tbody data-link="row" class="rowlink"> |
| <tr class="clickable-row" data-href="archiva-web-common.rb"> |
| <td>archiva-web-common.rb</td> |
| <td>122.84K</td> |
| <td> </td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <footer> |
| <div class="footer"> |
| Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>. |
| </div> |
| </footer> |
| |
| </div> |
| |
| </div> |
| |
| |
| <!-- JavaScript placed at the end of the document so the pages load faster. --> |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> |
| |
| |
| <!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ --> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.js" type="text/javascript"></script> |
| |
| |
| </body> |
| </html> |