public EngineApplication(Engine engine) { this.engine = engine; getMetadataService().addExtension("log", MediaType.TEXT_PLAIN ); getMetadataService().addExtension("cxml", MediaType.APPLICATION_XML ); setStatusService(new EngineStatusService()); }
/** * Maps an extension to some metadata (media type, language or character * set) to an extension. * * @param extension * The extension name. * @param metadata * The metadata to map. */ public void addExtension(String extension, Metadata metadata) { addExtension(extension, metadata, false); }
/** * Maps an extension to some metadata (media type, language or character * set) to an extension. * * @param extension * The extension name. * @param metadata * The metadata to map. */ public void addExtension(String extension, Metadata metadata) { addExtension(extension, metadata, false); }
/** * Sets the mappings from extension names to metadata. * * @param mappings * The mappings from extension names to metadata. * @deprecated */ @Deprecated public void setMappings(Map<String, Metadata> mappings) { this.mappings.clear(); for (final String extension : mappings.keySet()) { addExtension(extension, mappings.get(extension), false); } } }
addExtension("en", Language.ENGLISH); addExtension("es", Language.SPANISH); addExtension("fr", Language.FRENCH); addExtension("ai", MediaType.APPLICATION_POSTSCRIPT); addExtension("atom", MediaType.APPLICATION_ATOM_XML); addExtension("au", MediaType.AUDIO_BASIC); addExtension("bin", MediaType.APPLICATION_OCTET_STREAM); addExtension("bmp", MediaType.IMAGE_BMP); addExtension("class", MediaType.APPLICATION_JAVA); addExtension("css", MediaType.TEXT_CSS); addExtension("dib", MediaType.IMAGE_BMP); addExtension("doc", MediaType.APPLICATION_WORD); addExtension("dtd", MediaType.APPLICATION_XML_DTD); addExtension("eps", MediaType.APPLICATION_POSTSCRIPT); addExtension("exe", MediaType.APPLICATION_OCTET_STREAM); addExtension("fmt", Encoding.FREEMARKER); addExtension("gif", MediaType.IMAGE_GIF); addExtension("hqx", MediaType.APPLICATION_MAC_BINHEX40); addExtension("htm", MediaType.TEXT_HTML); addExtension("html", MediaType.TEXT_HTML); addExtension("ico", MediaType.IMAGE_ICON); addExtension("jad", MediaType.TEXT_J2ME_APP_DESCRIPTOR); addExtension("jar", MediaType.APPLICATION_JAVA_ARCHIVE); addExtension("java", MediaType.TEXT_PLAIN); addExtension("jnlp", MediaType.APPLICATION_JNLP); addExtension("jpe", MediaType.IMAGE_JPEG); addExtension("jpeg", MediaType.IMAGE_JPEG); addExtension("jpg", MediaType.IMAGE_JPEG);
public EngineApplication(Engine engine) { this.engine = engine; getMetadataService().addExtension("log", MediaType.TEXT_PLAIN ); getMetadataService().addExtension("cxml", MediaType.APPLICATION_XML ); setStatusService(new EngineStatusService()); }
this.getMetadataService().addExtension("rdf", MediaType.APPLICATION_RDF_XML, true); this.getMetadataService().addExtension("rj", RestletUtilMediaType.APPLICATION_RDF_JSON, true); this.getMetadataService().addExtension("owl", MediaType.APPLICATION_RDF_XML, false); this.getMetadataService().addExtension("json", MediaType.APPLICATION_JSON, true); this.getMetadataService().addExtension("ttl", MediaType.APPLICATION_RDF_TURTLE, true); this.getMetadataService().addExtension("n3", MediaType.TEXT_RDF_N3, true); this.getMetadataService().addExtension("nt", MediaType.TEXT_RDF_NTRIPLES, true); this.getMetadataService().addExtension("nq", MediaType.register("text/nquads", "The NQuads extension to the NTriples RDF serialisation"), true); this.getMetadataService().addExtension("js", MediaType.TEXT_JAVASCRIPT, true); this.getMetadataService().addExtension("css", MediaType.TEXT_CSS, true); this.getMetadataService().addExtension("multipart", MediaType.MULTIPART_FORM_DATA, true); this.getMetadataService().addExtension("form", MediaType.APPLICATION_WWW_FORM, false);
public RestApplication( @Uses Context parentContext ) { super( parentContext ); getMetadataService().addExtension( "srj", APPLICATION_SPARQL_JSON ); getTunnelService().setExtensionsTunnel( true ); }
/** * 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); }