id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
112,300 | JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/AnimatorSet.java | AnimatorSet.isRunning | @Override
public boolean isRunning() {
for (Node node : mNodes) {
if (node.animation.isRunning()) {
return true;
}
}
return false;
} | java | @Override
public boolean isRunning() {
for (Node node : mNodes) {
if (node.animation.isRunning()) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"isRunning",
"(",
")",
"{",
"for",
"(",
"Node",
"node",
":",
"mNodes",
")",
"{",
"if",
"(",
"node",
".",
"animation",
".",
"isRunning",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";... | Returns true if any of the child animations of this AnimatorSet have been started and have
not yet ended.
@return Whether this AnimatorSet has been started and has not yet ended. | [
"Returns",
"true",
"if",
"any",
"of",
"the",
"child",
"animations",
"of",
"this",
"AnimatorSet",
"have",
"been",
"started",
"and",
"have",
"not",
"yet",
"ended",
"."
] | d582f0ec8e79013e9fa96c07986160b52e662e63 | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/AnimatorSet.java#L355-L363 |
112,301 | JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/AnimatorSet.java | AnimatorSet.setDuration | @Override
public AnimatorSet setDuration(long duration) {
if (duration < 0) {
throw new IllegalArgumentException("duration must be a value of zero or greater");
}
for (Node node : mNodes) {
// TODO: don't set the duration of the timing-only nodes created by AnimatorSe... | java | @Override
public AnimatorSet setDuration(long duration) {
if (duration < 0) {
throw new IllegalArgumentException("duration must be a value of zero or greater");
}
for (Node node : mNodes) {
// TODO: don't set the duration of the timing-only nodes created by AnimatorSe... | [
"@",
"Override",
"public",
"AnimatorSet",
"setDuration",
"(",
"long",
"duration",
")",
"{",
"if",
"(",
"duration",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"duration must be a value of zero or greater\"",
")",
";",
"}",
"for",
"(",
... | Sets the length of each of the current child animations of this AnimatorSet. By default,
each child animation will use its own duration. If the duration is set on the AnimatorSet,
then each child animation inherits this duration.
@param duration The length of the animation, in milliseconds, of each of the child
animat... | [
"Sets",
"the",
"length",
"of",
"each",
"of",
"the",
"current",
"child",
"animations",
"of",
"this",
"AnimatorSet",
".",
"By",
"default",
"each",
"child",
"animation",
"will",
"use",
"its",
"own",
"duration",
".",
"If",
"the",
"duration",
"is",
"set",
"on",... | d582f0ec8e79013e9fa96c07986160b52e662e63 | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/AnimatorSet.java#L413-L425 |
112,302 | dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java | DropboxAuth.doStart | public void doStart(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
if (!common.checkPost(request, response)) return;
User user = common.requireLoggedInUser(request, response);
if (user == null) return;
// Start the authorizat... | java | public void doStart(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
if (!common.checkPost(request, response)) return;
User user = common.requireLoggedInUser(request, response);
if (user == null) return;
// Start the authorizat... | [
"public",
"void",
"doStart",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"!",
"common",
".",
"checkPost",
"(",
"request",
",",
"response",
")",
")",
"return"... | Start the process of getting a Dropbox API access token for the user's Dropbox account. | [
"Start",
"the",
"process",
"of",
"getting",
"a",
"Dropbox",
"API",
"access",
"token",
"for",
"the",
"user",
"s",
"Dropbox",
"account",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java#L31-L48 |
112,303 | dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java | DropboxAuth.doFinish | public void doFinish(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
if (!common.checkGet(request, response)) return;
User user = common.requireLoggedInUser(request, response);
if (user == null) {
common.pageSoftError(resp... | java | public void doFinish(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
if (!common.checkGet(request, response)) return;
User user = common.requireLoggedInUser(request, response);
if (user == null) {
common.pageSoftError(resp... | [
"public",
"void",
"doFinish",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"!",
"common",
".",
"checkGet",
"(",
"request",
",",
"response",
")",
")",
"return"... | an HTTP POST. | [
"an",
"HTTP",
"POST",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java#L59-L107 |
112,304 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxWebAuth.java | DbxWebAuth.start | @Deprecated
public String start(/*@Nullable*/String urlState) {
if (deprecatedRequest == null) {
throw new IllegalStateException("Must use DbxWebAuth.authorize instead.");
}
return authorizeImpl(
deprecatedRequest.copy()
.withState(urlState)
... | java | @Deprecated
public String start(/*@Nullable*/String urlState) {
if (deprecatedRequest == null) {
throw new IllegalStateException("Must use DbxWebAuth.authorize instead.");
}
return authorizeImpl(
deprecatedRequest.copy()
.withState(urlState)
... | [
"@",
"Deprecated",
"public",
"String",
"start",
"(",
"/*@Nullable*/",
"String",
"urlState",
")",
"{",
"if",
"(",
"deprecatedRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Must use DbxWebAuth.authorize instead.\"",
")",
";",
"}",
... | Starts authorization and returns a "authorization URL" on the Dropbox website that gives the
lets the user grant your app access to their Dropbox account.
<p> If a redirect URI was specified, then users will be redirected to the redirect URI after
completing the authorization flow. Call {@link #finishFromRedirect fini... | [
"Starts",
"authorization",
"and",
"returns",
"a",
"authorization",
"URL",
"on",
"the",
"Dropbox",
"website",
"that",
"gives",
"the",
"lets",
"the",
"user",
"grant",
"your",
"app",
"access",
"to",
"their",
"Dropbox",
"account",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxWebAuth.java#L213-L224 |
112,305 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxWebAuth.java | DbxWebAuth.finishFromRedirect | public DbxAuthFinish finishFromRedirect(String redirectUri,
DbxSessionStore sessionStore,
Map<String, String[]> params)
throws DbxException, BadRequestException, BadStateException, CsrfException, NotApprovedException, Provid... | java | public DbxAuthFinish finishFromRedirect(String redirectUri,
DbxSessionStore sessionStore,
Map<String, String[]> params)
throws DbxException, BadRequestException, BadStateException, CsrfException, NotApprovedException, Provid... | [
"public",
"DbxAuthFinish",
"finishFromRedirect",
"(",
"String",
"redirectUri",
",",
"DbxSessionStore",
"sessionStore",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"params",
")",
"throws",
"DbxException",
",",
"BadRequestException",
",",
"BadStateExcepti... | Call this after the user has visited the authorizaton URL and Dropbox has redirected them
back to you at the redirect URI.
@param redirectUri The original redirect URI used by {@link #authorize}, never {@code null}.
@param sessionStore Session store used by {@link #authorize} to store CSRF tokens, never
{@code null}.
... | [
"Call",
"this",
"after",
"the",
"user",
"has",
"visited",
"the",
"authorizaton",
"URL",
"and",
"Dropbox",
"has",
"redirected",
"them",
"back",
"to",
"you",
"at",
"the",
"redirect",
"URI",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxWebAuth.java#L351-L397 |
112,306 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java | DbxOfficialAppConnector.addExtrasToIntent | protected void addExtrasToIntent(Context context, Intent intent) {
intent.putExtra(EXTRA_DROPBOX_UID, uid);
intent.putExtra(EXTRA_CALLING_PACKAGE, context.getPackageName());
} | java | protected void addExtrasToIntent(Context context, Intent intent) {
intent.putExtra(EXTRA_DROPBOX_UID, uid);
intent.putExtra(EXTRA_CALLING_PACKAGE, context.getPackageName());
} | [
"protected",
"void",
"addExtrasToIntent",
"(",
"Context",
"context",
",",
"Intent",
"intent",
")",
"{",
"intent",
".",
"putExtra",
"(",
"EXTRA_DROPBOX_UID",
",",
"uid",
")",
";",
"intent",
".",
"putExtra",
"(",
"EXTRA_CALLING_PACKAGE",
",",
"context",
".",
"ge... | Add uid information to an explicit intent directed to DropboxApp | [
"Add",
"uid",
"information",
"to",
"an",
"explicit",
"intent",
"directed",
"to",
"DropboxApp"
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java#L117-L120 |
112,307 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java | DbxOfficialAppConnector.getLoggedinState | private static int getLoggedinState(Context context, String uid) {
Cursor cursor = context.getContentResolver().query(
LOGGED_IN_URI.buildUpon().appendPath(uid).build(), null, // projection
null, // selection clause
null, // selection args
null); // sort order
... | java | private static int getLoggedinState(Context context, String uid) {
Cursor cursor = context.getContentResolver().query(
LOGGED_IN_URI.buildUpon().appendPath(uid).build(), null, // projection
null, // selection clause
null, // selection args
null); // sort order
... | [
"private",
"static",
"int",
"getLoggedinState",
"(",
"Context",
"context",
",",
"String",
"uid",
")",
"{",
"Cursor",
"cursor",
"=",
"context",
".",
"getContentResolver",
"(",
")",
".",
"query",
"(",
"LOGGED_IN_URI",
".",
"buildUpon",
"(",
")",
".",
"appendPa... | Determine if user uid is logged in
@param context
@param uid
@return NO_USER if no users connected CORRECT_USER if uid connected WRONG_USER if uid not
connected | [
"Determine",
"if",
"user",
"uid",
"is",
"logged",
"in"
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java#L154-L167 |
112,308 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java | DbxOfficialAppConnector.getDropboxAppPackage | static PackageInfo getDropboxAppPackage(Context context, Intent intent) {
PackageManager manager = context.getPackageManager();
List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
if (null == infos || 1 != infos.size()) {
// The official app doesn't exist, or only an... | java | static PackageInfo getDropboxAppPackage(Context context, Intent intent) {
PackageManager manager = context.getPackageManager();
List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
if (null == infos || 1 != infos.size()) {
// The official app doesn't exist, or only an... | [
"static",
"PackageInfo",
"getDropboxAppPackage",
"(",
"Context",
"context",
",",
"Intent",
"intent",
")",
"{",
"PackageManager",
"manager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"List",
"<",
"ResolveInfo",
">",
"infos",
"=",
"manager",
".",
... | Verify that intent will be processed by Dropbox App
@return PackageInfo of DropboxApp if Dropbox App can process intent, else null | [
"Verify",
"that",
"intent",
"will",
"be",
"processed",
"by",
"Dropbox",
"App"
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java#L263-L297 |
112,309 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxRequestConfig.java | DbxRequestConfig.toLanguageTag | private static String toLanguageTag(Locale locale) {
if (locale == null) {
return null;
}
StringBuilder tag = new StringBuilder();
tag.append(locale.getLanguage().toLowerCase());
if (!locale.getCountry().isEmpty()) {
tag.append("-");
tag.appe... | java | private static String toLanguageTag(Locale locale) {
if (locale == null) {
return null;
}
StringBuilder tag = new StringBuilder();
tag.append(locale.getLanguage().toLowerCase());
if (!locale.getCountry().isEmpty()) {
tag.append("-");
tag.appe... | [
"private",
"static",
"String",
"toLanguageTag",
"(",
"Locale",
"locale",
")",
"{",
"if",
"(",
"locale",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"tag",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"tag",
".",
"append",
"(",
"... | Available in Java 7, but not in Java 6. Do a hacky version of it here. | [
"Available",
"in",
"Java",
"7",
"but",
"not",
"in",
"Java",
"6",
".",
"Do",
"a",
"hacky",
"version",
"of",
"it",
"here",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxRequestConfig.java#L181-L195 |
112,310 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxRequestConfig.java | DbxRequestConfig.toLanguageTag | private static String toLanguageTag(String locale) {
if (locale == null) {
return null;
}
// assume we are already a language tag
if (!locale.contains("_")) {
return locale;
}
// language can be missing, in which case we don't even bother
... | java | private static String toLanguageTag(String locale) {
if (locale == null) {
return null;
}
// assume we are already a language tag
if (!locale.contains("_")) {
return locale;
}
// language can be missing, in which case we don't even bother
... | [
"private",
"static",
"String",
"toLanguageTag",
"(",
"String",
"locale",
")",
"{",
"if",
"(",
"locale",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// assume we are already a language tag",
"if",
"(",
"!",
"locale",
".",
"contains",
"(",
"\"_\"",
")... | formats to the new one. | [
"formats",
"to",
"the",
"new",
"one",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxRequestConfig.java#L200-L223 |
112,311 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getMetadata | public /*@Nullable*/DbxEntry getMetadata(final String path, boolean includeMediaInfo)
throws DbxException
{
DbxPathV1.checkArg("path", path);
String host = this.host.getApi();
String apiPath = "1/metadata/auto" + path;
/*@Nullable*/String[] params = {
"list", "fa... | java | public /*@Nullable*/DbxEntry getMetadata(final String path, boolean includeMediaInfo)
throws DbxException
{
DbxPathV1.checkArg("path", path);
String host = this.host.getApi();
String apiPath = "1/metadata/auto" + path;
/*@Nullable*/String[] params = {
"list", "fa... | [
"public",
"/*@Nullable*/",
"DbxEntry",
"getMetadata",
"(",
"final",
"String",
"path",
",",
"boolean",
"includeMediaInfo",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArg",
"(",
"\"path\"",
",",
"path",
")",
";",
"String",
"host",
"=",
"this",
"... | Get the file or folder metadata for a given path.
<pre>
DbxClientV1 dbxClient = ...
DbxEntry entry = dbxClient.getMetadata("/Photos");
if (entry == null) {
System.out.println("No file or folder at that path.");
} else {
System.out.print(entry.toStringMultiline());
}
</pre>
@param path
The path to the file or folder (... | [
"Get",
"the",
"file",
"or",
"folder",
"metadata",
"for",
"a",
"given",
"path",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L115-L137 |
112,312 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getMetadataWithChildren | public DbxEntry./*@Nullable*/WithChildren getMetadataWithChildren(String path, boolean includeMediaInfo)
throws DbxException
{
return getMetadataWithChildrenBase(path, includeMediaInfo, DbxEntry.WithChildren.ReaderMaybeDeleted);
} | java | public DbxEntry./*@Nullable*/WithChildren getMetadataWithChildren(String path, boolean includeMediaInfo)
throws DbxException
{
return getMetadataWithChildrenBase(path, includeMediaInfo, DbxEntry.WithChildren.ReaderMaybeDeleted);
} | [
"public",
"DbxEntry",
".",
"/*@Nullable*/",
"WithChildren",
"getMetadataWithChildren",
"(",
"String",
"path",
",",
"boolean",
"includeMediaInfo",
")",
"throws",
"DbxException",
"{",
"return",
"getMetadataWithChildrenBase",
"(",
"path",
",",
"includeMediaInfo",
",",
"Dbx... | Get the metadata for a given path; if the path refers to a folder,
get all the children's metadata as well.
<pre>
DbxClientV1 dbxClient = ...
DbxEntry entry = dbxClient.getMetadata("/Photos");
if (entry == null) {
System.out.println("No file or folder at that path.");
} else {
System.out.print(entry.toStringMultiline(... | [
"Get",
"the",
"metadata",
"for",
"a",
"given",
"path",
";",
"if",
"the",
"path",
"refers",
"to",
"a",
"folder",
"get",
"all",
"the",
"children",
"s",
"metadata",
"as",
"well",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L174-L178 |
112,313 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getAccountInfo | public DbxAccountInfo getAccountInfo()
throws DbxException
{
String host = this.host.getApi();
String apiPath = "1/account/info";
return doGet(host, apiPath, null, null, new DbxRequestUtil.ResponseHandler<DbxAccountInfo>() {
@Override
public DbxAccountInfo ha... | java | public DbxAccountInfo getAccountInfo()
throws DbxException
{
String host = this.host.getApi();
String apiPath = "1/account/info";
return doGet(host, apiPath, null, null, new DbxRequestUtil.ResponseHandler<DbxAccountInfo>() {
@Override
public DbxAccountInfo ha... | [
"public",
"DbxAccountInfo",
"getAccountInfo",
"(",
")",
"throws",
"DbxException",
"{",
"String",
"host",
"=",
"this",
".",
"host",
".",
"getApi",
"(",
")",
";",
"String",
"apiPath",
"=",
"\"1/account/info\"",
";",
"return",
"doGet",
"(",
"host",
",",
"apiPat... | Retrieve the user's account information. | [
"Retrieve",
"the",
"user",
"s",
"account",
"information",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L349-L364 |
112,314 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.startGetSomething | private /*@Nullable*/Downloader startGetSomething(final String apiPath,
final /*@Nullable*/String[] params)
throws DbxException
{
final String host = this.host.getContent();
// we don't use doGet() here because doGet() will close our inp... | java | private /*@Nullable*/Downloader startGetSomething(final String apiPath,
final /*@Nullable*/String[] params)
throws DbxException
{
final String host = this.host.getContent();
// we don't use doGet() here because doGet() will close our inp... | [
"private",
"/*@Nullable*/",
"Downloader",
"startGetSomething",
"(",
"final",
"String",
"apiPath",
",",
"final",
"/*@Nullable*/",
"String",
"[",
"]",
"params",
")",
"throws",
"DbxException",
"{",
"final",
"String",
"host",
"=",
"this",
".",
"host",
".",
"getConte... | Generic function that downloads either files or thumbnails. | [
"Generic",
"function",
"that",
"downloads",
"either",
"files",
"or",
"thumbnails",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L471-L520 |
112,315 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.chunkedUploadCommon | private <E extends Throwable> HttpRequestor.Response chunkedUploadCommon(String[] params, long chunkSize, DbxStreamWriter<E> writer)
throws DbxException, E
{
String apiPath = "1/chunked_upload";
ArrayList<HttpRequestor.Header> headers = new ArrayList<HttpRequestor.Header>();
headers... | java | private <E extends Throwable> HttpRequestor.Response chunkedUploadCommon(String[] params, long chunkSize, DbxStreamWriter<E> writer)
throws DbxException, E
{
String apiPath = "1/chunked_upload";
ArrayList<HttpRequestor.Header> headers = new ArrayList<HttpRequestor.Header>();
headers... | [
"private",
"<",
"E",
"extends",
"Throwable",
">",
"HttpRequestor",
".",
"Response",
"chunkedUploadCommon",
"(",
"String",
"[",
"]",
"params",
",",
"long",
"chunkSize",
",",
"DbxStreamWriter",
"<",
"E",
">",
"writer",
")",
"throws",
"DbxException",
",",
"E",
... | Internal function called by both chunkedUploadFirst and chunkedUploadAppend. | [
"Internal",
"function",
"called",
"by",
"both",
"chunkedUploadFirst",
"and",
"chunkedUploadAppend",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L930-L968 |
112,316 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.chunkedUploadAppend | public long chunkedUploadAppend(String uploadId, long uploadOffset, byte[] data, int dataOffset, int dataLength)
throws DbxException
{
return chunkedUploadAppend(uploadId, uploadOffset, dataLength, new DbxStreamWriter.ByteArrayCopier(data, dataOffset, dataLength));
} | java | public long chunkedUploadAppend(String uploadId, long uploadOffset, byte[] data, int dataOffset, int dataLength)
throws DbxException
{
return chunkedUploadAppend(uploadId, uploadOffset, dataLength, new DbxStreamWriter.ByteArrayCopier(data, dataOffset, dataLength));
} | [
"public",
"long",
"chunkedUploadAppend",
"(",
"String",
"uploadId",
",",
"long",
"uploadOffset",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"dataOffset",
",",
"int",
"dataLength",
")",
"throws",
"DbxException",
"{",
"return",
"chunkedUploadAppend",
"(",
"uploadI... | Append data to a chunked upload session.
@param uploadId
The identifier returned by {@link #chunkedUploadFirst} to identify the chunked upload
session.
@param uploadOffset
The current number of bytes uploaded to the chunked upload session. The server checks
this value to make sure it is correct. If it is correct, t... | [
"Append",
"data",
"to",
"a",
"chunked",
"upload",
"session",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1103-L1107 |
112,317 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.chunkedUploadAppend | public <E extends Throwable> long chunkedUploadAppend(String uploadId, long uploadOffset, long chunkSize, DbxStreamWriter<E> writer)
throws DbxException, E
{
if (uploadId == null) throw new IllegalArgumentException("'uploadId' can't be null");
if (uploadId.length() == 0) throw new IllegalArg... | java | public <E extends Throwable> long chunkedUploadAppend(String uploadId, long uploadOffset, long chunkSize, DbxStreamWriter<E> writer)
throws DbxException, E
{
if (uploadId == null) throw new IllegalArgumentException("'uploadId' can't be null");
if (uploadId.length() == 0) throw new IllegalArg... | [
"public",
"<",
"E",
"extends",
"Throwable",
">",
"long",
"chunkedUploadAppend",
"(",
"String",
"uploadId",
",",
"long",
"uploadOffset",
",",
"long",
"chunkSize",
",",
"DbxStreamWriter",
"<",
"E",
">",
"writer",
")",
"throws",
"DbxException",
",",
"E",
"{",
"... | Append a chunk of data to a chunked upload session.
@param uploadId
The identifier returned by {@link #chunkedUploadFirst} to identify the chunked upload
session.
@param uploadOffset
The current number of bytes uploaded to the chunked upload session. The server checks
this value to make sure it is correct. If it is... | [
"Append",
"a",
"chunk",
"of",
"data",
"to",
"a",
"chunked",
"upload",
"session",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1133-L1188 |
112,318 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.getThumbnail | public DbxEntry./*@Nullable*/File getThumbnail(
DbxThumbnailSize sizeBound, DbxThumbnailFormat format,
String path, /*@Nullable*/String rev, OutputStream target)
throws DbxException, IOException
{
if (target == null) throw new IllegalArgumentException("'target' can't be n... | java | public DbxEntry./*@Nullable*/File getThumbnail(
DbxThumbnailSize sizeBound, DbxThumbnailFormat format,
String path, /*@Nullable*/String rev, OutputStream target)
throws DbxException, IOException
{
if (target == null) throw new IllegalArgumentException("'target' can't be n... | [
"public",
"DbxEntry",
".",
"/*@Nullable*/",
"File",
"getThumbnail",
"(",
"DbxThumbnailSize",
"sizeBound",
",",
"DbxThumbnailFormat",
"format",
",",
"String",
"path",
",",
"/*@Nullable*/",
"String",
"rev",
",",
"OutputStream",
"target",
")",
"throws",
"DbxException",
... | Downloads a thumbnail for the image file at the given path in Dropbox.
@param sizeBound
The returned thumbnail will never be greater than the dimensions given here.
@param format
The image format to use for thumbnail data.
@param path
The path to the image file on Dropbox.
@param rev
The {@link DbxEntry.File#rev re... | [
"Downloads",
"a",
"thumbnail",
"for",
"the",
"image",
"file",
"at",
"the",
"given",
"path",
"in",
"Dropbox",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1768-L1778 |
112,319 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.restoreFile | public DbxEntry./*@Nullable*/File restoreFile(String path, String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
if (rev == null) throw new IllegalArgumentException("'rev' can't be null");
if (rev.length() == 0) throw new IllegalArgumentException("'rev' can't be ... | java | public DbxEntry./*@Nullable*/File restoreFile(String path, String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
if (rev == null) throw new IllegalArgumentException("'rev' can't be null");
if (rev.length() == 0) throw new IllegalArgumentException("'rev' can't be ... | [
"public",
"DbxEntry",
".",
"/*@Nullable*/",
"File",
"restoreFile",
"(",
"String",
"path",
",",
"String",
"rev",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArgNonRoot",
"(",
"\"path\"",
",",
"path",
")",
";",
"if",
"(",
"rev",
"==",
"null",
... | Takes a copy of the file at the given revision and saves it over the current latest copy.
This will create a new revision, but the file contents will match the revision you
specified.
@param path
The Dropbox path of the file to restore.
@param rev
The revision of the file you want to use to overwrite the latest revis... | [
"Takes",
"a",
"copy",
"of",
"the",
"file",
"at",
"the",
"given",
"revision",
"and",
"saves",
"it",
"over",
"the",
"current",
"latest",
"copy",
".",
"This",
"will",
"create",
"a",
"new",
"revision",
"but",
"the",
"file",
"contents",
"will",
"match",
"the"... | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1848-L1869 |
112,320 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.searchFileAndFolderNames | public List<DbxEntry> searchFileAndFolderNames(String basePath, String query)
throws DbxException
{
DbxPathV1.checkArg("basePath", basePath);
if (query == null) throw new IllegalArgumentException("'query' can't be null");
if (query.length() == 0) throw new IllegalArgumentException("'... | java | public List<DbxEntry> searchFileAndFolderNames(String basePath, String query)
throws DbxException
{
DbxPathV1.checkArg("basePath", basePath);
if (query == null) throw new IllegalArgumentException("'query' can't be null");
if (query.length() == 0) throw new IllegalArgumentException("'... | [
"public",
"List",
"<",
"DbxEntry",
">",
"searchFileAndFolderNames",
"(",
"String",
"basePath",
",",
"String",
"query",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArg",
"(",
"\"basePath\"",
",",
"basePath",
")",
";",
"if",
"(",
"query",
"==",
... | Returns metadata for all files and folders whose name matches the query string.
@param basePath
The path to search under (recursively). Pass in {@code "/"} to search everything.
@param query
A space-separated list of substrings to search for. A file matches only if it contains
all the substrings.
@return
The list of... | [
"Returns",
"metadata",
"for",
"all",
"files",
"and",
"folders",
"whose",
"name",
"matches",
"the",
"query",
"string",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1882-L1902 |
112,321 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.createShareableUrl | public /*@Nullable*/String createShareableUrl(String path)
throws DbxException
{
DbxPathV1.checkArg("path", path);
String apiPath = "1/shares/auto" + path;
String[] params = {"short_url", "false"};
return doPost(host.getApi(), apiPath, params, null, new DbxRequestUtil.Respo... | java | public /*@Nullable*/String createShareableUrl(String path)
throws DbxException
{
DbxPathV1.checkArg("path", path);
String apiPath = "1/shares/auto" + path;
String[] params = {"short_url", "false"};
return doPost(host.getApi(), apiPath, params, null, new DbxRequestUtil.Respo... | [
"public",
"/*@Nullable*/",
"String",
"createShareableUrl",
"(",
"String",
"path",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArg",
"(",
"\"path\"",
",",
"path",
")",
";",
"String",
"apiPath",
"=",
"\"1/shares/auto\"",
"+",
"path",
";",
"String",... | Creates and returns a publicly-shareable URL to a file or folder's "preview page".
This URL can be used without authentication. The preview page may contain a thumbnail or
some other preview of the file, along with a link to download the actual filel.
@param path
The Dropbox path to a file or folder.
@return
If ther... | [
"Creates",
"and",
"returns",
"a",
"publicly",
"-",
"shareable",
"URL",
"to",
"a",
"file",
"or",
"folder",
"s",
"preview",
"page",
".",
"This",
"URL",
"can",
"be",
"used",
"without",
"authentication",
".",
"The",
"preview",
"page",
"may",
"contain",
"a",
... | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1916-L1935 |
112,322 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.createTemporaryDirectUrl | public /*@Nullable*/DbxUrlWithExpiration createTemporaryDirectUrl(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/media/auto" + path;
return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler</*@Nullable*/Db... | java | public /*@Nullable*/DbxUrlWithExpiration createTemporaryDirectUrl(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/media/auto" + path;
return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler</*@Nullable*/Db... | [
"public",
"/*@Nullable*/",
"DbxUrlWithExpiration",
"createTemporaryDirectUrl",
"(",
"String",
"path",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArgNonRoot",
"(",
"\"path\"",
",",
"path",
")",
";",
"String",
"apiPath",
"=",
"\"1/media/auto\"",
"+",
... | Creates and returns a publicly-shareable URL to a file's contents. This URL can be used
without authentication. This link will stop working after a few hours.
@param path
The Dropbox path to a file.
@return
If there is no file at that path, return {@code null}. Otherwise return
a shareable URL along with the expir... | [
"Creates",
"and",
"returns",
"a",
"publicly",
"-",
"shareable",
"URL",
"to",
"a",
"file",
"s",
"contents",
".",
"This",
"URL",
"can",
"be",
"used",
"without",
"authentication",
".",
"This",
"link",
"will",
"stop",
"working",
"after",
"a",
"few",
"hours",
... | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1948-L1965 |
112,323 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.createCopyRef | public /*@Nullable*/String createCopyRef(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/copy_ref/auto" + path;
return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler</*@Nullable*/String>()
{
... | java | public /*@Nullable*/String createCopyRef(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/copy_ref/auto" + path;
return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler</*@Nullable*/String>()
{
... | [
"public",
"/*@Nullable*/",
"String",
"createCopyRef",
"(",
"String",
"path",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArgNonRoot",
"(",
"\"path\"",
",",
"path",
")",
";",
"String",
"apiPath",
"=",
"\"1/copy_ref/auto\"",
"+",
"path",
";",
"retu... | Creates and returns a "copy ref" to a file. A copy ref can be used to copy a file across
different Dropbox accounts without downloading and re-uploading.
<p>
For example, create a {@code DbxClientV1} using the access token from one account and call
{@code createCopyRef}. Then, create a {@code DbxClientV1} using the ... | [
"Creates",
"and",
"returns",
"a",
"copy",
"ref",
"to",
"a",
"file",
".",
"A",
"copy",
"ref",
"can",
"be",
"used",
"to",
"copy",
"a",
"file",
"across",
"different",
"Dropbox",
"accounts",
"without",
"downloading",
"and",
"re",
"-",
"uploading",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1988-L2007 |
112,324 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.createFolder | public DbxEntry./*@Nullable*/Folder createFolder(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String[] params = {
"root", "auto",
"path", path,
};
return doPost(host.getApi(), "1/fileops/create_folder", params, null, ne... | java | public DbxEntry./*@Nullable*/Folder createFolder(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String[] params = {
"root", "auto",
"path", path,
};
return doPost(host.getApi(), "1/fileops/create_folder", params, null, ne... | [
"public",
"DbxEntry",
".",
"/*@Nullable*/",
"Folder",
"createFolder",
"(",
"String",
"path",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArgNonRoot",
"(",
"\"path\"",
",",
"path",
")",
";",
"String",
"[",
"]",
"params",
"=",
"{",
"\"root\"",
... | Create a new folder in Dropbox.
@return
If successful, returns the metadata for the newly created folder, otherwise
returns {@code null}. | [
"Create",
"a",
"new",
"folder",
"in",
"Dropbox",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L2131-L2151 |
112,325 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.delete | public void delete(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String[] params = {
"root", "auto",
"path", path,
};
doPost(host.getApi(), "1/fileops/delete", params, null, new DbxRequestUtil.ResponseHandler<Void>() {
... | java | public void delete(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String[] params = {
"root", "auto",
"path", path,
};
doPost(host.getApi(), "1/fileops/delete", params, null, new DbxRequestUtil.ResponseHandler<Void>() {
... | [
"public",
"void",
"delete",
"(",
"String",
"path",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArgNonRoot",
"(",
"\"path\"",
",",
"path",
")",
";",
"String",
"[",
"]",
"params",
"=",
"{",
"\"root\"",
",",
"\"auto\"",
",",
"\"path\"",
",",
... | Delete a file or folder from Dropbox. | [
"Delete",
"a",
"file",
"or",
"folder",
"from",
"Dropbox",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L2156-L2175 |
112,326 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.doGet | private <T> T doGet(String host, String path, /*@Nullable*/String/*@Nullable*/[] params,
/*@Nullable*/ArrayList<HttpRequestor.Header> headers,
DbxRequestUtil.ResponseHandler<T> handler)
throws DbxException
{
return DbxRequestUtil.doGet(requestConfig, a... | java | private <T> T doGet(String host, String path, /*@Nullable*/String/*@Nullable*/[] params,
/*@Nullable*/ArrayList<HttpRequestor.Header> headers,
DbxRequestUtil.ResponseHandler<T> handler)
throws DbxException
{
return DbxRequestUtil.doGet(requestConfig, a... | [
"private",
"<",
"T",
">",
"T",
"doGet",
"(",
"String",
"host",
",",
"String",
"path",
",",
"/*@Nullable*/",
"String",
"/*@Nullable*/",
"[",
"]",
"params",
",",
"/*@Nullable*/",
"ArrayList",
"<",
"HttpRequestor",
".",
"Header",
">",
"headers",
",",
"DbxReques... | Convenience function that calls RequestUtil.doGet with the first two parameters filled in. | [
"Convenience",
"function",
"that",
"calls",
"RequestUtil",
".",
"doGet",
"with",
"the",
"first",
"two",
"parameters",
"filled",
"in",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L2214-L2220 |
112,327 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxUploader.java | DbxUploader.finish | public R finish() throws X, DbxException {
assertOpenAndUnfinished();
HttpRequestor.Response response = null;
try {
response = httpUploader.finish();
try {
if (response.getStatusCode() == 200) {
return responseSerializer.deserialize(r... | java | public R finish() throws X, DbxException {
assertOpenAndUnfinished();
HttpRequestor.Response response = null;
try {
response = httpUploader.finish();
try {
if (response.getStatusCode() == 200) {
return responseSerializer.deserialize(r... | [
"public",
"R",
"finish",
"(",
")",
"throws",
"X",
",",
"DbxException",
"{",
"assertOpenAndUnfinished",
"(",
")",
";",
"HttpRequestor",
".",
"Response",
"response",
"=",
"null",
";",
"try",
"{",
"response",
"=",
"httpUploader",
".",
"finish",
"(",
")",
";",... | Completes the request and returns response from the server.
This method should be called after writing data to the upload {@link OutputStream} (see
{@link #getOutputStream}).
@return Response from server
@throws X if the server sent an error response for the request
@throws DbxException if an error occurs sending th... | [
"Completes",
"the",
"request",
"and",
"returns",
"response",
"from",
"the",
"server",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxUploader.java#L252-L283 |
112,328 | dropbox/dropbox-sdk-java | examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java | Main.uploadFile | private static void uploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {
try (InputStream in = new FileInputStream(localFile)) {
ProgressListener progressListener = l -> printProgress(l, localFile.length());
FileMetadata metadata = dbxClient.files().uploadBuilder(drop... | java | private static void uploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {
try (InputStream in = new FileInputStream(localFile)) {
ProgressListener progressListener = l -> printProgress(l, localFile.length());
FileMetadata metadata = dbxClient.files().uploadBuilder(drop... | [
"private",
"static",
"void",
"uploadFile",
"(",
"DbxClientV2",
"dbxClient",
",",
"File",
"localFile",
",",
"String",
"dropboxPath",
")",
"{",
"try",
"(",
"InputStream",
"in",
"=",
"new",
"FileInputStream",
"(",
"localFile",
")",
")",
"{",
"ProgressListener",
"... | Uploads a file in a single request. This approach is preferred for small files since it
eliminates unnecessary round-trips to the servers.
@param dbxClient Dropbox user authenticated client
@param localFIle local file to upload
@param dropboxPath Where to upload the file to within Dropbox | [
"Uploads",
"a",
"file",
"in",
"a",
"single",
"request",
".",
"This",
"approach",
"is",
"preferred",
"for",
"small",
"files",
"since",
"it",
"eliminates",
"unnecessary",
"round",
"-",
"trips",
"to",
"the",
"servers",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java#L48-L68 |
112,329 | dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxBrowse.java | DropboxBrowse.doBrowse | public void doBrowse(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
if (!common.checkGet(request, response)) return;
User user = common.getLoggedInUser(request);
if (user == null) {
common.pageSoftError(response, "Can'... | java | public void doBrowse(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
if (!common.checkGet(request, response)) return;
User user = common.getLoggedInUser(request);
if (user == null) {
common.pageSoftError(response, "Can'... | [
"public",
"void",
"doBrowse",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"!",
"common",
".",
"checkGet",
"(",
"request",
",",
"response",
")",
")",
"return"... | the contents of your files and folders and display them to you. | [
"the",
"contents",
"of",
"your",
"files",
"and",
"folders",
"and",
"display",
"them",
"to",
"you",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxBrowse.java#L184-L235 |
112,330 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxOAuth1Upgrader.java | DbxOAuth1Upgrader.createOAuth2AccessToken | public String createOAuth2AccessToken(DbxOAuth1AccessToken token)
throws DbxException
{
if (token == null) throw new IllegalArgumentException("'token' can't be null");
return DbxRequestUtil.doPostNoAuth(
requestConfig,
DbxClientV1.USER_AGENT_ID,
appInfo.ge... | java | public String createOAuth2AccessToken(DbxOAuth1AccessToken token)
throws DbxException
{
if (token == null) throw new IllegalArgumentException("'token' can't be null");
return DbxRequestUtil.doPostNoAuth(
requestConfig,
DbxClientV1.USER_AGENT_ID,
appInfo.ge... | [
"public",
"String",
"createOAuth2AccessToken",
"(",
"DbxOAuth1AccessToken",
"token",
")",
"throws",
"DbxException",
"{",
"if",
"(",
"token",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"'token' can't be null\"",
")",
";",
"return",
"DbxReques... | Given an existing active OAuth 1 access token, make a Dropbox API call to get a new OAuth 2
access token that represents the same user and app. | [
"Given",
"an",
"existing",
"active",
"OAuth",
"1",
"access",
"token",
"make",
"a",
"Dropbox",
"API",
"call",
"to",
"get",
"a",
"new",
"OAuth",
"2",
"access",
"token",
"that",
"represents",
"the",
"same",
"user",
"and",
"app",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxOAuth1Upgrader.java#L45-L64 |
112,331 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxOAuth1Upgrader.java | DbxOAuth1Upgrader.disableOAuth1AccessToken | public void disableOAuth1AccessToken(DbxOAuth1AccessToken token)
throws DbxException
{
if (token == null) throw new IllegalArgumentException("'token' can't be null");
DbxRequestUtil.doPostNoAuth(
requestConfig,
DbxClientV1.USER_AGENT_ID,
appInfo.getHost().... | java | public void disableOAuth1AccessToken(DbxOAuth1AccessToken token)
throws DbxException
{
if (token == null) throw new IllegalArgumentException("'token' can't be null");
DbxRequestUtil.doPostNoAuth(
requestConfig,
DbxClientV1.USER_AGENT_ID,
appInfo.getHost().... | [
"public",
"void",
"disableOAuth1AccessToken",
"(",
"DbxOAuth1AccessToken",
"token",
")",
"throws",
"DbxException",
"{",
"if",
"(",
"token",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"'token' can't be null\"",
")",
";",
"DbxRequestUtil",
"."... | Tell the Dropbox API server to disable an OAuth 1 access token. | [
"Tell",
"the",
"Dropbox",
"API",
"server",
"to",
"disable",
"an",
"OAuth",
"1",
"access",
"token",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxOAuth1Upgrader.java#L69-L88 |
112,332 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxWebAuthNoRedirect.java | DbxWebAuthNoRedirect.start | public String start() {
DbxWebAuth.Request request = DbxWebAuth.newRequestBuilder()
.withNoRedirect()
.build();
return auth.authorize(request);
} | java | public String start() {
DbxWebAuth.Request request = DbxWebAuth.newRequestBuilder()
.withNoRedirect()
.build();
return auth.authorize(request);
} | [
"public",
"String",
"start",
"(",
")",
"{",
"DbxWebAuth",
".",
"Request",
"request",
"=",
"DbxWebAuth",
".",
"newRequestBuilder",
"(",
")",
".",
"withNoRedirect",
"(",
")",
".",
"build",
"(",
")",
";",
"return",
"auth",
".",
"authorize",
"(",
"request",
... | Start authorization. Returns a "authorization URL" on the Dropbox website that gives the
lets the user grant your app access to their Dropbox account.
<p>
If they choose to grant access, they will be shown an "authorization code", which they
need to copy/paste back into your app, at which point you can call {@link #f... | [
"Start",
"authorization",
".",
"Returns",
"a",
"authorization",
"URL",
"on",
"the",
"Dropbox",
"website",
"that",
"gives",
"the",
"lets",
"the",
"user",
"grant",
"your",
"app",
"access",
"to",
"their",
"Dropbox",
"account",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxWebAuthNoRedirect.java#L70-L75 |
112,333 | dropbox/dropbox-sdk-java | examples/longpoll/src/main/java/com/dropbox/core/examples/longpoll/Main.java | Main.longpoll | public static void longpoll(DbxAuthInfo auth, String path) throws IOException {
long longpollTimeoutSecs = TimeUnit.MINUTES.toSeconds(2);
// need 2 Dropbox clients for making calls:
//
// (1) One for longpoll requests, with its read timeout set longer than our polling timeout
//... | java | public static void longpoll(DbxAuthInfo auth, String path) throws IOException {
long longpollTimeoutSecs = TimeUnit.MINUTES.toSeconds(2);
// need 2 Dropbox clients for making calls:
//
// (1) One for longpoll requests, with its read timeout set longer than our polling timeout
//... | [
"public",
"static",
"void",
"longpoll",
"(",
"DbxAuthInfo",
"auth",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"long",
"longpollTimeoutSecs",
"=",
"TimeUnit",
".",
"MINUTES",
".",
"toSeconds",
"(",
"2",
")",
";",
"// need 2 Dropbox clients for makin... | Will perform longpoll request for changes in the user's Dropbox
account and display those changes. This is more efficient that
periodic polling the endpoint. | [
"Will",
"perform",
"longpoll",
"request",
"for",
"changes",
"in",
"the",
"user",
"s",
"Dropbox",
"account",
"and",
"display",
"those",
"changes",
".",
"This",
"is",
"more",
"efficient",
"that",
"periodic",
"polling",
"the",
"endpoint",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/longpoll/src/main/java/com/dropbox/core/examples/longpoll/Main.java#L36-L99 |
112,334 | dropbox/dropbox-sdk-java | examples/longpoll/src/main/java/com/dropbox/core/examples/longpoll/Main.java | Main.createClient | private static DbxClientV2 createClient(DbxAuthInfo auth, StandardHttpRequestor.Config config) {
String clientUserAgentId = "examples-longpoll";
StandardHttpRequestor requestor = new StandardHttpRequestor(config);
DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder(clientUserAgentId)
... | java | private static DbxClientV2 createClient(DbxAuthInfo auth, StandardHttpRequestor.Config config) {
String clientUserAgentId = "examples-longpoll";
StandardHttpRequestor requestor = new StandardHttpRequestor(config);
DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder(clientUserAgentId)
... | [
"private",
"static",
"DbxClientV2",
"createClient",
"(",
"DbxAuthInfo",
"auth",
",",
"StandardHttpRequestor",
".",
"Config",
"config",
")",
"{",
"String",
"clientUserAgentId",
"=",
"\"examples-longpoll\"",
";",
"StandardHttpRequestor",
"requestor",
"=",
"new",
"Standard... | Create a new Dropbox client using the given authentication
information and HTTP client config.
@param auth Authentication information
@param config HTTP request configuration
@return new Dropbox V2 client | [
"Create",
"a",
"new",
"Dropbox",
"client",
"using",
"the",
"given",
"authentication",
"information",
"and",
"HTTP",
"client",
"config",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/longpoll/src/main/java/com/dropbox/core/examples/longpoll/Main.java#L110-L118 |
112,335 | dropbox/dropbox-sdk-java | examples/longpoll/src/main/java/com/dropbox/core/examples/longpoll/Main.java | Main.printChanges | private static String printChanges(DbxClientV2 client, String cursor)
throws DbxApiException, DbxException {
while (true) {
ListFolderResult result = client.files()
.listFolderContinue(cursor);
for (Metadata metadata : result.getEntries()) {
Strin... | java | private static String printChanges(DbxClientV2 client, String cursor)
throws DbxApiException, DbxException {
while (true) {
ListFolderResult result = client.files()
.listFolderContinue(cursor);
for (Metadata metadata : result.getEntries()) {
Strin... | [
"private",
"static",
"String",
"printChanges",
"(",
"DbxClientV2",
"client",
",",
"String",
"cursor",
")",
"throws",
"DbxApiException",
",",
"DbxException",
"{",
"while",
"(",
"true",
")",
"{",
"ListFolderResult",
"result",
"=",
"client",
".",
"files",
"(",
")... | Prints changes made to a folder in Dropbox since the given
cursor was retrieved.
@param dbxClient Dropbox client to use for fetching folder changes
@param cursor lastest cursor received since last set of changes
@return latest cursor after changes | [
"Prints",
"changes",
"made",
"to",
"a",
"folder",
"in",
"Dropbox",
"since",
"the",
"given",
"cursor",
"was",
"retrieved",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/longpoll/src/main/java/com/dropbox/core/examples/longpoll/Main.java#L149-L184 |
112,336 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v2/DbxRawClientV2.java | DbxRawClientV2.executeRetriable | private static <T> T executeRetriable(int maxRetries, RetriableExecution<T> execution) throws DbxWrappedException, DbxException {
if (maxRetries == 0) {
return execution.execute();
}
int retries = 0;
while (true) {
try {
return execution.execute()... | java | private static <T> T executeRetriable(int maxRetries, RetriableExecution<T> execution) throws DbxWrappedException, DbxException {
if (maxRetries == 0) {
return execution.execute();
}
int retries = 0;
while (true) {
try {
return execution.execute()... | [
"private",
"static",
"<",
"T",
">",
"T",
"executeRetriable",
"(",
"int",
"maxRetries",
",",
"RetriableExecution",
"<",
"T",
">",
"execution",
")",
"throws",
"DbxWrappedException",
",",
"DbxException",
"{",
"if",
"(",
"maxRetries",
"==",
"0",
")",
"{",
"retur... | Retries the execution at most a maximum number of times.
<p> This method is an alternative implementation to {@code DbxRequestUtil.runAndRetry(..)}
that does <b>not</b> retry 500 errors ({@link com.dropbox.core.ServerException}). To maintain
behavior backwards compatibility in v1, we leave the old implementation in {@... | [
"Retries",
"the",
"execution",
"at",
"most",
"a",
"maximum",
"number",
"of",
"times",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v2/DbxRawClientV2.java#L301-L319 |
112,337 | dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java | Main.doLogin | public void doLogin(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (!common.checkPost(request, response)) return;
String username = request.getParameter("username");
if (username == null) {
response.sendError(400, "Missing field \... | java | public void doLogin(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (!common.checkPost(request, response)) return;
String username = request.getParameter("username");
if (username == null) {
response.sendError(400, "Missing field \... | [
"public",
"void",
"doLogin",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"!",
"common",
".",
"checkPost",
"(",
"request",
",",
"response",
")",
")",
"return"... | Login form handler. | [
"Login",
"form",
"handler",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java#L128-L159 |
112,338 | dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java | Main.checkUsername | private static String checkUsername(String username) {
if (username.length() < 3) {
return "too short (minimum: 3 characters)";
} else if (username.length() > 64) {
return "too long (maximum: 64 characters)";
}
for (int i = 0; i < username.length(); i++) {
... | java | private static String checkUsername(String username) {
if (username.length() < 3) {
return "too short (minimum: 3 characters)";
} else if (username.length() > 64) {
return "too long (maximum: 64 characters)";
}
for (int i = 0; i < username.length(); i++) {
... | [
"private",
"static",
"String",
"checkUsername",
"(",
"String",
"username",
")",
"{",
"if",
"(",
"username",
".",
"length",
"(",
")",
"<",
"3",
")",
"{",
"return",
"\"too short (minimum: 3 characters)\"",
";",
"}",
"else",
"if",
"(",
"username",
".",
"length"... | Returns 'null' if the username is ok. | [
"Returns",
"null",
"if",
"the",
"username",
"is",
"ok",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java#L162-L179 |
112,339 | dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java | Main.doLogout | public void doLogout(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (!common.checkPost(request, response)) return;
request.getSession().removeAttribute("logged-in-username");
response.sendRedirect("/");
} | java | public void doLogout(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (!common.checkPost(request, response)) return;
request.getSession().removeAttribute("logged-in-username");
response.sendRedirect("/");
} | [
"public",
"void",
"doLogout",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"!",
"common",
".",
"checkPost",
"(",
"request",
",",
"response",
")",
")",
"return... | Logout form handler. | [
"Logout",
"form",
"handler",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/Main.java#L243-L247 |
112,340 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxRequestUtil.java | DbxRequestUtil.startGet | public static HttpRequestor.Response startGet(DbxRequestConfig requestConfig,
String accessToken,
String sdkUserAgentIdentifier,
String host,
... | java | public static HttpRequestor.Response startGet(DbxRequestConfig requestConfig,
String accessToken,
String sdkUserAgentIdentifier,
String host,
... | [
"public",
"static",
"HttpRequestor",
".",
"Response",
"startGet",
"(",
"DbxRequestConfig",
"requestConfig",
",",
"String",
"accessToken",
",",
"String",
"sdkUserAgentIdentifier",
",",
"String",
"host",
",",
"String",
"path",
",",
"/*@Nullable*/",
"String",
"/*@Nullabl... | Convenience function for making HTTP GET requests. | [
"Convenience",
"function",
"for",
"making",
"HTTP",
"GET",
"requests",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxRequestUtil.java#L176-L195 |
112,341 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/DbxRequestUtil.java | DbxRequestUtil.startPostNoAuth | public static HttpRequestor.Response startPostNoAuth(DbxRequestConfig requestConfig,
String sdkUserAgentIdentifier,
String host,
String path,
... | java | public static HttpRequestor.Response startPostNoAuth(DbxRequestConfig requestConfig,
String sdkUserAgentIdentifier,
String host,
String path,
... | [
"public",
"static",
"HttpRequestor",
".",
"Response",
"startPostNoAuth",
"(",
"DbxRequestConfig",
"requestConfig",
",",
"String",
"sdkUserAgentIdentifier",
",",
"String",
"host",
",",
"String",
"path",
",",
"/*@Nullable*/",
"String",
"/*@Nullable*/",
"[",
"]",
"params... | Convenience function for making HTTP POST requests. | [
"Convenience",
"function",
"for",
"making",
"HTTP",
"POST",
"requests",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/DbxRequestUtil.java#L223-L236 |
112,342 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/util/StringUtil.java | StringUtil.javaQuotedLiteral | public static String javaQuotedLiteral(String value)
{
StringBuilder b = new StringBuilder(value.length() * 2);
b.append('"');
for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i);
switch (c) {
case '"': b.append("\\\""); break;
... | java | public static String javaQuotedLiteral(String value)
{
StringBuilder b = new StringBuilder(value.length() * 2);
b.append('"');
for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i);
switch (c) {
case '"': b.append("\\\""); break;
... | [
"public",
"static",
"String",
"javaQuotedLiteral",
"(",
"String",
"value",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
"value",
".",
"length",
"(",
")",
"*",
"2",
")",
";",
"b",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"("... | Given a string, returns the representation of that string
as a Java string literal. | [
"Given",
"a",
"string",
"returns",
"the",
"representation",
"of",
"that",
"string",
"as",
"a",
"Java",
"string",
"literal",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/util/StringUtil.java#L52-L84 |
112,343 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/util/StringUtil.java | StringUtil.binaryToHex | public static String binaryToHex(byte[] data, int offset, int length)
{
assert offset < data.length && offset >= 0 : offset + ", " + data.length;
int end = offset + length;
assert end <= data.length && end >= 0 : offset + ", " + length + ", " + data.length;
char[] chars = new char[l... | java | public static String binaryToHex(byte[] data, int offset, int length)
{
assert offset < data.length && offset >= 0 : offset + ", " + data.length;
int end = offset + length;
assert end <= data.length && end >= 0 : offset + ", " + length + ", " + data.length;
char[] chars = new char[l... | [
"public",
"static",
"String",
"binaryToHex",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"assert",
"offset",
"<",
"data",
".",
"length",
"&&",
"offset",
">=",
"0",
":",
"offset",
"+",
"\", \"",
"+",
"data",
".... | Convert a string of binary bytes to the equivalent hexadecimal string.
The resulting String will have two characters for every byte in the
input. | [
"Convert",
"a",
"string",
"of",
"binary",
"bytes",
"to",
"the",
"equivalent",
"hexadecimal",
"string",
".",
"The",
"resulting",
"String",
"will",
"have",
"two",
"characters",
"for",
"every",
"byte",
"in",
"the",
"input",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/util/StringUtil.java#L99-L114 |
112,344 | dropbox/dropbox-sdk-java | examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/FormProtection.java | FormProtection.checkAntiCsrfToken | public static String checkAntiCsrfToken(HttpServletRequest request) throws IOException, ServletException
{
if (request.getContentType() != null &&
request.getContentType().toLowerCase().indexOf("multipart/form-data") > -1 &&
request.getPart("anti-csrf-token") == null ||
r... | java | public static String checkAntiCsrfToken(HttpServletRequest request) throws IOException, ServletException
{
if (request.getContentType() != null &&
request.getContentType().toLowerCase().indexOf("multipart/form-data") > -1 &&
request.getPart("anti-csrf-token") == null ||
r... | [
"public",
"static",
"String",
"checkAntiCsrfToken",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"request",
".",
"getContentType",
"(",
")",
"!=",
"null",
"&&",
"request",
".",
"getContentType",
"(",
... | display that error message to the user. | [
"display",
"that",
"error",
"message",
"to",
"the",
"user",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/FormProtection.java#L60-L71 |
112,345 | dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/json/JsonReader.java | JsonReader.expectObjectStart | public static JsonLocation expectObjectStart(JsonParser parser)
throws IOException, JsonReadException
{
if (parser.getCurrentToken() != JsonToken.START_OBJECT) {
throw new JsonReadException("expecting the start of an object (\"{\")", parser.getTokenLocation());
}
JsonLoca... | java | public static JsonLocation expectObjectStart(JsonParser parser)
throws IOException, JsonReadException
{
if (parser.getCurrentToken() != JsonToken.START_OBJECT) {
throw new JsonReadException("expecting the start of an object (\"{\")", parser.getTokenLocation());
}
JsonLoca... | [
"public",
"static",
"JsonLocation",
"expectObjectStart",
"(",
"JsonParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonReadException",
"{",
"if",
"(",
"parser",
".",
"getCurrentToken",
"(",
")",
"!=",
"JsonToken",
".",
"START_OBJECT",
")",
"{",
"throw",
"... | Delimiter checking helpers. | [
"Delimiter",
"checking",
"helpers",
"."
] | d86157005fad6233c18b4b0f10f00b8d9d56ae92 | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/json/JsonReader.java#L109-L118 |
112,346 | lz4/lz4-java | src/java/net/jpountz/lz4/LZ4Factory.java | LZ4Factory.main | public static void main(String[] args) {
System.out.println("Fastest instance is " + fastestInstance());
System.out.println("Fastest Java instance is " + fastestJavaInstance());
} | java | public static void main(String[] args) {
System.out.println("Fastest instance is " + fastestInstance());
System.out.println("Fastest Java instance is " + fastestJavaInstance());
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Fastest instance is \"",
"+",
"fastestInstance",
"(",
")",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Fastest Java ins... | Prints the fastest instance.
@param args no argument required | [
"Prints",
"the",
"fastest",
"instance",
"."
] | c5ae694a3aa8b33ef87fd0486727a7d1e8f71367 | https://github.com/lz4/lz4-java/blob/c5ae694a3aa8b33ef87fd0486727a7d1e8f71367/src/java/net/jpountz/lz4/LZ4Factory.java#L301-L304 |
112,347 | lz4/lz4-java | src/java/net/jpountz/lz4/LZ4FrameInputStream.java | LZ4FrameInputStream.nextFrameInfo | private boolean nextFrameInfo() throws IOException {
while (true) {
int size = 0;
do {
final int mySize = in.read(readNumberBuff.array(), size, LZ4FrameOutputStream.INTEGER_BYTES - size);
if (mySize < 0) {
return false;
}
size += mySize;
} while (size < LZ4FrameOutputStream.INTEGER_BYTES);
... | java | private boolean nextFrameInfo() throws IOException {
while (true) {
int size = 0;
do {
final int mySize = in.read(readNumberBuff.array(), size, LZ4FrameOutputStream.INTEGER_BYTES - size);
if (mySize < 0) {
return false;
}
size += mySize;
} while (size < LZ4FrameOutputStream.INTEGER_BYTES);
... | [
"private",
"boolean",
"nextFrameInfo",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"size",
"=",
"0",
";",
"do",
"{",
"final",
"int",
"mySize",
"=",
"in",
".",
"read",
"(",
"readNumberBuff",
".",
"array",
"(",
")",
"... | Try and load in the next valid frame info. This will skip over skippable frames.
@return True if a frame was loaded. False if there are no more frames in the stream.
@throws IOException On input stream read exception | [
"Try",
"and",
"load",
"in",
"the",
"next",
"valid",
"frame",
"info",
".",
"This",
"will",
"skip",
"over",
"skippable",
"frames",
"."
] | c5ae694a3aa8b33ef87fd0486727a7d1e8f71367 | https://github.com/lz4/lz4-java/blob/c5ae694a3aa8b33ef87fd0486727a7d1e8f71367/src/java/net/jpountz/lz4/LZ4FrameInputStream.java#L96-L116 |
112,348 | spotify/apollo | apollo-api/src/main/java/com/spotify/apollo/QueryStringDecoder.java | QueryStringDecoder.decodeHexNibble | private static char decodeHexNibble(final char c) {
if ('0' <= c && c <= '9') {
return (char) (c - '0');
} else if ('a' <= c && c <= 'f') {
return (char) (c - 'a' + 10);
} else if ('A' <= c && c <= 'F') {
return (char) (c - 'A' + 10);
} else {
return Character.MAX_VALUE;
}
... | java | private static char decodeHexNibble(final char c) {
if ('0' <= c && c <= '9') {
return (char) (c - '0');
} else if ('a' <= c && c <= 'f') {
return (char) (c - 'a' + 10);
} else if ('A' <= c && c <= 'F') {
return (char) (c - 'A' + 10);
} else {
return Character.MAX_VALUE;
}
... | [
"private",
"static",
"char",
"decodeHexNibble",
"(",
"final",
"char",
"c",
")",
"{",
"if",
"(",
"'",
"'",
"<=",
"c",
"&&",
"c",
"<=",
"'",
"'",
")",
"{",
"return",
"(",
"char",
")",
"(",
"c",
"-",
"'",
"'",
")",
";",
"}",
"else",
"if",
"(",
... | Helper to decode half of a hexadecimal number from a string.
@param c The ASCII character of the hexadecimal number to decode.
Must be in the range {@code [0-9a-fA-F]}.
@return The hexadecimal value represented in the ASCII character
given, or {@link Character#MAX_VALUE} if the character is invalid. | [
"Helper",
"to",
"decode",
"half",
"of",
"a",
"hexadecimal",
"number",
"from",
"a",
"string",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api/src/main/java/com/spotify/apollo/QueryStringDecoder.java#L373-L383 |
112,349 | spotify/apollo | examples/calculator/src/main/java/com/spotify/apollo/example/CalculatorApp.java | CalculatorApp.exceptionMiddleware | static <T> Middleware<SyncHandler<Response<T>>, SyncHandler<Response<T>>> exceptionMiddleware() {
return handler -> requestContext -> {
try {
return handler.invoke(requestContext);
} catch (RuntimeException e) {
return Response.forStatus(Status.IM_A_TEAPOT);
}
};
} | java | static <T> Middleware<SyncHandler<Response<T>>, SyncHandler<Response<T>>> exceptionMiddleware() {
return handler -> requestContext -> {
try {
return handler.invoke(requestContext);
} catch (RuntimeException e) {
return Response.forStatus(Status.IM_A_TEAPOT);
}
};
} | [
"static",
"<",
"T",
">",
"Middleware",
"<",
"SyncHandler",
"<",
"Response",
"<",
"T",
">",
">",
",",
"SyncHandler",
"<",
"Response",
"<",
"T",
">",
">",
">",
"exceptionMiddleware",
"(",
")",
"{",
"return",
"handler",
"->",
"requestContext",
"->",
"{",
... | A generic middleware that maps uncaught exceptions to error code 418 | [
"A",
"generic",
"middleware",
"that",
"maps",
"uncaught",
"exceptions",
"to",
"error",
"code",
"418"
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/examples/calculator/src/main/java/com/spotify/apollo/example/CalculatorApp.java#L58-L66 |
112,350 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/meta/MetaDescriptor.java | MetaDescriptor.loadVersion | private static String loadVersion(ClassLoader classLoader) throws IOException {
try {
Enumeration<URL> resources = classLoader.getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
final URL url = resources.nextElement();
final Manifest manifest = new Manifest(url.... | java | private static String loadVersion(ClassLoader classLoader) throws IOException {
try {
Enumeration<URL> resources = classLoader.getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
final URL url = resources.nextElement();
final Manifest manifest = new Manifest(url.... | [
"private",
"static",
"String",
"loadVersion",
"(",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Enumeration",
"<",
"URL",
">",
"resources",
"=",
"classLoader",
".",
"getResources",
"(",
"\"META-INF/MANIFEST.MF\"",
")",
";",
"while"... | Tries to load the first "Implementation-Version" manifest entry it can find in the given
classloader.
@param classLoader The classloader to load manifests from
@return a version string
@throws IOException | [
"Tries",
"to",
"load",
"the",
"first",
"Implementation",
"-",
"Version",
"manifest",
"entry",
"it",
"can",
"find",
"in",
"the",
"given",
"classloader",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/meta/MetaDescriptor.java#L87-L108 |
112,351 | spotify/apollo | apollo-route/src/main/java/com/spotify/apollo/route/RuleRouter.java | RuleRouter.of | public static <T> RuleRouter<T> of(final Iterable<Rule<T>> rules) {
return new RuleRouter<>(ImmutableList.copyOf(rules));
} | java | public static <T> RuleRouter<T> of(final Iterable<Rule<T>> rules) {
return new RuleRouter<>(ImmutableList.copyOf(rules));
} | [
"public",
"static",
"<",
"T",
">",
"RuleRouter",
"<",
"T",
">",
"of",
"(",
"final",
"Iterable",
"<",
"Rule",
"<",
"T",
">",
">",
"rules",
")",
"{",
"return",
"new",
"RuleRouter",
"<>",
"(",
"ImmutableList",
".",
"copyOf",
"(",
"rules",
")",
")",
";... | Create a router from a list of rules. | [
"Create",
"a",
"router",
"from",
"a",
"list",
"of",
"rules",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-route/src/main/java/com/spotify/apollo/route/RuleRouter.java#L144-L146 |
112,352 | spotify/apollo | apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java | HtmlSerializerMiddlewares.serialize | public static <T> ByteString serialize(final String templateName, T object) {
StringWriter templateResults = new StringWriter();
try {
final Template template = configuration.getTemplate(templateName);
template.process(object, templateResults);
} catch (Exception e) {
throw Throwables.prop... | java | public static <T> ByteString serialize(final String templateName, T object) {
StringWriter templateResults = new StringWriter();
try {
final Template template = configuration.getTemplate(templateName);
template.process(object, templateResults);
} catch (Exception e) {
throw Throwables.prop... | [
"public",
"static",
"<",
"T",
">",
"ByteString",
"serialize",
"(",
"final",
"String",
"templateName",
",",
"T",
"object",
")",
"{",
"StringWriter",
"templateResults",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"final",
"Template",
"template",
"="... | Call the template engine and return the result.
@param templateName The template name, respective to the "resources" folder
@param object The parameter to pass to the template
@param <T> The Type of the parameters
@return The HTML | [
"Call",
"the",
"template",
"engine",
"and",
"return",
"the",
"result",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java#L65-L74 |
112,353 | spotify/apollo | apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java | HtmlSerializerMiddlewares.htmlSerialize | public static <T> Middleware<AsyncHandler<T>, AsyncHandler<Response<ByteString>>> htmlSerialize(
final String templateName) {
return handler ->
requestContext -> handler.invoke(requestContext)
.thenApply(result -> Response
.forPayload(serialize(templateName, result))
... | java | public static <T> Middleware<AsyncHandler<T>, AsyncHandler<Response<ByteString>>> htmlSerialize(
final String templateName) {
return handler ->
requestContext -> handler.invoke(requestContext)
.thenApply(result -> Response
.forPayload(serialize(templateName, result))
... | [
"public",
"static",
"<",
"T",
">",
"Middleware",
"<",
"AsyncHandler",
"<",
"T",
">",
",",
"AsyncHandler",
"<",
"Response",
"<",
"ByteString",
">",
">",
">",
"htmlSerialize",
"(",
"final",
"String",
"templateName",
")",
"{",
"return",
"handler",
"->",
"requ... | Async middleware for POJO.
@param templateName The template name, respective to the "resources" folder
@param <T> The Type of the parameters
@return the middlware | [
"Async",
"middleware",
"for",
"POJO",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java#L83-L90 |
112,354 | spotify/apollo | apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java | HtmlSerializerMiddlewares.htmlSerializeResponse | public static <T> Middleware<AsyncHandler<Response<T>>, AsyncHandler<Response<ByteString>>>
htmlSerializeResponse(final String templateName) {
return handler ->
requestContext -> handler.invoke(requestContext)
.thenApply(response -> response
.withPayload(serialize(templateName,... | java | public static <T> Middleware<AsyncHandler<Response<T>>, AsyncHandler<Response<ByteString>>>
htmlSerializeResponse(final String templateName) {
return handler ->
requestContext -> handler.invoke(requestContext)
.thenApply(response -> response
.withPayload(serialize(templateName,... | [
"public",
"static",
"<",
"T",
">",
"Middleware",
"<",
"AsyncHandler",
"<",
"Response",
"<",
"T",
">",
">",
",",
"AsyncHandler",
"<",
"Response",
"<",
"ByteString",
">",
">",
">",
"htmlSerializeResponse",
"(",
"final",
"String",
"templateName",
")",
"{",
"r... | Async middleware for a Response object.
@param templateName The template name, respective to the "resources" folder
@param <T> The Type of the parameters
@return the middlware | [
"Async",
"middleware",
"for",
"a",
"Response",
"object",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java#L99-L106 |
112,355 | spotify/apollo | apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java | HtmlSerializerMiddlewares.htmlSerializeSync | public static <T> Middleware<SyncHandler<T>, AsyncHandler<Response<ByteString>>> htmlSerializeSync(
final String templateName) {
Middleware<SyncHandler<T>, AsyncHandler<T>> syncToAsync = Middleware::syncToAsync;
return syncToAsync.and(htmlSerialize(templateName));
} | java | public static <T> Middleware<SyncHandler<T>, AsyncHandler<Response<ByteString>>> htmlSerializeSync(
final String templateName) {
Middleware<SyncHandler<T>, AsyncHandler<T>> syncToAsync = Middleware::syncToAsync;
return syncToAsync.and(htmlSerialize(templateName));
} | [
"public",
"static",
"<",
"T",
">",
"Middleware",
"<",
"SyncHandler",
"<",
"T",
">",
",",
"AsyncHandler",
"<",
"Response",
"<",
"ByteString",
">",
">",
">",
"htmlSerializeSync",
"(",
"final",
"String",
"templateName",
")",
"{",
"Middleware",
"<",
"SyncHandler... | Sync middleware for POJO.
@param templateName The template name, respective to the "resources" folder
@param <T> The Type of the parameters
@return the middlware | [
"Sync",
"middleware",
"for",
"POJO",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java#L115-L119 |
112,356 | spotify/apollo | apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java | HtmlSerializerMiddlewares.htmlSerializeResponseSync | public static <T> Middleware<SyncHandler<Response<T>>, AsyncHandler<Response<ByteString>>> htmlSerializeResponseSync(
final String templateName) {
Middleware<SyncHandler<Response<T>>, AsyncHandler<Response<T>>> syncToAsync = Middleware::syncToAsync;
return syncToAsync.and(htmlSerializeResponse(templateNam... | java | public static <T> Middleware<SyncHandler<Response<T>>, AsyncHandler<Response<ByteString>>> htmlSerializeResponseSync(
final String templateName) {
Middleware<SyncHandler<Response<T>>, AsyncHandler<Response<T>>> syncToAsync = Middleware::syncToAsync;
return syncToAsync.and(htmlSerializeResponse(templateNam... | [
"public",
"static",
"<",
"T",
">",
"Middleware",
"<",
"SyncHandler",
"<",
"Response",
"<",
"T",
">",
">",
",",
"AsyncHandler",
"<",
"Response",
"<",
"ByteString",
">",
">",
">",
"htmlSerializeResponseSync",
"(",
"final",
"String",
"templateName",
")",
"{",
... | Sync middleware for a Response object.
@param templateName The template name, respective to the "resources" folder
@param <T> The Type of the parameters
@return the middlware | [
"Sync",
"middleware",
"for",
"a",
"Response",
"object",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-extra/src/main/java/com/spotify/apollo/route/HtmlSerializerMiddlewares.java#L128-L132 |
112,357 | spotify/apollo | apollo-http-service/src/main/java/com/spotify/apollo/httpservice/HttpService.java | HttpService.boot | public static void boot(Service service,
InstanceListener instanceListener,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler,
String... args) throws LoadingException {
Objects.requireNonNull(uncaughtExceptionHandler);
Thread.... | java | public static void boot(Service service,
InstanceListener instanceListener,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler,
String... args) throws LoadingException {
Objects.requireNonNull(uncaughtExceptionHandler);
Thread.... | [
"public",
"static",
"void",
"boot",
"(",
"Service",
"service",
",",
"InstanceListener",
"instanceListener",
",",
"Thread",
".",
"UncaughtExceptionHandler",
"uncaughtExceptionHandler",
",",
"String",
"...",
"args",
")",
"throws",
"LoadingException",
"{",
"Objects",
"."... | Boot up a service and wait for it to shut down.
@param service the service to start
@param instanceListener gets called when a service instance has been created
@param uncaughtExceptionHandler an exception handler that gets invoked for the current thread
if any uncaught exceptions are thrown during service startup
or ... | [
"Boot",
"up",
"a",
"service",
"and",
"wait",
"for",
"it",
"to",
"shut",
"down",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-http-service/src/main/java/com/spotify/apollo/httpservice/HttpService.java#L107-L149 |
112,358 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/route/Middlewares.java | Middlewares.replyContentType | public static Middleware<AsyncHandler<?>, AsyncHandler<Response<?>>> replyContentType(
String contentType) {
return inner -> inner
.map(Middlewares::ensureResponse)
.map(response -> response.withHeader(CONTENT_TYPE, contentType));
} | java | public static Middleware<AsyncHandler<?>, AsyncHandler<Response<?>>> replyContentType(
String contentType) {
return inner -> inner
.map(Middlewares::ensureResponse)
.map(response -> response.withHeader(CONTENT_TYPE, contentType));
} | [
"public",
"static",
"Middleware",
"<",
"AsyncHandler",
"<",
"?",
">",
",",
"AsyncHandler",
"<",
"Response",
"<",
"?",
">",
">",
">",
"replyContentType",
"(",
"String",
"contentType",
")",
"{",
"return",
"inner",
"->",
"inner",
".",
"map",
"(",
"Middlewares... | Middleware that adds the ability to set the response's Content-Type header to a defined
value.
This middleware is type-unsafe, and it might be a better idea to set the content type directly
in your own middleware that does response serialization. | [
"Middleware",
"that",
"adds",
"the",
"ability",
"to",
"set",
"the",
"response",
"s",
"Content",
"-",
"Type",
"header",
"to",
"a",
"defined",
"value",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/route/Middlewares.java#L74-L80 |
112,359 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/route/Middlewares.java | Middlewares.serialize | public static Middleware<AsyncHandler<?>, AsyncHandler<Response<ByteString>>> serialize(
Serializer serializer) {
return inner -> inner
.map(Middlewares::ensureResponse)
.flatMapSync(resp -> ctx -> serializePayload(serializer, ctx.request(), resp));
} | java | public static Middleware<AsyncHandler<?>, AsyncHandler<Response<ByteString>>> serialize(
Serializer serializer) {
return inner -> inner
.map(Middlewares::ensureResponse)
.flatMapSync(resp -> ctx -> serializePayload(serializer, ctx.request(), resp));
} | [
"public",
"static",
"Middleware",
"<",
"AsyncHandler",
"<",
"?",
">",
",",
"AsyncHandler",
"<",
"Response",
"<",
"ByteString",
">",
">",
">",
"serialize",
"(",
"Serializer",
"serializer",
")",
"{",
"return",
"inner",
"->",
"inner",
".",
"map",
"(",
"Middle... | Middleware that applies the supplied serializer to the result of the inner handler,
changing the payload and optionally the Content-Type header.
This middleware is type-unsafe, and it might be better to write your own middleware that does
serialization. | [
"Middleware",
"that",
"applies",
"the",
"supplied",
"serializer",
"to",
"the",
"result",
"of",
"the",
"inner",
"handler",
"changing",
"the",
"payload",
"and",
"optionally",
"the",
"Content",
"-",
"Type",
"header",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/route/Middlewares.java#L89-L95 |
112,360 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/environment/EnvironmentFactoryBuilder.java | EnvironmentFactoryBuilder.withConfigResolver | public EnvironmentFactoryBuilder withConfigResolver(EnvironmentConfigResolver configResolver) {
checkState(!this.configResolver.isPresent(), "Configuration resolution already set");
return new EnvironmentFactoryBuilder(backendDomain, client, closer, resolver,
Optional.o... | java | public EnvironmentFactoryBuilder withConfigResolver(EnvironmentConfigResolver configResolver) {
checkState(!this.configResolver.isPresent(), "Configuration resolution already set");
return new EnvironmentFactoryBuilder(backendDomain, client, closer, resolver,
Optional.o... | [
"public",
"EnvironmentFactoryBuilder",
"withConfigResolver",
"(",
"EnvironmentConfigResolver",
"configResolver",
")",
"{",
"checkState",
"(",
"!",
"this",
".",
"configResolver",
".",
"isPresent",
"(",
")",
",",
"\"Configuration resolution already set\"",
")",
";",
"return... | Use custom config resolver.
Only one of
{@link #withConfigResolver(EnvironmentConfigResolver)},
{@link #withStaticConfig(Config)} and
{@link #withClassLoader(ClassLoader)}
can be used per builder.
@param configResolver The config resolver to use. | [
"Use",
"custom",
"config",
"resolver",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/environment/EnvironmentFactoryBuilder.java#L71-L76 |
112,361 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/environment/EnvironmentFactoryBuilder.java | EnvironmentFactoryBuilder.withStaticConfig | public EnvironmentFactoryBuilder withStaticConfig(Config configNode) {
checkState(!this.configResolver.isPresent(), "Configuration resolution already set");
return new EnvironmentFactoryBuilder(backendDomain, client, closer, resolver,
Optional.of(new StaticConfigResolve... | java | public EnvironmentFactoryBuilder withStaticConfig(Config configNode) {
checkState(!this.configResolver.isPresent(), "Configuration resolution already set");
return new EnvironmentFactoryBuilder(backendDomain, client, closer, resolver,
Optional.of(new StaticConfigResolve... | [
"public",
"EnvironmentFactoryBuilder",
"withStaticConfig",
"(",
"Config",
"configNode",
")",
"{",
"checkState",
"(",
"!",
"this",
".",
"configResolver",
".",
"isPresent",
"(",
")",
",",
"\"Configuration resolution already set\"",
")",
";",
"return",
"new",
"Environmen... | Statically inject a config object into the environment.
Only one of
{@link #withConfigResolver(EnvironmentConfigResolver)},
{@link #withStaticConfig(Config)} and
{@link #withClassLoader(ClassLoader)}
can be used per builder.
@param configNode The config object to use. | [
"Statically",
"inject",
"a",
"config",
"object",
"into",
"the",
"environment",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/environment/EnvironmentFactoryBuilder.java#L89-L94 |
112,362 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/environment/EnvironmentFactoryBuilder.java | EnvironmentFactoryBuilder.withClassLoader | public EnvironmentFactoryBuilder withClassLoader(ClassLoader classLoader) {
checkState(!this.configResolver.isPresent(), "Configuration resolution already set");
return new EnvironmentFactoryBuilder(backendDomain, client, closer, resolver,
Optional.of(new LazyConfigReso... | java | public EnvironmentFactoryBuilder withClassLoader(ClassLoader classLoader) {
checkState(!this.configResolver.isPresent(), "Configuration resolution already set");
return new EnvironmentFactoryBuilder(backendDomain, client, closer, resolver,
Optional.of(new LazyConfigReso... | [
"public",
"EnvironmentFactoryBuilder",
"withClassLoader",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"checkState",
"(",
"!",
"this",
".",
"configResolver",
".",
"isPresent",
"(",
")",
",",
"\"Configuration resolution already set\"",
")",
";",
"return",
"new",
"Envir... | Lazily load configuration from this classloader.
Only one of
{@link #withConfigResolver(EnvironmentConfigResolver)},
{@link #withStaticConfig(Config)} and
{@link #withClassLoader(ClassLoader)}
can be used per builder.
@param classLoader The class loader to lazily load configuration from. | [
"Lazily",
"load",
"configuration",
"from",
"this",
"classloader",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/environment/EnvironmentFactoryBuilder.java#L107-L112 |
112,363 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/dispatch/EndpointInvocationHandler.java | EndpointInvocationHandler.handle | void handle(OngoingRequest ongoingRequest, RequestContext requestContext, Endpoint endpoint) {
try {
endpoint.invoke(requestContext)
.whenComplete((message, throwable) -> {
try {
if (message != null) {
ongoingRequest.reply(message);
} else if (... | java | void handle(OngoingRequest ongoingRequest, RequestContext requestContext, Endpoint endpoint) {
try {
endpoint.invoke(requestContext)
.whenComplete((message, throwable) -> {
try {
if (message != null) {
ongoingRequest.reply(message);
} else if (... | [
"void",
"handle",
"(",
"OngoingRequest",
"ongoingRequest",
",",
"RequestContext",
"requestContext",
",",
"Endpoint",
"endpoint",
")",
"{",
"try",
"{",
"endpoint",
".",
"invoke",
"(",
"requestContext",
")",
".",
"whenComplete",
"(",
"(",
"message",
",",
"throwabl... | Fires off the request processing asynchronously - that is, this method is likely to return
before the request processing finishes. | [
"Fires",
"off",
"the",
"request",
"processing",
"asynchronously",
"-",
"that",
"is",
"this",
"method",
"is",
"likely",
"to",
"return",
"before",
"the",
"request",
"processing",
"finishes",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/dispatch/EndpointInvocationHandler.java#L54-L83 |
112,364 | spotify/apollo | modules/metrics/src/main/java/com/spotify/apollo/metrics/semantic/SemanticServiceMetrics.java | SemanticServiceMetrics.requestDurationThresholdTracker | private Optional<DurationThresholdTracker> requestDurationThresholdTracker(MetricId id,
String endpoint) {
return durationThresholdConfig.getDurationThresholdForEndpoint(endpoint)
.map(threshold -> Optional.of(new DurationThreshold... | java | private Optional<DurationThresholdTracker> requestDurationThresholdTracker(MetricId id,
String endpoint) {
return durationThresholdConfig.getDurationThresholdForEndpoint(endpoint)
.map(threshold -> Optional.of(new DurationThreshold... | [
"private",
"Optional",
"<",
"DurationThresholdTracker",
">",
"requestDurationThresholdTracker",
"(",
"MetricId",
"id",
",",
"String",
"endpoint",
")",
"{",
"return",
"durationThresholdConfig",
".",
"getDurationThresholdForEndpoint",
"(",
"endpoint",
")",
".",
"map",
"("... | Checks for endpoint-duration-goal configuration options and sets up
metrics that track how many requests meet a certain duration threshold goal.
@param endpoint formatted as METHOD:URI | [
"Checks",
"for",
"endpoint",
"-",
"duration",
"-",
"goal",
"configuration",
"options",
"and",
"sets",
"up",
"metrics",
"that",
"track",
"how",
"many",
"requests",
"meet",
"a",
"certain",
"duration",
"threshold",
"goal",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/modules/metrics/src/main/java/com/spotify/apollo/metrics/semantic/SemanticServiceMetrics.java#L205-L210 |
112,365 | spotify/apollo | apollo-api-impl/src/main/java/com/spotify/apollo/request/RequestTracker.java | RequestTracker.failRequests | private void failRequests() {
final Set<OngoingRequest> requests = ImmutableSet.copyOf(outstanding);
for (OngoingRequest id : requests) {
final boolean removed = outstanding.remove(id);
if (removed) {
id.reply(Response.forStatus(Status.SERVICE_UNAVAILABLE));
}
}
} | java | private void failRequests() {
final Set<OngoingRequest> requests = ImmutableSet.copyOf(outstanding);
for (OngoingRequest id : requests) {
final boolean removed = outstanding.remove(id);
if (removed) {
id.reply(Response.forStatus(Status.SERVICE_UNAVAILABLE));
}
}
} | [
"private",
"void",
"failRequests",
"(",
")",
"{",
"final",
"Set",
"<",
"OngoingRequest",
">",
"requests",
"=",
"ImmutableSet",
".",
"copyOf",
"(",
"outstanding",
")",
";",
"for",
"(",
"OngoingRequest",
"id",
":",
"requests",
")",
"{",
"final",
"boolean",
"... | Fail all outstanding requests. | [
"Fail",
"all",
"outstanding",
"requests",
"."
] | 3aba09840538a2aff9cdac5be42cc114dd276c70 | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/request/RequestTracker.java#L100-L108 |
112,366 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java | CacheMapUtil.put | public static <T> Single<Boolean> put(CacheConfigBean cacheConfigBean, String key, String field, T value) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheMapPut", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", key);
put("field", field);
... | java | public static <T> Single<Boolean> put(CacheConfigBean cacheConfigBean, String key, String field, T value) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheMapPut", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", key);
put("field", field);
... | [
"public",
"static",
"<",
"T",
">",
"Single",
"<",
"Boolean",
">",
"put",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"key",
",",
"String",
"field",
",",
"T",
"value",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"CacheService",
".",
... | cache map put
@param cacheConfigBean the cache data source configuration
@param key the cache key
@param field the field of the cache map.
@param value the value you want to put it in the map.
@param <T> the generic type of the value.
@return the async result, true for succe... | [
"cache",
"map",
"put"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java#L94-L104 |
112,367 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java | CacheMapUtil.remove | public static Single<Boolean> remove(CacheConfigBean cacheConfigBean, String key, String field) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheMapRemove", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", key);
put("field", field);
}}).... | java | public static Single<Boolean> remove(CacheConfigBean cacheConfigBean, String key, String field) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheMapRemove", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", key);
put("field", field);
}}).... | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"remove",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"key",
",",
"String",
"field",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"CacheService",
".",
"CACHE_SERVICE",
",",
"\"cacheMapRemo... | remove the elements in the map
@param cacheConfigBean the datasource configuration
@param key the key
@param field the field
@return true if any elements are removed. False if no fields are removed, which means the field is not in the map originally. | [
"remove",
"the",
"elements",
"in",
"the",
"map"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java#L225-L235 |
112,368 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java | CacheMapUtil.values | public static Maybe<List<String>> values(CacheConfigBean cacheConfigBean, String key) {
return SingleRxXian
.call(CacheService.CACHE_SERVICE, "cacheMapValues", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", key);
}})
... | java | public static Maybe<List<String>> values(CacheConfigBean cacheConfigBean, String key) {
return SingleRxXian
.call(CacheService.CACHE_SERVICE, "cacheMapValues", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", key);
}})
... | [
"public",
"static",
"Maybe",
"<",
"List",
"<",
"String",
">",
">",
"values",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"key",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"CacheService",
".",
"CACHE_SERVICE",
",",
"\"cacheMapValues\"",
... | retrieval all the values in the cache list
@return the whole list if exists or null if the key does not exist. | [
"retrieval",
"all",
"the",
"values",
"in",
"the",
"cache",
"list"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java#L359-L372 |
112,369 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java | CacheMapUtil.values | public static <T> Maybe<List<T>> values(String key, Class<T> vClazz) {
return values(CacheService.CACHE_CONFIG_BEAN, key, vClazz);
} | java | public static <T> Maybe<List<T>> values(String key, Class<T> vClazz) {
return values(CacheService.CACHE_CONFIG_BEAN, key, vClazz);
} | [
"public",
"static",
"<",
"T",
">",
"Maybe",
"<",
"List",
"<",
"T",
">",
">",
"values",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"vClazz",
")",
"{",
"return",
"values",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"key",
",",
"vClazz"... | retrieval all the values in the cache map
@param key the key of the cached map
@param vClazz the value's class
@param <T> the value's generic type
@return the whole list if exists or null if the key does not exist.return | [
"retrieval",
"all",
"the",
"values",
"in",
"the",
"cache",
"map"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheMapUtil.java#L382-L384 |
112,370 | xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/barriers/DistributedBarrier.java | DistributedBarrier.setBarrier | public synchronized void setBarrier() throws Exception
{
try
{
client.create().creatingParentContainersIfNeeded().forPath(barrierPath);
}
catch ( KeeperException.NodeExistsException ignore )
{
// ignore
}
} | java | public synchronized void setBarrier() throws Exception
{
try
{
client.create().creatingParentContainersIfNeeded().forPath(barrierPath);
}
catch ( KeeperException.NodeExistsException ignore )
{
// ignore
}
} | [
"public",
"synchronized",
"void",
"setBarrier",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"client",
".",
"create",
"(",
")",
".",
"creatingParentContainersIfNeeded",
"(",
")",
".",
"forPath",
"(",
"barrierPath",
")",
";",
"}",
"catch",
"(",
"KeeperEx... | Utility to set the barrier node
@throws Exception errors | [
"Utility",
"to",
"set",
"the",
"barrier",
"node"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/barriers/DistributedBarrier.java#L66-L76 |
112,371 | xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/barriers/DistributedBarrier.java | DistributedBarrier.waitOnBarrier | public synchronized boolean waitOnBarrier(long maxWait, TimeUnit unit) throws Exception
{
long startMs = System.currentTimeMillis();
boolean hasMaxWait = (unit != null);
long maxWaitMs = hasMaxWait ? TimeUnit.MILLISECONDS.convert(maxWait, unit) : Long.MAX_V... | java | public synchronized boolean waitOnBarrier(long maxWait, TimeUnit unit) throws Exception
{
long startMs = System.currentTimeMillis();
boolean hasMaxWait = (unit != null);
long maxWaitMs = hasMaxWait ? TimeUnit.MILLISECONDS.convert(maxWait, unit) : Long.MAX_V... | [
"public",
"synchronized",
"boolean",
"waitOnBarrier",
"(",
"long",
"maxWait",
",",
"TimeUnit",
"unit",
")",
"throws",
"Exception",
"{",
"long",
"startMs",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"boolean",
"hasMaxWait",
"=",
"(",
"unit",
"!=",
... | Blocks until the barrier no longer exists or the timeout elapses
@param maxWait max time to block
@param unit time unit
@return true if the wait was successful, false if the timeout elapsed first
@throws Exception errors | [
"Blocks",
"until",
"the",
"barrier",
"no",
"longer",
"exists",
"or",
"the",
"timeout",
"elapses"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/barriers/DistributedBarrier.java#L113-L144 |
112,372 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/thread_pool/ThreadPoolManager.java | ThreadPoolManager.newScheduledExecutor | public static ScheduledExecutorService newScheduledExecutor(int corePoolSize) {
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(corePoolSize);
EXECUTORS.add(scheduledExecutorService);
return scheduledExecutorService;
} | java | public static ScheduledExecutorService newScheduledExecutor(int corePoolSize) {
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(corePoolSize);
EXECUTORS.add(scheduledExecutorService);
return scheduledExecutorService;
} | [
"public",
"static",
"ScheduledExecutorService",
"newScheduledExecutor",
"(",
"int",
"corePoolSize",
")",
"{",
"ScheduledExecutorService",
"scheduledExecutorService",
"=",
"Executors",
".",
"newScheduledThreadPool",
"(",
"corePoolSize",
")",
";",
"EXECUTORS",
".",
"add",
"... | create a new xian monitored scheduled thread pool
@param corePoolSize the core pool size
@return the newly created thread pool | [
"create",
"a",
"new",
"xian",
"monitored",
"scheduled",
"thread",
"pool"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/thread_pool/ThreadPoolManager.java#L293-L297 |
112,373 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.luaScript | public static Object luaScript(String scripts, int keyCount, List<String> params) {
return luaScript(CacheService.CACHE_CONFIG_BEAN, scripts, keyCount, params);
} | java | public static Object luaScript(String scripts, int keyCount, List<String> params) {
return luaScript(CacheService.CACHE_CONFIG_BEAN, scripts, keyCount, params);
} | [
"public",
"static",
"Object",
"luaScript",
"(",
"String",
"scripts",
",",
"int",
"keyCount",
",",
"List",
"<",
"String",
">",
"params",
")",
"{",
"return",
"luaScript",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"scripts",
",",
"keyCount",
",",
"par... | execute the lua script
@param scripts the script to be executed.
@param keyCount the key count
@param params the parameters
@return the result object | [
"execute",
"the",
"lua",
"script"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L35-L37 |
112,374 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.luaScript | public static Single<Object> luaScript(CacheConfigBean cacheConfigBean, String scripts, int keyCount, List<String> params) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheLua", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("scripts", scripts);
put(... | java | public static Single<Object> luaScript(CacheConfigBean cacheConfigBean, String scripts, int keyCount, List<String> params) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheLua", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("scripts", scripts);
put(... | [
"public",
"static",
"Single",
"<",
"Object",
">",
"luaScript",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"scripts",
",",
"int",
"keyCount",
",",
"List",
"<",
"String",
">",
"params",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"Cach... | execute the specified script.
@param cacheConfigBean the data source of the cache
@param scripts the lua script.
@param keyCount the key count.
@param params the parameters.
@return the object result. | [
"execute",
"the",
"specified",
"script",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L48-L60 |
112,375 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.keys | @SuppressWarnings("unchecked")
public static Single<Set<String>> keys(CacheConfigBean cacheConfigBean, String pattern) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheKeys", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("pattern", pattern);
}}).map... | java | @SuppressWarnings("unchecked")
public static Single<Set<String>> keys(CacheConfigBean cacheConfigBean, String pattern) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheKeys", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("pattern", pattern);
}}).map... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Single",
"<",
"Set",
"<",
"String",
">",
">",
"keys",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"pattern",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"CacheServ... | get the keys who's value matches the pattern
@param cacheConfigBean the data source of the cache
@param pattern the pattern
@return the keys | [
"get",
"the",
"keys",
"who",
"s",
"value",
"matches",
"the",
"pattern"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L107-L121 |
112,376 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.exists | public static Single<Boolean> exists(CacheConfigBean cacheConfigBean, String cacheKey) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheExists", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}}).map(unitResponse -> {
unitRe... | java | public static Single<Boolean> exists(CacheConfigBean cacheConfigBean, String cacheKey) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheExists", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}}).map(unitResponse -> {
unitRe... | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"exists",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"cacheKey",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"CacheService",
".",
"CACHE_SERVICE",
",",
"\"cacheExists\"",
",",
"new",
"JS... | check whether the key exists.
@param cacheConfigBean the cache data source.
@param cacheKey the key of the key
@return true if exists otherwise false. | [
"check",
"whether",
"the",
"key",
"exists",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L140-L148 |
112,377 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.get | public static <T> Maybe<T> get(String cacheKey, Class<T> clazz) {
return get(CacheService.CACHE_CONFIG_BEAN, cacheKey, clazz);
} | java | public static <T> Maybe<T> get(String cacheKey, Class<T> clazz) {
return get(CacheService.CACHE_CONFIG_BEAN, cacheKey, clazz);
} | [
"public",
"static",
"<",
"T",
">",
"Maybe",
"<",
"T",
">",
"get",
"(",
"String",
"cacheKey",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"get",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"cacheKey",
",",
"clazz",
")",
";",
"}"
... | get the cached object.
@param cacheKey the key for the cache
@param clazz the class
@param <T> the type
@return maybe event observable for the cached object, if the result is null, then the we will get a empty result. | [
"get",
"the",
"cached",
"object",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L221-L223 |
112,378 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.remove | public static Single<Boolean> remove(CacheConfigBean cacheConfigBean, String cacheKey) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheObjectRemove", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}}).map(unitResponseObject -> {
... | java | public static Single<Boolean> remove(CacheConfigBean cacheConfigBean, String cacheKey) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheObjectRemove", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}}).map(unitResponseObject -> {
... | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"remove",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"cacheKey",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"CacheService",
".",
"CACHE_SERVICE",
",",
"\"cacheObjectRemove\"",
",",
"new",... | remove the cached object.
@param cacheConfigBean the data source configuration
@param cacheKey the key of the cache
@return the single observable for the result, true on success, false if nothing changed, error on exception. | [
"remove",
"the",
"cached",
"object",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L265-L273 |
112,379 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.increment | public static Single<Long> increment(CacheConfigBean cacheConfigBean, String cacheKey) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheIncrement", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}}).map(unitResponse -> {
uni... | java | public static Single<Long> increment(CacheConfigBean cacheConfigBean, String cacheKey) {
return SingleRxXian.call(CacheService.CACHE_SERVICE, "cacheIncrement", new JSONObject() {{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}}).map(unitResponse -> {
uni... | [
"public",
"static",
"Single",
"<",
"Long",
">",
"increment",
"(",
"CacheConfigBean",
"cacheConfigBean",
",",
"String",
"cacheKey",
")",
"{",
"return",
"SingleRxXian",
".",
"call",
"(",
"CacheService",
".",
"CACHE_SERVICE",
",",
"\"cacheIncrement\"",
",",
"new",
... | Increase the specified cache by 1.
@param cacheConfigBean the datasource
@param cacheKey the key
@return the result value after increment, or error. | [
"Increase",
"the",
"specified",
"cache",
"by",
"1",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L292-L300 |
112,380 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java | CacheObjectUtil.incrementByValue | public static Single<Long> incrementByValue(String cacheKey, long value) {
return incrementByValue(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
} | java | public static Single<Long> incrementByValue(String cacheKey, long value) {
return incrementByValue(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
} | [
"public",
"static",
"Single",
"<",
"Long",
">",
"incrementByValue",
"(",
"String",
"cacheKey",
",",
"long",
"value",
")",
"{",
"return",
"incrementByValue",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"cacheKey",
",",
"value",
")",
";",
"}"
] | increase with specified increment
@param cacheKey the key
@param value the increment
@return the result value after increment, or error. | [
"increase",
"with",
"specified",
"increment"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheObjectUtil.java#L309-L311 |
112,381 | xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java | StackTraceFilter.getFilteredStackTrace | @Deprecated
public static String getFilteredStackTrace(Throwable t, boolean shouldFilter) {
if (shouldFilter) {
return getFilteredStackTrace(t, 0);
}
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
pw.cl... | java | @Deprecated
public static String getFilteredStackTrace(Throwable t, boolean shouldFilter) {
if (shouldFilter) {
return getFilteredStackTrace(t, 0);
}
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
pw.cl... | [
"@",
"Deprecated",
"public",
"static",
"String",
"getFilteredStackTrace",
"(",
"Throwable",
"t",
",",
"boolean",
"shouldFilter",
")",
"{",
"if",
"(",
"shouldFilter",
")",
"{",
"return",
"getFilteredStackTrace",
"(",
"t",
",",
"0",
")",
";",
"}",
"StringWriter"... | Get a filterered stack trace.
@param t the throwable
@param shouldFilter true in case filtering should be performed. Else stack trace as string will be returned.
@return String containing the stack trace.
@deprecated since 1.11.1. Use {@link #getStackTrace(Throwable, int)} to get the stack trace without filtering or
{... | [
"Get",
"a",
"filterered",
"stack",
"trace",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java#L223-L236 |
112,382 | xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java | StackTraceFilter.tryGetForbiddenPackageName | private static String tryGetForbiddenPackageName(String classAndMethod) {
for (String pkg : suppressedPackages) {
if (classAndMethod.startsWith(pkg)) {
return pkg;
}
}
return null;
} | java | private static String tryGetForbiddenPackageName(String classAndMethod) {
for (String pkg : suppressedPackages) {
if (classAndMethod.startsWith(pkg)) {
return pkg;
}
}
return null;
} | [
"private",
"static",
"String",
"tryGetForbiddenPackageName",
"(",
"String",
"classAndMethod",
")",
"{",
"for",
"(",
"String",
"pkg",
":",
"suppressedPackages",
")",
"{",
"if",
"(",
"classAndMethod",
".",
"startsWith",
"(",
"pkg",
")",
")",
"{",
"return",
"pkg"... | Checks to see if the class is part of a forbidden package. If so, it returns the package name from the list of suppressed
packages that matches, otherwise it returns null.
@param classAndMethod StackTraceElement
@return forbidden package name or null. | [
"Checks",
"to",
"see",
"if",
"the",
"class",
"is",
"part",
"of",
"a",
"forbidden",
"package",
".",
"If",
"so",
"it",
"returns",
"the",
"package",
"name",
"from",
"the",
"list",
"of",
"suppressed",
"packages",
"that",
"matches",
"otherwise",
"it",
"returns"... | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java#L390-L398 |
112,383 | xiancloud/xian | xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/units/BaseDeleteDB.java | BaseDeleteDB.fmtObjectToStrArray | private static String[] fmtObjectToStrArray(Object object) {
if (object == null) {
return null;
}
if (object instanceof String[]) {
return (String[]) object;
}
if (object instanceof Collection) {
Collection c = (Collection) object;
... | java | private static String[] fmtObjectToStrArray(Object object) {
if (object == null) {
return null;
}
if (object instanceof String[]) {
return (String[]) object;
}
if (object instanceof Collection) {
Collection c = (Collection) object;
... | [
"private",
"static",
"String",
"[",
"]",
"fmtObjectToStrArray",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"object",
"instanceof",
"String",
"[",
"]",
")",
"{",
"return",
"(",
... | cast or convert the given object to string array.
@param object a string array or string collection.
@return string array | [
"cast",
"or",
"convert",
"the",
"given",
"object",
"to",
"string",
"array",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/units/BaseDeleteDB.java#L84-L96 |
112,384 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/distribution/GroupJudge.java | GroupJudge.defined | public static boolean defined(String group) {
return LocalUnitsManager.getGroupByName(group) != null ||
(GroupDiscovery.singleton != null && GroupDiscovery.singleton.newestDefinition(group) != null);
} | java | public static boolean defined(String group) {
return LocalUnitsManager.getGroupByName(group) != null ||
(GroupDiscovery.singleton != null && GroupDiscovery.singleton.newestDefinition(group) != null);
} | [
"public",
"static",
"boolean",
"defined",
"(",
"String",
"group",
")",
"{",
"return",
"LocalUnitsManager",
".",
"getGroupByName",
"(",
"group",
")",
"!=",
"null",
"||",
"(",
"GroupDiscovery",
".",
"singleton",
"!=",
"null",
"&&",
"GroupDiscovery",
".",
"single... | Judge whether the specified group is defined.
We check local first and then remote. | [
"Judge",
"whether",
"the",
"specified",
"group",
"is",
"defined",
".",
"We",
"check",
"local",
"first",
"and",
"then",
"remote",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/distribution/GroupJudge.java#L22-L25 |
112,385 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/distribution/GroupJudge.java | GroupJudge.isDao | public static boolean isDao(String groupName) {
try {
return GroupRouter.singleton.newestDefinition(groupName).isDao();
} catch (GroupUndefinedException e) {
throw new RuntimeException("Call GroupJudge.defined() first.", e);
}
} | java | public static boolean isDao(String groupName) {
try {
return GroupRouter.singleton.newestDefinition(groupName).isDao();
} catch (GroupUndefinedException e) {
throw new RuntimeException("Call GroupJudge.defined() first.", e);
}
} | [
"public",
"static",
"boolean",
"isDao",
"(",
"String",
"groupName",
")",
"{",
"try",
"{",
"return",
"GroupRouter",
".",
"singleton",
".",
"newestDefinition",
"(",
"groupName",
")",
".",
"isDao",
"(",
")",
";",
"}",
"catch",
"(",
"GroupUndefinedException",
"e... | Judge whether the specified group is a dao group.
@param groupName the specified group name.
@return true if this group's dao property value is true, other wise flase. | [
"Judge",
"whether",
"the",
"specified",
"group",
"is",
"a",
"dao",
"group",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/distribution/GroupJudge.java#L43-L49 |
112,386 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/UnitMeta.java | UnitMeta.appendDescription | public UnitMeta appendDescription(String descriptionToBeAppended) {
if (getDescription() != null) {
setDescription(getDescription().concat(descriptionToBeAppended));
} else {
setDescription(descriptionToBeAppended);
}
return this;
} | java | public UnitMeta appendDescription(String descriptionToBeAppended) {
if (getDescription() != null) {
setDescription(getDescription().concat(descriptionToBeAppended));
} else {
setDescription(descriptionToBeAppended);
}
return this;
} | [
"public",
"UnitMeta",
"appendDescription",
"(",
"String",
"descriptionToBeAppended",
")",
"{",
"if",
"(",
"getDescription",
"(",
")",
"!=",
"null",
")",
"{",
"setDescription",
"(",
"getDescription",
"(",
")",
".",
"concat",
"(",
"descriptionToBeAppended",
")",
"... | Append a description string to the end of current description
@param descriptionToBeAppended description string you want to append
@return this unit meta data | [
"Append",
"a",
"description",
"string",
"to",
"the",
"end",
"of",
"current",
"description"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/UnitMeta.java#L99-L106 |
112,387 | xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/atomic/DistributedAtomicValue.java | DistributedAtomicValue.forceSet | public void forceSet(byte[] newValue) throws Exception
{
try
{
client.setData().forPath(path, newValue);
}
catch ( KeeperException.NoNodeException dummy )
{
try
{
client.create().creatingParentContainersIfNeeded().forPath(pa... | java | public void forceSet(byte[] newValue) throws Exception
{
try
{
client.setData().forPath(path, newValue);
}
catch ( KeeperException.NoNodeException dummy )
{
try
{
client.create().creatingParentContainersIfNeeded().forPath(pa... | [
"public",
"void",
"forceSet",
"(",
"byte",
"[",
"]",
"newValue",
")",
"throws",
"Exception",
"{",
"try",
"{",
"client",
".",
"setData",
"(",
")",
".",
"forPath",
"(",
"path",
",",
"newValue",
")",
";",
"}",
"catch",
"(",
"KeeperException",
".",
"NoNode... | Forcibly sets the value any guarantees of atomicity.
@param newValue the new value
@throws Exception ZooKeeper errors | [
"Forcibly",
"sets",
"the",
"value",
"any",
"guarantees",
"of",
"atomicity",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/atomic/DistributedAtomicValue.java#L99-L116 |
112,388 | xiancloud/xian | xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/transaction/TransactionFactory.java | TransactionFactory.getTransaction | public static Single<XianTransaction> getTransaction(String transactionId, boolean readOnly) {
if (BaseLocalTransaction.getExistedLocalTrans(transactionId) != null) {
return Single.just(BaseLocalTransaction.getExistedLocalTrans(transactionId));
}
if (readOnly) {
return Po... | java | public static Single<XianTransaction> getTransaction(String transactionId, boolean readOnly) {
if (BaseLocalTransaction.getExistedLocalTrans(transactionId) != null) {
return Single.just(BaseLocalTransaction.getExistedLocalTrans(transactionId));
}
if (readOnly) {
return Po... | [
"public",
"static",
"Single",
"<",
"XianTransaction",
">",
"getTransaction",
"(",
"String",
"transactionId",
",",
"boolean",
"readOnly",
")",
"{",
"if",
"(",
"BaseLocalTransaction",
".",
"getExistedLocalTrans",
"(",
"transactionId",
")",
"!=",
"null",
")",
"{",
... | create or get the current xian transaction.
This method is always returning a transaction reference for you.
@param transactionId transaction id
@param readOnly boolean flag indicates that whether this dao operation is read-only
@return the deferred transaction reference. | [
"create",
"or",
"get",
"the",
"current",
"xian",
"transaction",
".",
"This",
"method",
"is",
"always",
"returning",
"a",
"transaction",
"reference",
"for",
"you",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/transaction/TransactionFactory.java#L22-L33 |
112,389 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/message/sender/remote/RemoteSender.java | RemoteSender.sendToRemote | private void sendToRemote(String nodeId) {
unitRequest.getContext().setDestinationNodeId(nodeId);
/*unitRequest.getContext().setSourceNodeId(LocalNodeManager.LOCAL_NODE_ID); let the node instance to fill this source node id property*/
LocalNodeManager.sendLoadBalanced(unitRequest, callback);
... | java | private void sendToRemote(String nodeId) {
unitRequest.getContext().setDestinationNodeId(nodeId);
/*unitRequest.getContext().setSourceNodeId(LocalNodeManager.LOCAL_NODE_ID); let the node instance to fill this source node id property*/
LocalNodeManager.sendLoadBalanced(unitRequest, callback);
... | [
"private",
"void",
"sendToRemote",
"(",
"String",
"nodeId",
")",
"{",
"unitRequest",
".",
"getContext",
"(",
")",
".",
"setDestinationNodeId",
"(",
"nodeId",
")",
";",
"/*unitRequest.getContext().setSourceNodeId(LocalNodeManager.LOCAL_NODE_ID); let the node instance to fill thi... | send message to remote asynchronously.
@param nodeId the destination node id. | [
"send",
"message",
"to",
"remote",
"asynchronously",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/message/sender/remote/RemoteSender.java#L40-L44 |
112,390 | xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java | PathChildrenCache.getCurrentData | public List<ChildData> getCurrentData()
{
return ImmutableList.copyOf(Sets.<ChildData>newTreeSet(currentData.values()));
} | java | public List<ChildData> getCurrentData()
{
return ImmutableList.copyOf(Sets.<ChildData>newTreeSet(currentData.values()));
} | [
"public",
"List",
"<",
"ChildData",
">",
"getCurrentData",
"(",
")",
"{",
"return",
"ImmutableList",
".",
"copyOf",
"(",
"Sets",
".",
"<",
"ChildData",
">",
"newTreeSet",
"(",
"currentData",
".",
"values",
"(",
")",
")",
")",
";",
"}"
] | Return the current data. There are no guarantees of accuracy. This is
merely the most recent view of the data. The data is returned in sorted order.
@return list of children and data | [
"Return",
"the",
"current",
"data",
".",
"There",
"are",
"no",
"guarantees",
"of",
"accuracy",
".",
"This",
"is",
"merely",
"the",
"most",
"recent",
"view",
"of",
"the",
"data",
".",
"The",
"data",
"is",
"returned",
"in",
"sorted",
"order",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java#L407-L410 |
112,391 | xiancloud/xian | xian-gateway/src/main/java/info/xiancloud/gateway/access_token_validation/ValidateAccessToken.java | ValidateAccessToken.fetchAccessTokenAndReturnScope | private static Single<Optional<String>> fetchAccessTokenAndReturnScope(UnitRequest request) {
LOG.info("fetchAccessTokenAndReturnScope");
String ip = request.getContext().getIp();
if (StringUtil.isEmpty(ip)) {
throw new IllegalArgumentException("Client's ip is empty, please check!");... | java | private static Single<Optional<String>> fetchAccessTokenAndReturnScope(UnitRequest request) {
LOG.info("fetchAccessTokenAndReturnScope");
String ip = request.getContext().getIp();
if (StringUtil.isEmpty(ip)) {
throw new IllegalArgumentException("Client's ip is empty, please check!");... | [
"private",
"static",
"Single",
"<",
"Optional",
"<",
"String",
">",
">",
"fetchAccessTokenAndReturnScope",
"(",
"UnitRequest",
"request",
")",
"{",
"LOG",
".",
"info",
"(",
"\"fetchAccessTokenAndReturnScope\"",
")",
";",
"String",
"ip",
"=",
"request",
".",
"get... | query for access token info and set it into the request context
and return the scope of current token.
@return the scope of the request or empty
if no token string is provided. | [
"query",
"for",
"access",
"token",
"info",
"and",
"set",
"it",
"into",
"the",
"request",
"context",
"and",
"return",
"the",
"scope",
"of",
"current",
"token",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-gateway/src/main/java/info/xiancloud/gateway/access_token_validation/ValidateAccessToken.java#L75-L101 |
112,392 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java | StringUtil.underlineToCamel | public static String underlineToCamel(String param) {
if (isEmpty(param.trim())) {
return "";
}
StringBuilder sb = new StringBuilder(param);
Matcher mc = Pattern.compile(UNDERLINE).matcher(param);
int i = 0;
while (mc.find()) {
int position = mc.en... | java | public static String underlineToCamel(String param) {
if (isEmpty(param.trim())) {
return "";
}
StringBuilder sb = new StringBuilder(param);
Matcher mc = Pattern.compile(UNDERLINE).matcher(param);
int i = 0;
while (mc.find()) {
int position = mc.en... | [
"public",
"static",
"String",
"underlineToCamel",
"(",
"String",
"param",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"param",
".",
"trim",
"(",
")",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"param",
... | convert underline style string to camel style. | [
"convert",
"underline",
"style",
"string",
"to",
"camel",
"style",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java#L50-L62 |
112,393 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java | StringUtil.camelToUnderline | public static Map<String, Object> camelToUnderline(Map<String, Object> map) {
Map<String, Object> newMap = new HashMap<>();
for (String key : map.keySet()) {
newMap.put(camelToUnderline(key), map.get(key));
}
return newMap;
} | java | public static Map<String, Object> camelToUnderline(Map<String, Object> map) {
Map<String, Object> newMap = new HashMap<>();
for (String key : map.keySet()) {
newMap.put(camelToUnderline(key), map.get(key));
}
return newMap;
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"camelToUnderline",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"newMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
... | string keys are converted from camel style to underline style. a new map is returned, the original map is not changed. | [
"string",
"keys",
"are",
"converted",
"from",
"camel",
"style",
"to",
"underline",
"style",
".",
"a",
"new",
"map",
"is",
"returned",
"the",
"original",
"map",
"is",
"not",
"changed",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java#L67-L73 |
112,394 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java | StringUtil.getExceptionStacktrace | public static String getExceptionStacktrace(Throwable t) {
try (StringWriter errors = new StringWriter()) {
t.printStackTrace(new PrintWriter(errors));
return errors.toString();
} catch (IOException e) {
LOG.error(e);
return null;
}
} | java | public static String getExceptionStacktrace(Throwable t) {
try (StringWriter errors = new StringWriter()) {
t.printStackTrace(new PrintWriter(errors));
return errors.toString();
} catch (IOException e) {
LOG.error(e);
return null;
}
} | [
"public",
"static",
"String",
"getExceptionStacktrace",
"(",
"Throwable",
"t",
")",
"{",
"try",
"(",
"StringWriter",
"errors",
"=",
"new",
"StringWriter",
"(",
")",
")",
"{",
"t",
".",
"printStackTrace",
"(",
"new",
"PrintWriter",
"(",
"errors",
")",
")",
... | get the stacktrace string.
@param t the throwable object.
@return the stacktrace string. | [
"get",
"the",
"stacktrace",
"string",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java#L103-L111 |
112,395 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java | StringUtil.split | public static String[] split(String str, String theSplitter) {
if (StringUtil.isEmpty(str)) {
return new String[0];
}
return str.trim().split("\\s*" + escapeSpecialChar(theSplitter) + "\\s*");
} | java | public static String[] split(String str, String theSplitter) {
if (StringUtil.isEmpty(str)) {
return new String[0];
}
return str.trim().split("\\s*" + escapeSpecialChar(theSplitter) + "\\s*");
} | [
"public",
"static",
"String",
"[",
"]",
"split",
"(",
"String",
"str",
",",
"String",
"theSplitter",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"str",
")",
")",
"{",
"return",
"new",
"String",
"[",
"0",
"]",
";",
"}",
"return",
"str",
... | split the given string into an array with the given splitter.
note that all elements in the returned array are trimmed.
@param str the string to be split, if null the split result is en empty string array.
@param theSplitter theSplitter, regex special character will be escaped.
@return spitted array or empty a... | [
"split",
"the",
"given",
"string",
"into",
"an",
"array",
"with",
"the",
"given",
"splitter",
".",
"note",
"that",
"all",
"elements",
"in",
"the",
"returned",
"array",
"are",
"trimmed",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/StringUtil.java#L222-L227 |
112,396 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java | UnitResponse.createSuccess | public static UnitResponse createSuccess(Object data, String errMsg) {
return createSuccess(data).setMessage(errMsg);
} | java | public static UnitResponse createSuccess(Object data, String errMsg) {
return createSuccess(data).setMessage(errMsg);
} | [
"public",
"static",
"UnitResponse",
"createSuccess",
"(",
"Object",
"data",
",",
"String",
"errMsg",
")",
"{",
"return",
"createSuccess",
"(",
"data",
")",
".",
"setMessage",
"(",
"errMsg",
")",
";",
"}"
] | create a succeeded response instance with specified data.
@param data the data for the susccessful response
@param errMsg the description message
@return the newly created response | [
"create",
"a",
"succeeded",
"response",
"instance",
"with",
"specified",
"data",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java#L106-L108 |
112,397 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java | UnitResponse.createException | public static UnitResponse createException(String errCode, Throwable exception) {
return UnitResponse.createException(exception).setCode(errCode);
} | java | public static UnitResponse createException(String errCode, Throwable exception) {
return UnitResponse.createException(exception).setCode(errCode);
} | [
"public",
"static",
"UnitResponse",
"createException",
"(",
"String",
"errCode",
",",
"Throwable",
"exception",
")",
"{",
"return",
"UnitResponse",
".",
"createException",
"(",
"exception",
")",
".",
"setCode",
"(",
"errCode",
")",
";",
"}"
] | Create an exception unit response object.
@param errCode the error code for the unit response.
@param exception the exception object.
@return the newly created unit response. | [
"Create",
"an",
"exception",
"unit",
"response",
"object",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java#L139-L141 |
112,398 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java | UnitResponse.createError | public static UnitResponse createError(String errCode, Object data, String errMsg) {
if (Group.CODE_SUCCESS.equalsIgnoreCase(errCode)) {
throw new IllegalArgumentException("Only non-success code is allowed here.");
}
return new UnitResponse().setCode(errCode).setData(data).setMessage... | java | public static UnitResponse createError(String errCode, Object data, String errMsg) {
if (Group.CODE_SUCCESS.equalsIgnoreCase(errCode)) {
throw new IllegalArgumentException("Only non-success code is allowed here.");
}
return new UnitResponse().setCode(errCode).setData(data).setMessage... | [
"public",
"static",
"UnitResponse",
"createError",
"(",
"String",
"errCode",
",",
"Object",
"data",
",",
"String",
"errMsg",
")",
"{",
"if",
"(",
"Group",
".",
"CODE_SUCCESS",
".",
"equalsIgnoreCase",
"(",
"errCode",
")",
")",
"{",
"throw",
"new",
"IllegalAr... | create a new error unit response instance.
@param errCode the error code.
@param data the data, anything you want, can be an exception object too
@param errMsg the error message.
@return the newly created unit response object. | [
"create",
"a",
"new",
"error",
"unit",
"response",
"instance",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java#L174-L179 |
112,399 | xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java | UnitResponse.createTimeout | public static UnitResponse createTimeout(Object dataOrException, String errMsg) {
return new UnitResponse().setCode(Group.CODE_TIME_OUT).setData(dataOrException).setMessage(errMsg);
} | java | public static UnitResponse createTimeout(Object dataOrException, String errMsg) {
return new UnitResponse().setCode(Group.CODE_TIME_OUT).setData(dataOrException).setMessage(errMsg);
} | [
"public",
"static",
"UnitResponse",
"createTimeout",
"(",
"Object",
"dataOrException",
",",
"String",
"errMsg",
")",
"{",
"return",
"new",
"UnitResponse",
"(",
")",
".",
"setCode",
"(",
"Group",
".",
"CODE_TIME_OUT",
")",
".",
"setData",
"(",
"dataOrException",
... | create a new timed out unit response.
@param dataOrException the data or exception object.
@param errMsg the error message.
@return the newly created unit response object. | [
"create",
"a",
"new",
"timed",
"out",
"unit",
"response",
"."
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/message/UnitResponse.java#L188-L190 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.