Package org.geoserver.csw.store

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


     * @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

        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

Related Classes of org.geoserver.csw.store.RepositoryItem

Copyright © 2018 www.massapicom. 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.