Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds API for direct binary access #59

Open
wants to merge 7,984 commits into
base: trunk
Choose a base branch
from

Conversation

mattvryan
Copy link

This supports an optional feature to do direct binary upload and download as described in https://wiki.apache.org/jackrabbit/Direct%20Binary%20Access. This change includes new interfaces and exceptions that comprise the API for this feature.

reschke and others added 30 commits December 29, 2016 13:37
…ated custom tags - @executeClass

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1776911 13f79535-47bb-0310-9956-ffa450edef68
…and minin type based inheritance. Currently it appears that only primaryType based inheritance is working

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1780335 13f79535-47bb-0310-9956-ffa450edef68
…and minin type based inheritance. Currently it appears that only primaryType based inheritance is working

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1780336 13f79535-47bb-0310-9956-ffa450edef68
git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1780384 13f79535-47bb-0310-9956-ffa450edef68
- Using SHA-256 instead of SHA-1 to create blob record ids


git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1785225 13f79535-47bb-0310-9956-ffa450edef68
Candidate Release Notes

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1785264 13f79535-47bb-0310-9956-ffa450edef68
* then the client cannot proceed and will have to request a new set of URIs
* with the right fileSize as maxSize
* <li>If fileSize is smaller than minPartSize, then take the first provided
* upload URI to upload the entire binary, with partSize = fileSize</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be maxPartSize?

* next URI from uploadURIs (strictly in order), proceed with a standard
* HTTP PUT for each, and for the last part use whatever segment size is
* left
* <li>If a segment fails during upload, retry (up to a certain time out)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP PUT if a HTTP(s) URI, otherwise to-be-determined...

* @return A {@link BinaryUpload} that can be used by the client to complete
* the upload via a call to {@link #completeBinaryUpload(String)},
* or {@code null} if the implementation does not support the direct
* upload feature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should throw an exception instead of returning null.

(should we also define a repository descriptor maybe?)

* <p>
* The implementation will attempt to apply the specified {@code
* downloadOptions} to the subsequent download. For example, if the caller
* knows that the URL refers to a specific type of content, the caller can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL -> URI

* if the caller wishes to accept the service provider's default
* behavior.
* @return A URI for downloading the binary directly, or {@code null} if the
* binary cannot be downloaded directly or if the underlying
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should throw instead of returning null.


/**
* Returns the MIME type that should be assumed for the binary that is to be
* downloaded. This value should be a valid {@code jcr:mimeType}. This
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"MIME" -> "Internet Media Type"

FWIW, maybe we should also not copy JCR's splitting of type and charset, and just provide the complete value for the Content-Type header field.


/**
* Returns the encoding that should be assumed for the binary that is to be
* downloaded. This value should be a valid {@code jcr:encoding}. This
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"encoding" -> "character encoding"

* instance of this class.
*
* @return A String representation of the encoding, or {@code null} if no
* encoding has been specified.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The encoding is a name, so I think that "String representation" is confusing here.

* BinaryDownloadOptionsBuilder#withDispositionTypeInline()} or {@link
* BinaryDownloadOptionsBuilder#withDispositionTypeAttachment()} when
* building an instance of this class. The default value of this setting is
* "attachment".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be IMHO "inline".

* Note that if the MIME type is text-based, the caller may also wish to
* set the encoding which is done separately. See {@link
* #withEncoding(String)}.
* <p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Note that if the internet media type defines a charset parameter, ...."

* Calling this method has the effect of instructing the service
* provider to set {@code encoding} as the encoding of the content type
* in the {@code Content-Type} header of the response to a request
* issued with a URI obtained by calling {@link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"header" -> "header field"

* call to {@link #build()}.
* <p>
* If no filename is provided, no {@code Content-Disposition} header
* will be specified to the service provider.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need to define the case of no filename but non-default disposition type.

reschke and others added 7 commits July 24, 2018 12:38
- terminology (mime type -> internet media type, encoding -> character encoding)
- add links to RFC 6266
- make disposition type "inline" default
- break the connection between disposition type and filename
Default value is "inline" as was documented before.  This change
makes sure that a value is always set, that inline is the default,
and that the getter is declared as always returning a value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants