@@ -31,8 +31,7 @@ private DbxRequestConfig(String clientIdentifier, /*@Nullable*/ String userLocal
31
31
/**
32
32
* Creates a new configuration.
33
33
*
34
- * @param clientIdentifier client identifier typically in the form "Name/Version" to be used in
35
- * the User-Agent header (see {@link #getClientIdentifier}).
34
+ * @param clientIdentifier see {@link #getClientIdentifier}
36
35
*/
37
36
public DbxRequestConfig (String clientIdentifier ) {
38
37
this (clientIdentifier , null );
@@ -41,10 +40,8 @@ public DbxRequestConfig(String clientIdentifier) {
41
40
/**
42
41
* Creates a new configuration.
43
42
*
44
- * @param clientIdentifier client identifier typically in the form "Name/Version" to be used in
45
- * the User-Agent header (see {@link #getClientIdentifier}).
46
- * @param userLocale IETF BCP 47 language tag of locale to use for user-visible text in responses, or
47
- * {@code null} to use the user's Dropbox locale preference.
43
+ * @param clientIdentifier see {@link #getClientIdentifier}
44
+ * @param userLocale see {@link #getUserLocale}
48
45
*
49
46
* @deprecated Use {@link #newBuilder} to customize configuration
50
47
*/
@@ -56,11 +53,9 @@ public DbxRequestConfig(String clientIdentifier, /*@Nullable*/ String userLocale
56
53
/**
57
54
* Creates a new configuration.
58
55
*
59
- * @param clientIdentifier client identifier typically in the form "Name/Version" to be used in
60
- * the User-Agent header (see {@link #getClientIdentifier}).
61
- * @param userLocale IETF BCP 47 language tag of locale to use for user-visible text in responses, or
62
- * {@code null} to use the user's Dropbox locale preference.
63
- * @param httpRequestor HTTP client to use for issuing requests.
56
+ * @param clientIdentifier see {@link #getClientIdentifier}
57
+ * @param userLocale see {@link #getUserLocale}
58
+ * @param httpRequestor see {@link #getHttpRequestor}
64
59
*
65
60
* @deprecated Use {@link #newBuilder} to customize configuration
66
61
*/
@@ -70,57 +65,54 @@ public DbxRequestConfig(String clientIdentifier, /*@Nullable*/ String userLocale
70
65
}
71
66
72
67
/**
73
- * Returns an identifier for the API client, typically of the form "Name/Version".
74
- * This is used to set the HTTP {@code User-Agent} header when making API requests.
75
- * Example: {@code "PhotoEditServer/1.3"}
68
+ * Returns the {@link clientIdentifier} you passed in when constructing this object.
76
69
*
77
70
* <p>
78
- * If you're the author a higher-level library on top of the basic SDK, and the
79
- * "Photo Edit" Android app is using your library to access Dropbox, you should append
80
- * your library's name and version to form the full identifier. For example,
81
- * if your library is called "File Picker", you might set this field to:
82
- * {@code "PhotoEditAndroid/2.4 FilePicker/0.1-beta"}
71
+ * The client identifier is usually of the form "SoftwareName/SoftwareVersion".
72
+ * For example, if you have a project named "PhotoEdit", your might set the client
73
+ * identifier to {@code "PhotoEditServer/1.3"} in your server software and to
74
+ * {@code "PhotoEditAndroid/1.8"} in your Android app.
83
75
* </p>
84
76
*
85
77
* <p>
86
- * The exact format of the {@code User-Agent} header is described in
87
- * <a href="http://tools.ietf.org/html/rfc2616#section-3.8">section 3.8 of the HTTP specification</a>.
78
+ * This value is prepended to the
79
+ * <a href="https://tools.ietf.org/html/rfc7231#section-5.5.3">"User-Agent"
80
+ * HTTP header</a> on all requests made to the Dropbox API. This has no effect on the
81
+ * behavior of the Dropbox API, but it may help identify your application when
82
+ * debugging things later.
88
83
* </p>
89
- *
90
- * <p>
91
- * Note that the underlying {@link com.dropbox.core.http.HttpRequestor HttpRequestor} may
92
- * append other things to the {@code User-Agent}, such as the name of the library being used to
93
- * actually make the HTTP request, or the version of the Java VM.
94
- * </p>
95
- *
96
- * @return HTTP User-Agent identifier for the API client
97
84
*/
98
85
public String getClientIdentifier () {
99
86
return clientIdentifier ;
100
87
}
101
88
102
89
/**
103
- * Returns the locale of the user of your app as an IETF BCP 47 language tag. This is used by
104
- * the Dropbox server to localize user-visible strings returned by API calls .
90
+ * Returns the {@code userLocale} you passed in when constructing this object, which
91
+ * defaults to {@code null} .
105
92
*
106
- * <p> If the value is {@code null} or some locale that Dropbox doesn't support, the strings
107
- * will be localized based on the user's Dropbox locale preference.
93
+ * <p>
94
+ * This should be set to the <a href="https://tools.ietf.org/html/bcp47">IETF BCP 47
95
+ * language tag</a> of the end user currently using your software. Example: "en-US".
96
+ * </p>
108
97
*
109
- * <p> Defaults to {@code null}.
98
+ * <p>
99
+ * This value is passed in as the "Dropbox-API-User-Locale" HTTP header on all requests
100
+ * made to the Dropbox API. It controls the language used by the Dropbox API for certain
101
+ * return values, e.g. like error messages intended for the user.
102
+ * </p>
110
103
*
111
- * @return locale of app user, or {@code null} to use user's Dropbox locale settings.
104
+ * <p>
105
+ * If {@code null}, or if set to a value Dropbox doesn't support, the server will default
106
+ * to the user's configured locale setting.
107
+ * </p>
112
108
*/
113
109
public String getUserLocale () {
114
110
return userLocale ;
115
111
}
116
112
117
113
/**
118
- * The {@link HttpRequestor} implementation to use when making HTTP requests to the Dropbox API
119
- * servers.
120
- *
121
- * <p> Defaults to {@link StandardHttpRequestor#INSTANCE}.
122
- *
123
- * @return HTTP requestor to use for issuing HTTP requests.
114
+ * Returns the {@link HttpRequestor} you passed in when constructing this object, which
115
+ * defaults to {@link StandardHttpRequestor#INSTANCE}.
124
116
*/
125
117
public HttpRequestor getHttpRequestor () {
126
118
return httpRequestor ;
@@ -178,11 +170,7 @@ public Builder copy() {
178
170
/**
179
171
* Returns a new builder for creating a {@link DbxRequestConfig} instance.
180
172
*
181
- * Identifiers are typically of the form "Name/Version" (e.g. {@code
182
- * "PhotoEditServer/1.3"}). See {@link #getClientIdentifier} for more details.
183
- *
184
- * @param clientIdentifier HTTP User-Agent identifier for the API app (see {@link
185
- * #getClientIdentifier}), never {@code null}
173
+ * @param clientIdentifier see {@link #getClientIdentifier}
186
174
*/
187
175
public static Builder newBuilder (String clientIdentifier ) {
188
176
if (clientIdentifier == null ) throw new NullPointerException ("clientIdentifier" );
0 commit comments