Package org.restlet.resource

Examples of org.restlet.resource.ResourceException


        final String collId = (String) getRequest().getAttributes().get(COLLECTION_ID);
        try {
            _collInfo = collId == null ? null : _storage.getCollectionInfo(collId);
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
        if (mustExist && _collInfo == null) {
            throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
        }
    }
View Full Code Here


     * @throws ResourceException If this resource didn't find the collection
     *          to operate upon.
     */
    protected final String linkToSnapshots() throws ResourceException {
        if (_collInfo == null) {
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL);
        }
        return _getRoot()
                + linkToSnapshots(_collInfo.getCollectionId());
    }
View Full Code Here

     * @throws ResourceException If this resource didn't find the collection
     *          to operate upon.
     */
    protected final String linkToFragments() throws ResourceException {
        if (_collInfo == null) {
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL);
        }
        return _getRoot()
                + linkToFragments(_collInfo.getCollectionId());
    }
View Full Code Here

     * @return The link to the specified collection.
     * @throws ResourceException In case the collection does not exist.
     */
    protected final String linkToCollection(ICollectionInfo collectionInfo) throws ResourceException {
        if (collectionInfo == null) {
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL);
        }
        return _getRoot()
                + linkToCollection(collectionInfo.getCollectionId());
    }
View Full Code Here

     * @return
     * @throws ResourceException
     */
    protected final String linkTo(final ISnapshotInfo info) throws ResourceException {
        if (_collInfo == null) {
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL);
        }
        return _getRoot()
                + linkToSnapshot(
                        _collInfo.getCollectionId(), info.getSnapshotId());
    }
View Full Code Here

     * @return
     * @throws ResourceException
     */
    protected final String linkTo(final IFragmentInfo info) throws ResourceException {
        if (_collInfo == null) {
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL);
        }
        return _getRoot()
                + linkToFragment(
                        _collInfo.getCollectionId(), info.getFragmentId());
    }
View Full Code Here

                    .getAttributes().get(FRAGMENT_ID);
            _fragmentInfo = fragmentId != null ? _storage.getFragmentInfo(
                    _collInfo.getCollectionId(), fragmentId) : null;
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
    }
View Full Code Here

            tm = _storage.getFragment(_collInfo.getCollectionId(),
                    _fragmentInfo.getFragmentId(), MediaTypeUtils
                            .toAtomicoMediaType(variant.getMediaType()));
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
        return new WritableAwareRepresentation(variant.getMediaType(), tm,
                _fragmentInfo.getUpdated());
    }
View Full Code Here

        try {
            _fragmentModification = _storage.lastFragmentModification(_collInfo.getCollectionId());
            _snapshotModification = _storage.lastSnapshotModification(_collInfo.getCollectionId());
        }
        catch (StorageException ex) {
            throw new ResourceException(Status.SERVER_ERROR_INTERNAL, ex);
        }
    }
View Full Code Here

        try {
            _lastModification = _collInfo == null ? -1
                                                  : _storage.lastFragmentModification(_collInfo.getCollectionId());
        }
        catch (StorageException ex) {
            throw new ResourceException(ex);
        }
    }
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.