Package org.restlet.resource

Examples of org.restlet.resource.ResourceException


    private Iterable<IFragmentInfo> _getFragments() throws ResourceException {
        try {
            return _storage.getFragmentInfos(_collInfo.getCollectionId(), getConfiguration().getFragmentSortOrder());
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
    }
View Full Code Here


            try {
                _snapshotInfo = snapshotId != null ? _storage.getSnapshotInfo(_collInfo.getCollectionId(), snapshotId)
                                           : null;
            }
            catch (StorageException ex) {
                throw new ResourceException(ex);
            }
        }
    }
View Full Code Here

     * @see org.restlet.resource.ServerResource#get(org.restlet.representation.Variant)
     */
    @Override
    public Representation get(Variant variant) throws ResourceException {
        if (!isExisting()) {
            throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
        }
        IWritableRepresentation tm = null;
        try {
            tm = _storage.getSnapshot(_collInfo.getCollectionId(),
                                      _snapshotInfo.getSnapshotId(),
                                      MediaTypeUtils.toAtomicoMediaType(variant.getMediaType()));
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
        return new WritableAwareRepresentation(variant.getMediaType(), tm,
                _snapshotInfo.getUpdated());
    }
View Full Code Here

    protected void doInit() throws ResourceException {
        try {
            _lastModification = _storage.lastModification();
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
    }
View Full Code Here

    private Iterable<ICollectionInfo> _getCollections() throws ResourceException {
        try {
            return _storage.getCollectionInfos(getConfiguration().getCollectionSortOrder());
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
    }
View Full Code Here

        try {
            _lastModification = _collInfo == null ? -1
                                                  : _storage.lastSnapshotModification(_collInfo.getCollectionId());
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
    }
View Full Code Here

    private Iterable<ISnapshotInfo> _getSnapshots() throws ResourceException {
        try {
            return _storage.getSnapshotInfos(_collInfo.getCollectionId(), getConfiguration().getSnapshotSortOrder());
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
    }
View Full Code Here

            final QueryClient queryClient = new DistributedQueryClientImpl(fullServerNames, handler);
            final Map<String, String> ext = new HashMap<String, String>();
            ext.put("maxRows", Long.toString(maxRows));
            return queryClient.executeQuery(queryString, ext);
        } catch (Exception e) {
            throw new ResourceException(e);
        }
    }
View Full Code Here

            this.answer = sparqlConnection.executeQuery(graph, queryString);
            this.maxRows = newMaxRows;
            this.tooManyRows = answer.numberOfTuples() > newMaxRows;
            return answer;
        } catch (Exception e) {
            throw new ResourceException(e);
        }
    }
View Full Code Here

                String id = getStringValue(resource, ID);
                String name = getStringValue(resource, NAME);
                idNameMap.put(id, name);
            }
        } catch (Exception e) {
            throw new ResourceException(SERVER_ERROR_INTERNAL, e);
        }
        return idNameMap;
    }
View Full Code Here

TOP

Related Classes of org.restlet.resource.ResourceException

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.