/** * Sets the modifiable list of required client protocols. This method clears * the current list and adds all entries in the parameter list. * * @param clientProtocols * A list of required client protocols. */ public void setClientProtocols(List<Protocol> clientProtocols) { synchronized (getClientProtocols()) { if (clientProtocols != getClientProtocols()) { getClientProtocols().clear(); if (clientProtocols != null) { getClientProtocols().addAll(clientProtocols); } } } }
/** * Constructor. * * @throws IOException */ public Application() throws IOException { // List of protocols required by the application. getConnectorService().getClientProtocols().add(Protocol.FILE); getConnectorService().getClientProtocols().add(Protocol.CLAP); getConnectorService().getClientProtocols().add(Protocol.HTTP); // Look for the configuration file in the classpath Properties properties = getProperties("clap://class/config/foafApplication.properties"); this.webRootPath = properties.getProperty("web.root.path"); /** Create and chain the Objects and Data facades. */ this.dataFacade = new ObjectsFacade(new ListFacade()); try { final File templateDir = new File(webRootPath + "/tmpl"); this.fmc = new freemarker.template.Configuration(); this.fmc.setDirectoryForTemplateLoading(templateDir); } catch (Exception e) { getLogger().severe("Unable to configure FreeMarker."); e.printStackTrace(); } getMetadataService().addExtension("rdf", MediaType.APPLICATION_RDF_XML, true); getTunnelService().setExtensionsTunnel(true); }
@Override public Restlet createInboundRoot() { getConnectorService().getClientProtocols().add(Protocol.CLAP); getConnectorService().getServerProtocols().add(Protocol.HTTP); final Directory directory = new Directory(getContext(), "clap://class"); directory.setListingAllowed(true); directory.setDeeplyAccessible(true); return directory; } };
/** * Default Constructor. * * Adds the necessary file protocols and sets up the template location. */ public OasRestletExampleTestApplication() { // List of protocols required by the application this.getConnectorService().getClientProtocols().add(Protocol.HTTP); this.getConnectorService().getClientProtocols().add(Protocol.CLAP); // Define extensions for RDF and Javascript // getMetadataService().addExtension("rdf", MediaType.APPLICATION_RDF_XML, true); // getMetadataService().addExtension("json", MediaType.APPLICATION_JSON, true); // getMetadataService().addExtension("ttl", MediaType.APPLICATION_RDF_TURTLE, true); // getMetadataService().addExtension("n3", MediaType.TEXT_RDF_N3, true); // getMetadataService().addExtension("nt", MediaType.TEXT_RDF_NTRIPLES, true); // // this.getMetadataService().addExtension("js", MediaType.TEXT_JAVASCRIPT, true); // Automagically tunnel client preferences for extensions through the // tunnel // getTunnelService().setExtensionsTunnel(true); }
.getClientProtocols() != null) { for (Protocol clientProtocol : application .getConnectorService().getClientProtocols()) { boolean clientFound = false;
this.getConnectorService().getClientProtocols().add(Protocol.HTTP); this.getConnectorService().getClientProtocols().add(Protocol.CLAP);
.getChild(); if (!application.getConnectorService().getClientProtocols() .contains(protocol)) { getLogger()