Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2010 MediaShelf <> This file is part of fedora-client. fedora-client is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. fedora-client is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with fedora-client. If not, see <>.
package com.yourmediashelf.fedora.client.response;

A wrapper for the HTTP response to a com.yourmediashelf.fedora.client.request.FedoraRequest.

Request-specific FedoraResponse implementations should be generally preferred as they provide convenience methods specific to the kind of response. For example, GetNextPIDResponse provides a convenience method that parses the HTTP response an returns a List of the requested pids.

Note that getEntity(java.lang.Class) and getEntityInputStream() provide access to the underlying response entity, if desired. However, using these methods and the convenience methods that parse the response entity are mutually exclusive, as either will close the underlying InputStream once accessed.

Implementations of FedoraResponse MUST throw a FedoraClientException if the HTTP status code of the response is >= 400.

Edwin Shin
public interface FedoraResponse {


the HTTP Status Code of the response.
    public int getStatus();


Gets the raw response entity.

the entity response
    public InputStream getEntityInputStream();


Gets the raw response entity.

the entity response
    public <T> T getEntity(Class<T> c);


Get the media type of the response;

the media type.
    public String getType();


Close the response.

The entity input stream is closed;

    public void close();
New to GrepCode? Check out our FAQ X