Examples of RepositoryItem


Examples of com.kurento.kmf.repository.RepositoryItem

  }

  @Test
  public void testFileUploadWithPOSTAndDownload() throws Exception {

    RepositoryItem repositoryItem = getRepository().createRepositoryItem();

    String id = repositoryItem.getId();

    File fileToUpload = new File("test-files/sample.txt");
    RepositoryHttpRecorder recorder = repositoryItem
        .createRepositoryHttpRecorder();

    uploadFileWithPOST(recorder.getURL(), fileToUpload);

    recorder.stop();

    RepositoryItem newRepositoryItem = getRepository()
        .findRepositoryItemById(id);

    File downloadedFile = new File("test-files/tmp/" + id);
    downloadFromURL(
        newRepositoryItem.createRepositoryHttpPlayer().getURL(),
        downloadedFile);

    assertTrue(TestUtils.equalFiles(fileToUpload, downloadedFile));
  }
View Full Code Here

Examples of com.kurento.kmf.repository.RepositoryItem

  public void execute() throws Exception {

    startServer();

    RepositoryItem repositoryItem = getRepository().createRepositoryItem();

    prepareToUploadVideo(repositoryItem);
    prepareToDownloadVideo(repositoryItem);

    stopServer();
View Full Code Here

Examples of org.geoserver.csw.store.RepositoryItem

        domain.close();
    }
   
    @Test
    public void testGetRepositoryItem() throws IOException {
        RepositoryItem item = store.getRepositoryItem("foo");
        assertNull(item);
       
        item = store.getRepositoryItem("urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f");
        assertNotNull(item);
        assertEquals("application/xml", item.getMime());
        String contents = IOUtils.toString(item.getContents(), "UTF-8");
        String expected = "This is a random comment that will show up only when fetching the repository item";
        assertTrue(contents.contains(expected));
    }
View Full Code Here

Examples of org.geoserver.csw.store.RepositoryItem

     * @param request
     * @return
     */
    public RepositoryItem run(GetRepositoryItemType request)  {
        try {
            RepositoryItem item = store.getRepositoryItem(request.getId());
            if(item == null) {
                // by spec we have to return a 404
                throw new HttpErrorCodeException(404, "No repository item found for id " + request.getId());
            }
            return item;
View Full Code Here

Examples of org.geoserver.csw.store.RepositoryItem

        SimpleRecordIterator it = new SimpleRecordIterator(root, 0);
        while(it.hasNext()) {
            Feature f = it.next();
            if(recordId.equals(f.getIdentifier().getID())) {
                final File file = it.getLastFile();
                return new RepositoryItem() {
                   
                    @Override
                    public String getMime() {
                        return "application/xml";
                    }
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.