TypedRest for Java
|
REST endpoint that represents a single binary blob that can downloaded and uploaded. More...
Public Member Functions | |
void | probe () throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Queries the server about capabilities of the endpoint without performing any action. More... | |
Optional< Boolean > | isDownloadAllowed () |
Shows whether the server has indicated that download() is currently allowed. More... | |
InputStream | download () throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Downloads the blob's content. More... | |
Optional< Boolean > | isUploadAllowed () |
Shows whether the server has indicated that upload(java.io.InputStream, org.apache.http.entity.ContentType) is currently allowed. More... | |
void | upload (InputStream stream, ContentType contentType) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Uploads new content for the blob. More... | |
void | upload (byte[] data, ContentType contentType) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Uploads a byte array as the blob's content. More... | |
void | upload (File file, ContentType contentType) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Uploads a local file as the blob's content. More... | |
Optional< Boolean > | isDeleteAllowed () |
Shows whether the server has indicated that delete() is currently allowed. More... | |
void | delete () throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Deletes the blob from the server. More... | |
![]() | |
URI | getUri () |
The HTTP URI of the remote resource. More... | |
Executor | getExecutor () |
The REST executor used to communicate with the remote resource. More... | |
ObjectMapper | getSerializer () |
Controls the serialization of entities sent to and received from the server. More... | |
Set< URI > | getLinks (String rel) |
Retrieves all links with a specific relation type cached from the last request. More... | |
Map< URI, String > | getLinksWithTitles (String rel) |
Retrieves all links (with titles) with a specific relation type cached from the last request. More... | |
URI | link (String rel) |
Retrieves a single link with a specific relation type. More... | |
UriTemplate | linkTemplate (String rel) |
Retrieves a link template with a specific relation type. More... | |
default URI | linkTemplate (String rel, String variableName, Object value) |
Retrieves a link template with a specific relation type and resolves it. More... | |
REST endpoint that represents a single binary blob that can downloaded and uploaded.
void net.typedrest.BlobEndpoint.delete | ( | ) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Deletes the blob from the server.
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
Implemented in net.typedrest.BlobEndpointImpl.
InputStream net.typedrest.BlobEndpoint.download | ( | ) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Downloads the blob's content.
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
Implemented in net.typedrest.BlobEndpointImpl.
Optional<Boolean> net.typedrest.BlobEndpoint.isDeleteAllowed | ( | ) |
Shows whether the server has indicated that delete() is currently allowed.
Uses cached data from last response.
Implemented in net.typedrest.BlobEndpointImpl.
Optional<Boolean> net.typedrest.BlobEndpoint.isDownloadAllowed | ( | ) |
Shows whether the server has indicated that download() is currently allowed.
Uses cached data from last response.
Implemented in net.typedrest.BlobEndpointImpl.
Optional<Boolean> net.typedrest.BlobEndpoint.isUploadAllowed | ( | ) |
Shows whether the server has indicated that upload(java.io.InputStream, org.apache.http.entity.ContentType) is currently allowed.
Uses cached data from last response.
Implemented in net.typedrest.BlobEndpointImpl.
void net.typedrest.BlobEndpoint.probe | ( | ) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Queries the server about capabilities of the endpoint without performing any action.
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
Implemented in net.typedrest.BlobEndpointImpl.
void net.typedrest.BlobEndpoint.upload | ( | InputStream | stream, |
ContentType | contentType | ||
) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Uploads new content for the blob.
stream | A stream with the blob's new content. |
contentType | The MIME type of the file to upload. |
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
Implemented in net.typedrest.BlobEndpointImpl.
void net.typedrest.BlobEndpoint.upload | ( | byte [] | data, |
ContentType | contentType | ||
) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Uploads a byte array as the blob's content.
data | The byte array holding the data to upload. |
contentType | The MIME type of the file to upload. |
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
Implemented in net.typedrest.BlobEndpointImpl.
void net.typedrest.BlobEndpoint.upload | ( | File | file, |
ContentType | contentType | ||
) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Uploads a local file as the blob's content.
file | The local file to read the data from. |
contentType | The MIME type of the file to upload. |
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
Implemented in net.typedrest.BlobEndpointImpl.