| <!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>Apache Archiva REST API: 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/enunciate.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">Apache Archiva REST API: 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">Apache Archiva REST API: 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_java_xml_client_library">Java XML Client Library</h3> |
| <p class="lead">Created November 30, 2019</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-rest-api-xml-client.jar"> |
| <td>archiva-rest-api-xml-client.jar</td> |
| <td>57,32K</td> |
| <td>The binaries for the Java XML client library.</td> |
| </tr> |
| <tr class="clickable-row" data-href="archiva-rest-api-xml-client-xml-sources.jar"> |
| <td>archiva-rest-api-xml-client-xml-sources.jar</td> |
| <td>47,54K</td> |
| <td>The sources for the Java XML client library.</td> |
| </tr> |
| </tbody> |
| </table> |
| <h3 id="artifact_ns0_xsd">ns0.xsd</h3> |
| <p class="lead">Created November 30, 2019</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="ns0.xsd"> |
| <td>ns0.xsd</td> |
| <td>46,43K</td> |
| <td> </td> |
| </tr> |
| </tbody> |
| </table> |
| <h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3> |
| <p class="lead">Created November 30, 2019</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-rest-api-php-xml-client-php.zip"> |
| <td>archiva-rest-api-php-xml-client-php.zip</td> |
| <td>25,52K</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> |