Examples of downloadMap()


Examples of de.fuberlin.wiwiss.d2rq.map.Mapping.downloadMap()

  public void testGenerateDownloadMap() {
    Mapping m = MappingHelper.readFromTestFile("parser/download-map.ttl");
    MappingHelper.connectToDummyDBs(m);
    Resource name = ResourceFactory.createResource("http://example.org/dm");
    assertTrue(m.downloadMapResources().contains(name));
    DownloadMap d = m.downloadMap(name);
    assertNotNull(d);
    assertEquals("image/png",
        d.getMediaTypeValueMaker().makeValue(
            new ResultRow() {public String get(ProjectionSpec column) {return null;}}));
    assertEquals("People.pic", d.getContentDownloadColumn().qualifiedName());
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.Mapping.downloadMap()

    db = new HSQLDatabase("test");
    db.executeSQL("CREATE TABLE People (ID INT NOT NULL PRIMARY KEY, PIC_CLOB CLOB NULL, PIC_BLOB BLOB NULL)");
    db.executeSQL("INSERT INTO People VALUES (1, 'Hello World!', NULL)");
    db.executeSQL("INSERT INTO People VALUES (2, NULL, HEXTORAW('404040'))");
    Mapping m = MappingHelper.readFromTestFile("download/download-map.ttl");
    downloadCLOB = m.downloadMap(ResourceFactory.createResource("http://example.org/downloadCLOB"));
    downloadBLOB = m.downloadMap(ResourceFactory.createResource("http://example.org/downloadBLOB"));
  }

  public void tearDown() {
    db.close(true);
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.Mapping.downloadMap()

    db.executeSQL("CREATE TABLE People (ID INT NOT NULL PRIMARY KEY, PIC_CLOB CLOB NULL, PIC_BLOB BLOB NULL)");
    db.executeSQL("INSERT INTO People VALUES (1, 'Hello World!', NULL)");
    db.executeSQL("INSERT INTO People VALUES (2, NULL, HEXTORAW('404040'))");
    Mapping m = MappingHelper.readFromTestFile("download/download-map.ttl");
    downloadCLOB = m.downloadMap(ResourceFactory.createResource("http://example.org/downloadCLOB"));
    downloadBLOB = m.downloadMap(ResourceFactory.createResource("http://example.org/downloadBLOB"));
  }

  public void tearDown() {
    db.close(true);
    if (q != null) q.close();
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.Mapping.downloadMap()

  }

  private boolean handleDownload(String resourceURI, HttpServletResponse response, D2RServer server) throws IOException {
    Mapping m = D2RServer.retrieveSystemLoader(getServletContext()).getMapping();
    for (Resource r: m.downloadMapResources()) {
      DownloadMap d = m.downloadMap(r);
      DownloadContentQuery q = new DownloadContentQuery(d, resourceURI);
      if (q.hasContent()) {
        response.setContentType(q.getMediaType() != null ? q.getMediaType() : "application/octet-stream");
        InputStream is = q.getContentStream();
        OutputStream os = response.getOutputStream();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.