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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur1Hash.java | Murmur1Hash.hash | public static int hash(ByteBuffer buf, int seed) {
// save byte order for later restoration
ByteOrder byteOrder = buf.order();
buf.order(ByteOrder.LITTLE_ENDIAN);
int m = 0x5bd1e995;
int r = 24;
int h = seed ^ buf.remaining();
while (buf.remaining() >= 4) {
int... | java | public static int hash(ByteBuffer buf, int seed) {
// save byte order for later restoration
ByteOrder byteOrder = buf.order();
buf.order(ByteOrder.LITTLE_ENDIAN);
int m = 0x5bd1e995;
int r = 24;
int h = seed ^ buf.remaining();
while (buf.remaining() >= 4) {
int... | [
"public",
"static",
"int",
"hash",
"(",
"ByteBuffer",
"buf",
",",
"int",
"seed",
")",
"{",
"// save byte order for later restoration",
"ByteOrder",
"byteOrder",
"=",
"buf",
".",
"order",
"(",
")",
";",
"buf",
".",
"order",
"(",
"ByteOrder",
".",
"LITTLE_ENDIAN... | Hashes the bytes in a buffer from the current position to the limit.
@param buf The bytes to hash.
@param seed The seed for the hash.
@return The 32 bit murmur hash of the bytes in the buffer. | [
"Hashes",
"the",
"bytes",
"in",
"a",
"buffer",
"from",
"the",
"current",
"position",
"to",
"the",
"limit",
"."
] | 158f807083ea8e9b09c8089cb07f98e954ad5b23 | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur1Hash.java#L48-L85 | train |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java | HttpEndpointBasedTokenMapSupplier.getTopologyJsonPayload | @Override
public String getTopologyJsonPayload(Set<Host> activeHosts) {
int count = NUM_RETRIER_ACROSS_NODES;
String response;
Exception lastEx = null;
do {
try {
response = getTopologyFromRandomNodeWithRetry(activeHosts);
if (response != null) {
return response;
}
} catch (Exception... | java | @Override
public String getTopologyJsonPayload(Set<Host> activeHosts) {
int count = NUM_RETRIER_ACROSS_NODES;
String response;
Exception lastEx = null;
do {
try {
response = getTopologyFromRandomNodeWithRetry(activeHosts);
if (response != null) {
return response;
}
} catch (Exception... | [
"@",
"Override",
"public",
"String",
"getTopologyJsonPayload",
"(",
"Set",
"<",
"Host",
">",
"activeHosts",
")",
"{",
"int",
"count",
"=",
"NUM_RETRIER_ACROSS_NODES",
";",
"String",
"response",
";",
"Exception",
"lastEx",
"=",
"null",
";",
"do",
"{",
"try",
... | Tries to get topology information by randomly trying across nodes. | [
"Tries",
"to",
"get",
"topology",
"information",
"by",
"randomly",
"trying",
"across",
"nodes",
"."
] | 158f807083ea8e9b09c8089cb07f98e954ad5b23 | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java#L82-L110 | train |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java | HttpEndpointBasedTokenMapSupplier.getRandomHost | public Host getRandomHost(Set<Host> activeHosts) {
Random random = new Random();
List<Host> hostsUp = new ArrayList<Host>(CollectionUtils.filter(activeHosts, new Predicate<Host>() {
@Override
public boolean apply(Host x) {
return x.isUp();
}
}));
return hostsUp.get(random.nextInt(hostsUp.size())... | java | public Host getRandomHost(Set<Host> activeHosts) {
Random random = new Random();
List<Host> hostsUp = new ArrayList<Host>(CollectionUtils.filter(activeHosts, new Predicate<Host>() {
@Override
public boolean apply(Host x) {
return x.isUp();
}
}));
return hostsUp.get(random.nextInt(hostsUp.size())... | [
"public",
"Host",
"getRandomHost",
"(",
"Set",
"<",
"Host",
">",
"activeHosts",
")",
"{",
"Random",
"random",
"=",
"new",
"Random",
"(",
")",
";",
"List",
"<",
"Host",
">",
"hostsUp",
"=",
"new",
"ArrayList",
"<",
"Host",
">",
"(",
"CollectionUtils",
"... | Finds a random host from the set of active hosts to perform
cluster_describe
@param activeHosts
@return a random host | [
"Finds",
"a",
"random",
"host",
"from",
"the",
"set",
"of",
"active",
"hosts",
"to",
"perform",
"cluster_describe"
] | 158f807083ea8e9b09c8089cb07f98e954ad5b23 | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java#L156-L168 | train |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java | HttpEndpointBasedTokenMapSupplier.getTopologyFromRandomNodeWithRetry | private String getTopologyFromRandomNodeWithRetry(Set<Host> activeHosts) {
int count = NUM_RETRIES_PER_NODE;
String nodeResponse;
Exception lastEx;
final Host randomHost = getRandomHost(activeHosts);
do {
try {
lastEx = null;
nodeResponse = getResponseViaHttp(randomHost.getHostName());
if (node... | java | private String getTopologyFromRandomNodeWithRetry(Set<Host> activeHosts) {
int count = NUM_RETRIES_PER_NODE;
String nodeResponse;
Exception lastEx;
final Host randomHost = getRandomHost(activeHosts);
do {
try {
lastEx = null;
nodeResponse = getResponseViaHttp(randomHost.getHostName());
if (node... | [
"private",
"String",
"getTopologyFromRandomNodeWithRetry",
"(",
"Set",
"<",
"Host",
">",
"activeHosts",
")",
"{",
"int",
"count",
"=",
"NUM_RETRIES_PER_NODE",
";",
"String",
"nodeResponse",
";",
"Exception",
"lastEx",
";",
"final",
"Host",
"randomHost",
"=",
"getR... | Tries multiple nodes, and it only bubbles up the last node's exception.
We want to bubble up the exception in order for the last node to be
removed from the connection pool.
@param activeHosts
@return the topology from cluster_describe | [
"Tries",
"multiple",
"nodes",
"and",
"it",
"only",
"bubbles",
"up",
"the",
"last",
"node",
"s",
"exception",
".",
"We",
"want",
"to",
"bubble",
"up",
"the",
"exception",
"in",
"order",
"for",
"the",
"last",
"node",
"to",
"be",
"removed",
"from",
"the",
... | 158f807083ea8e9b09c8089cb07f98e954ad5b23 | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java#L178-L209 | train |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/AbstractTokenMapSupplier.java | AbstractTokenMapSupplier.parseTokenListFromJson | List<HostToken> parseTokenListFromJson(String json) {
List<HostToken> hostTokens = new ArrayList<HostToken>();
JSONParser parser = new JSONParser();
try {
JSONArray arr = (JSONArray) parser.parse(json);
Iterator<?> iter = arr.iterator();
while (iter.hasNext... | java | List<HostToken> parseTokenListFromJson(String json) {
List<HostToken> hostTokens = new ArrayList<HostToken>();
JSONParser parser = new JSONParser();
try {
JSONArray arr = (JSONArray) parser.parse(json);
Iterator<?> iter = arr.iterator();
while (iter.hasNext... | [
"List",
"<",
"HostToken",
">",
"parseTokenListFromJson",
"(",
"String",
"json",
")",
"{",
"List",
"<",
"HostToken",
">",
"hostTokens",
"=",
"new",
"ArrayList",
"<",
"HostToken",
">",
"(",
")",
";",
"JSONParser",
"parser",
"=",
"new",
"JSONParser",
"(",
")"... | package-private for Test | [
"package",
"-",
"private",
"for",
"Test"
] | 158f807083ea8e9b09c8089cb07f98e954ad5b23 | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/AbstractTokenMapSupplier.java#L210-L258 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java | ProfileRequest.start | @Override
public void start(final BaseCallback<Authentication, AuthenticationException> callback) {
credentialsRequest.start(new BaseCallback<Credentials, AuthenticationException>() {
@Override
public void onSuccess(final Credentials credentials) {
userInfoRequest
... | java | @Override
public void start(final BaseCallback<Authentication, AuthenticationException> callback) {
credentialsRequest.start(new BaseCallback<Credentials, AuthenticationException>() {
@Override
public void onSuccess(final Credentials credentials) {
userInfoRequest
... | [
"@",
"Override",
"public",
"void",
"start",
"(",
"final",
"BaseCallback",
"<",
"Authentication",
",",
"AuthenticationException",
">",
"callback",
")",
"{",
"credentialsRequest",
".",
"start",
"(",
"new",
"BaseCallback",
"<",
"Credentials",
",",
"AuthenticationExcept... | Starts the log in request and then fetches the user's profile
@param callback called on either success or failure | [
"Starts",
"the",
"log",
"in",
"request",
"and",
"then",
"fetches",
"the",
"user",
"s",
"profile"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java#L92-L117 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java | ProfileRequest.execute | @Override
public Authentication execute() throws Auth0Exception {
Credentials credentials = credentialsRequest.execute();
UserProfile profile = userInfoRequest
.addHeader(HEADER_AUTHORIZATION, "Bearer " + credentials.getAccessToken())
.execute();
return new Au... | java | @Override
public Authentication execute() throws Auth0Exception {
Credentials credentials = credentialsRequest.execute();
UserProfile profile = userInfoRequest
.addHeader(HEADER_AUTHORIZATION, "Bearer " + credentials.getAccessToken())
.execute();
return new Au... | [
"@",
"Override",
"public",
"Authentication",
"execute",
"(",
")",
"throws",
"Auth0Exception",
"{",
"Credentials",
"credentials",
"=",
"credentialsRequest",
".",
"execute",
"(",
")",
";",
"UserProfile",
"profile",
"=",
"userInfoRequest",
".",
"addHeader",
"(",
"HEA... | Logs in the user with Auth0 and fetches it's profile.
@return authentication object containing the user's tokens and profile
@throws Auth0Exception when either authentication or profile fetch fails | [
"Logs",
"in",
"the",
"user",
"with",
"Auth0",
"and",
"fetches",
"it",
"s",
"profile",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java#L125-L132 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/result/UserProfile.java | UserProfile.getExtraInfo | public Map<String, Object> getExtraInfo() {
return extraInfo != null ? new HashMap<>(extraInfo) : Collections.<String, Object>emptyMap();
} | java | public Map<String, Object> getExtraInfo() {
return extraInfo != null ? new HashMap<>(extraInfo) : Collections.<String, Object>emptyMap();
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getExtraInfo",
"(",
")",
"{",
"return",
"extraInfo",
"!=",
"null",
"?",
"new",
"HashMap",
"<>",
"(",
"extraInfo",
")",
":",
"Collections",
".",
"<",
"String",
",",
"Object",
">",
"emptyMap",
"(",
")"... | Returns extra information of the profile that is not part of the normalized profile
@return a map with user's extra information found in the profile | [
"Returns",
"extra",
"information",
"of",
"the",
"profile",
"that",
"is",
"not",
"part",
"of",
"the",
"normalized",
"profile"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/result/UserProfile.java#L129-L131 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java | SignUpRequest.addAuthenticationParameters | @Override
public SignUpRequest addAuthenticationParameters(Map<String, Object> parameters) {
authenticationRequest.addAuthenticationParameters(parameters);
return this;
} | java | @Override
public SignUpRequest addAuthenticationParameters(Map<String, Object> parameters) {
authenticationRequest.addAuthenticationParameters(parameters);
return this;
} | [
"@",
"Override",
"public",
"SignUpRequest",
"addAuthenticationParameters",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"authenticationRequest",
".",
"addAuthenticationParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | Add additional parameters sent when logging the user in
@param parameters sent with the request and must be non-null
@return itself
@see ParameterBuilder | [
"Add",
"additional",
"parameters",
"sent",
"when",
"logging",
"the",
"user",
"in"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java#L88-L92 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java | SignUpRequest.start | @Override
public void start(final BaseCallback<Credentials, AuthenticationException> callback) {
signUpRequest.start(new BaseCallback<DatabaseUser, AuthenticationException>() {
@Override
public void onSuccess(final DatabaseUser user) {
authenticationRequest.start(call... | java | @Override
public void start(final BaseCallback<Credentials, AuthenticationException> callback) {
signUpRequest.start(new BaseCallback<DatabaseUser, AuthenticationException>() {
@Override
public void onSuccess(final DatabaseUser user) {
authenticationRequest.start(call... | [
"@",
"Override",
"public",
"void",
"start",
"(",
"final",
"BaseCallback",
"<",
"Credentials",
",",
"AuthenticationException",
">",
"callback",
")",
"{",
"signUpRequest",
".",
"start",
"(",
"new",
"BaseCallback",
"<",
"DatabaseUser",
",",
"AuthenticationException",
... | Starts to execute create user request and then logs the user in.
@param callback called on either success or failure. | [
"Starts",
"to",
"execute",
"create",
"user",
"request",
"and",
"then",
"logs",
"the",
"user",
"in",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java#L143-L156 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java | CustomTabsController.bindService | public void bindService() {
Log.v(TAG, "Trying to bind the service");
Context context = this.context.get();
isBound = false;
if (context != null && preferredPackage != null) {
isBound = CustomTabsClient.bindCustomTabsService(context, preferredPackage, this);
}
... | java | public void bindService() {
Log.v(TAG, "Trying to bind the service");
Context context = this.context.get();
isBound = false;
if (context != null && preferredPackage != null) {
isBound = CustomTabsClient.bindCustomTabsService(context, preferredPackage, this);
}
... | [
"public",
"void",
"bindService",
"(",
")",
"{",
"Log",
".",
"v",
"(",
"TAG",
",",
"\"Trying to bind the service\"",
")",
";",
"Context",
"context",
"=",
"this",
".",
"context",
".",
"get",
"(",
")",
";",
"isBound",
"=",
"false",
";",
"if",
"(",
"contex... | Attempts to bind the Custom Tabs Service to the Context. | [
"Attempts",
"to",
"bind",
"the",
"Custom",
"Tabs",
"Service",
"to",
"the",
"Context",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java#L93-L101 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java | CustomTabsController.unbindService | public void unbindService() {
Log.v(TAG, "Trying to unbind the service");
Context context = this.context.get();
if (isBound && context != null) {
context.unbindService(this);
isBound = false;
}
} | java | public void unbindService() {
Log.v(TAG, "Trying to unbind the service");
Context context = this.context.get();
if (isBound && context != null) {
context.unbindService(this);
isBound = false;
}
} | [
"public",
"void",
"unbindService",
"(",
")",
"{",
"Log",
".",
"v",
"(",
"TAG",
",",
"\"Trying to unbind the service\"",
")",
";",
"Context",
"context",
"=",
"this",
".",
"context",
".",
"get",
"(",
")",
";",
"if",
"(",
"isBound",
"&&",
"context",
"!=",
... | Attempts to unbind the Custom Tabs Service from the Context. | [
"Attempts",
"to",
"unbind",
"the",
"Custom",
"Tabs",
"Service",
"from",
"the",
"Context",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java#L106-L113 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/provider/PKCE.java | PKCE.getToken | public void getToken(String authorizationCode, @NonNull final AuthCallback callback) {
apiClient.token(authorizationCode, redirectUri)
.setCodeVerifier(codeVerifier)
.start(new BaseCallback<Credentials, AuthenticationException>() {
@Override
... | java | public void getToken(String authorizationCode, @NonNull final AuthCallback callback) {
apiClient.token(authorizationCode, redirectUri)
.setCodeVerifier(codeVerifier)
.start(new BaseCallback<Credentials, AuthenticationException>() {
@Override
... | [
"public",
"void",
"getToken",
"(",
"String",
"authorizationCode",
",",
"@",
"NonNull",
"final",
"AuthCallback",
"callback",
")",
"{",
"apiClient",
".",
"token",
"(",
"authorizationCode",
",",
"redirectUri",
")",
".",
"setCodeVerifier",
"(",
"codeVerifier",
")",
... | Performs a request to the Auth0 API to get the OAuth Token and end the PKCE flow.
The instance of this class must be disposed after this method is called.
@param authorizationCode received in the call to /authorize with a "grant_type=code"
@param callback to notify the result of this call to. | [
"Performs",
"a",
"request",
"to",
"the",
"Auth0",
"API",
"to",
"get",
"the",
"OAuth",
"Token",
"and",
"end",
"the",
"PKCE",
"flow",
".",
"The",
"instance",
"of",
"this",
"class",
"must",
"be",
"disposed",
"after",
"this",
"method",
"is",
"called",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/PKCE.java#L84-L101 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/provider/AuthProvider.java | AuthProvider.checkPermissions | private boolean checkPermissions(Activity activity) {
String[] permissions = getRequiredAndroidPermissions();
return handler.areAllPermissionsGranted(activity, permissions);
} | java | private boolean checkPermissions(Activity activity) {
String[] permissions = getRequiredAndroidPermissions();
return handler.areAllPermissionsGranted(activity, permissions);
} | [
"private",
"boolean",
"checkPermissions",
"(",
"Activity",
"activity",
")",
"{",
"String",
"[",
"]",
"permissions",
"=",
"getRequiredAndroidPermissions",
"(",
")",
";",
"return",
"handler",
".",
"areAllPermissionsGranted",
"(",
"activity",
",",
"permissions",
")",
... | Checks if all the required Android Manifest.permissions have already been granted.
@param activity a valid activity context.
@return true if all the requested permissions are already granted, false otherwise. | [
"Checks",
"if",
"all",
"the",
"required",
"Android",
"Manifest",
".",
"permissions",
"have",
"already",
"been",
"granted",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/AuthProvider.java#L185-L188 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/provider/AuthProvider.java | AuthProvider.requestPermissions | private void requestPermissions(Activity activity, int requestCode) {
String[] permissions = getRequiredAndroidPermissions();
handler.requestPermissions(activity, permissions, requestCode);
} | java | private void requestPermissions(Activity activity, int requestCode) {
String[] permissions = getRequiredAndroidPermissions();
handler.requestPermissions(activity, permissions, requestCode);
} | [
"private",
"void",
"requestPermissions",
"(",
"Activity",
"activity",
",",
"int",
"requestCode",
")",
"{",
"String",
"[",
"]",
"permissions",
"=",
"getRequiredAndroidPermissions",
"(",
")",
";",
"handler",
".",
"requestPermissions",
"(",
"activity",
",",
"permissi... | Starts the async Permission Request. The caller activity will be notified of the result on the
onRequestPermissionsResult method, from the ActivityCompat.OnRequestPermissionsResultCallback
interface.
@param activity a valid activity context. It will receive the permissions
request result on the onRequestPermissions... | [
"Starts",
"the",
"async",
"Permission",
"Request",
".",
"The",
"caller",
"activity",
"will",
"be",
"notified",
"of",
"the",
"result",
"on",
"the",
"onRequestPermissionsResult",
"method",
"from",
"the",
"ActivityCompat",
".",
"OnRequestPermissionsResultCallback",
"inte... | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/AuthProvider.java#L199-L202 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java | DelegationRequest.addParameters | public DelegationRequest<T> addParameters(Map<String, Object> parameters) {
request.addParameters(parameters);
return this;
} | java | public DelegationRequest<T> addParameters(Map<String, Object> parameters) {
request.addParameters(parameters);
return this;
} | [
"public",
"DelegationRequest",
"<",
"T",
">",
"addParameters",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"request",
".",
"addParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | Add additional parameters to be sent in the request
@param parameters as a non-null dictionary
@return itself | [
"Add",
"additional",
"parameters",
"to",
"be",
"sent",
"in",
"the",
"request"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java#L64-L67 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java | DelegationRequest.setScope | public DelegationRequest<T> setScope(String scope) {
request.addParameter(ParameterBuilder.SCOPE_KEY, scope);
return this;
} | java | public DelegationRequest<T> setScope(String scope) {
request.addParameter(ParameterBuilder.SCOPE_KEY, scope);
return this;
} | [
"public",
"DelegationRequest",
"<",
"T",
">",
"setScope",
"(",
"String",
"scope",
")",
"{",
"request",
".",
"addParameter",
"(",
"ParameterBuilder",
".",
"SCOPE_KEY",
",",
"scope",
")",
";",
"return",
"this",
";",
"}"
] | Set the 'scope' used to make the delegation
@param scope value
@return itself | [
"Set",
"the",
"scope",
"used",
"to",
"make",
"the",
"delegation"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java#L86-L89 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.passwordless | @SuppressWarnings("WeakerAccess")
private ParameterizableRequest<Void, AuthenticationException> passwordless() {
HttpUrl url = HttpUrl.parse(auth0.getDomainUrl()).newBuilder()
.addPathSegment(PASSWORDLESS_PATH)
.addPathSegment(START_PATH)
.build();
fi... | java | @SuppressWarnings("WeakerAccess")
private ParameterizableRequest<Void, AuthenticationException> passwordless() {
HttpUrl url = HttpUrl.parse(auth0.getDomainUrl()).newBuilder()
.addPathSegment(PASSWORDLESS_PATH)
.addPathSegment(START_PATH)
.build();
fi... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"private",
"ParameterizableRequest",
"<",
"Void",
",",
"AuthenticationException",
">",
"passwordless",
"(",
")",
"{",
"HttpUrl",
"url",
"=",
"HttpUrl",
".",
"parse",
"(",
"auth0",
".",
"getDomainUrl",
"(",
"... | Start a custom passwordless flow
@return a request to configure and start | [
"Start",
"a",
"custom",
"passwordless",
"flow"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L1005-L1018 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java | BaseAuthenticationRequest.setConnection | @Override
public AuthenticationRequest setConnection(String connection) {
if (!hasLegacyPath()) {
Log.w(TAG, "Not setting the 'connection' parameter as the request is using a OAuth 2.0 API Authorization endpoint that doesn't support it.");
return this;
}
addParameter(... | java | @Override
public AuthenticationRequest setConnection(String connection) {
if (!hasLegacyPath()) {
Log.w(TAG, "Not setting the 'connection' parameter as the request is using a OAuth 2.0 API Authorization endpoint that doesn't support it.");
return this;
}
addParameter(... | [
"@",
"Override",
"public",
"AuthenticationRequest",
"setConnection",
"(",
"String",
"connection",
")",
"{",
"if",
"(",
"!",
"hasLegacyPath",
"(",
")",
")",
"{",
"Log",
".",
"w",
"(",
"TAG",
",",
"\"Not setting the 'connection' parameter as the request is using a OAuth... | Sets the 'connection' parameter.
@param connection name of the connection
@return itself | [
"Sets",
"the",
"connection",
"parameter",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java#L53-L61 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java | BaseAuthenticationRequest.setRealm | @Override
public AuthenticationRequest setRealm(String realm) {
if (hasLegacyPath()) {
Log.w(TAG, "Not setting the 'realm' parameter as the request is using a Legacy Authorization API endpoint that doesn't support it.");
return this;
}
addParameter(REALM_KEY, realm);
... | java | @Override
public AuthenticationRequest setRealm(String realm) {
if (hasLegacyPath()) {
Log.w(TAG, "Not setting the 'realm' parameter as the request is using a Legacy Authorization API endpoint that doesn't support it.");
return this;
}
addParameter(REALM_KEY, realm);
... | [
"@",
"Override",
"public",
"AuthenticationRequest",
"setRealm",
"(",
"String",
"realm",
")",
"{",
"if",
"(",
"hasLegacyPath",
"(",
")",
")",
"{",
"Log",
".",
"w",
"(",
"TAG",
",",
"\"Not setting the 'realm' parameter as the request is using a Legacy Authorization API en... | Sets the 'realm' parameter. A realm identifies the host against which the authentication will be made, and usually helps to know which username and password to use.
@param realm name of the realm
@return itself | [
"Sets",
"the",
"realm",
"parameter",
".",
"A",
"realm",
"identifies",
"the",
"host",
"against",
"which",
"the",
"authentication",
"will",
"be",
"made",
"and",
"usually",
"helps",
"to",
"know",
"which",
"username",
"and",
"password",
"to",
"use",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java#L69-L77 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java | DatabaseConnectionRequest.addParameters | public DatabaseConnectionRequest<T, U> addParameters(Map<String, Object> parameters) {
request.addParameters(parameters);
return this;
} | java | public DatabaseConnectionRequest<T, U> addParameters(Map<String, Object> parameters) {
request.addParameters(parameters);
return this;
} | [
"public",
"DatabaseConnectionRequest",
"<",
"T",
",",
"U",
">",
"addParameters",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"request",
".",
"addParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | Add the given parameters to the request
@param parameters to be sent with the request
@return itself | [
"Add",
"the",
"given",
"parameters",
"to",
"the",
"request"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java#L27-L30 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java | DatabaseConnectionRequest.addParameter | public DatabaseConnectionRequest<T, U> addParameter(String name, Object value) {
request.addParameter(name, value);
return this;
} | java | public DatabaseConnectionRequest<T, U> addParameter(String name, Object value) {
request.addParameter(name, value);
return this;
} | [
"public",
"DatabaseConnectionRequest",
"<",
"T",
",",
"U",
">",
"addParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"request",
".",
"addParameter",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a parameter by name to the request
@param name of the parameter
@param value of the parameter
@return itself | [
"Add",
"a",
"parameter",
"by",
"name",
"to",
"the",
"request"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java#L38-L41 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java | DatabaseConnectionRequest.setConnection | public DatabaseConnectionRequest<T, U> setConnection(String connection) {
request.addParameter(ParameterBuilder.CONNECTION_KEY, connection);
return this;
} | java | public DatabaseConnectionRequest<T, U> setConnection(String connection) {
request.addParameter(ParameterBuilder.CONNECTION_KEY, connection);
return this;
} | [
"public",
"DatabaseConnectionRequest",
"<",
"T",
",",
"U",
">",
"setConnection",
"(",
"String",
"connection",
")",
"{",
"request",
".",
"addParameter",
"(",
"ParameterBuilder",
".",
"CONNECTION_KEY",
",",
"connection",
")",
";",
"return",
"this",
";",
"}"
] | Set the Auth0 Database Connection used for this request using its name.
@param connection name
@return itself | [
"Set",
"the",
"Auth0",
"Database",
"Connection",
"used",
"for",
"this",
"request",
"using",
"its",
"name",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java#L59-L62 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java | OkHttpClientFactory.createClient | public OkHttpClient createClient(boolean loggingEnabled, boolean tls12Enforced, int connectTimeout, int readTimeout, int writeTimeout) {
return modifyClient(new OkHttpClient(), loggingEnabled, tls12Enforced, connectTimeout, readTimeout, writeTimeout);
} | java | public OkHttpClient createClient(boolean loggingEnabled, boolean tls12Enforced, int connectTimeout, int readTimeout, int writeTimeout) {
return modifyClient(new OkHttpClient(), loggingEnabled, tls12Enforced, connectTimeout, readTimeout, writeTimeout);
} | [
"public",
"OkHttpClient",
"createClient",
"(",
"boolean",
"loggingEnabled",
",",
"boolean",
"tls12Enforced",
",",
"int",
"connectTimeout",
",",
"int",
"readTimeout",
",",
"int",
"writeTimeout",
")",
"{",
"return",
"modifyClient",
"(",
"new",
"OkHttpClient",
"(",
"... | This method creates an instance of OKHttpClient according to the provided parameters.
It is used internally and is not intended to be used directly.
@param loggingEnabled Enable logging in the created OkHttpClient.
@param tls12Enforced Enforce TLS 1.2 in the created OkHttpClient on devices with API 16-21
@param conne... | [
"This",
"method",
"creates",
"an",
"instance",
"of",
"OKHttpClient",
"according",
"to",
"the",
"provided",
"parameters",
".",
"It",
"is",
"used",
"internally",
"and",
"is",
"not",
"intended",
"to",
"be",
"used",
"directly",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java#L43-L45 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java | OkHttpClientFactory.enforceTls12 | private void enforceTls12(OkHttpClient client) {
// No need to modify client as TLS 1.2 is enabled by default on API21+
// Lollipop is included because some Samsung devices face the same problem on API 21.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN
|| Build.VERSIO... | java | private void enforceTls12(OkHttpClient client) {
// No need to modify client as TLS 1.2 is enabled by default on API21+
// Lollipop is included because some Samsung devices face the same problem on API 21.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN
|| Build.VERSIO... | [
"private",
"void",
"enforceTls12",
"(",
"OkHttpClient",
"client",
")",
"{",
"// No need to modify client as TLS 1.2 is enabled by default on API21+",
"// Lollipop is included because some Samsung devices face the same problem on API 21.",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK... | Enable TLS 1.2 on the OkHttpClient on API 16-21, which is supported but not enabled by default.
@link https://github.com/square/okhttp/issues/2372
@see TLS12SocketFactory | [
"Enable",
"TLS",
"1",
".",
"2",
"on",
"the",
"OkHttpClient",
"on",
"API",
"16",
"-",
"21",
"which",
"is",
"supported",
"but",
"not",
"enabled",
"by",
"default",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java#L80-L105 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/ParameterBuilder.java | ParameterBuilder.addAll | public ParameterBuilder addAll(Map<String, Object> parameters) {
if (parameters != null) {
for (String k : parameters.keySet()) {
if (parameters.get(k) != null) {
this.parameters.put(k, parameters.get(k));
}
}
}
return t... | java | public ParameterBuilder addAll(Map<String, Object> parameters) {
if (parameters != null) {
for (String k : parameters.keySet()) {
if (parameters.get(k) != null) {
this.parameters.put(k, parameters.get(k));
}
}
}
return t... | [
"public",
"ParameterBuilder",
"addAll",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"if",
"(",
"parameters",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"k",
":",
"parameters",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"("... | Adds all parameter from a map
@param parameters map with parameters to add. Null values will be skipped.
@return itself | [
"Adds",
"all",
"parameter",
"from",
"a",
"map"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/ParameterBuilder.java#L202-L211 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/provider/AuthorizeResult.java | AuthorizeResult.isValid | public boolean isValid(int expectedRequestCode) {
Uri uri = intent != null ? intent.getData() : null;
if (uri == null) {
Log.d(TAG, "Result is invalid: Received Intent's Uri is null.");
return false;
}
if (requestCode == MISSING_REQUEST_CODE) {
return... | java | public boolean isValid(int expectedRequestCode) {
Uri uri = intent != null ? intent.getData() : null;
if (uri == null) {
Log.d(TAG, "Result is invalid: Received Intent's Uri is null.");
return false;
}
if (requestCode == MISSING_REQUEST_CODE) {
return... | [
"public",
"boolean",
"isValid",
"(",
"int",
"expectedRequestCode",
")",
"{",
"Uri",
"uri",
"=",
"intent",
"!=",
"null",
"?",
"intent",
".",
"getData",
"(",
")",
":",
"null",
";",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"Log",
".",
"d",
"(",
"TAG"... | Checks if the received data is valid and can be parsed.
@param expectedRequestCode the request code this activity is expecting to receive
@return whether if the received uri data can be parsed or not. | [
"Checks",
"if",
"the",
"received",
"data",
"is",
"valid",
"and",
"can",
"be",
"parsed",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/AuthorizeResult.java#L71-L87 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java | CredentialsManager.hasValidCredentials | public boolean hasValidCredentials() {
String accessToken = storage.retrieveString(KEY_ACCESS_TOKEN);
String refreshToken = storage.retrieveString(KEY_REFRESH_TOKEN);
String idToken = storage.retrieveString(KEY_ID_TOKEN);
Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT);
re... | java | public boolean hasValidCredentials() {
String accessToken = storage.retrieveString(KEY_ACCESS_TOKEN);
String refreshToken = storage.retrieveString(KEY_REFRESH_TOKEN);
String idToken = storage.retrieveString(KEY_ID_TOKEN);
Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT);
re... | [
"public",
"boolean",
"hasValidCredentials",
"(",
")",
"{",
"String",
"accessToken",
"=",
"storage",
".",
"retrieveString",
"(",
"KEY_ACCESS_TOKEN",
")",
";",
"String",
"refreshToken",
"=",
"storage",
".",
"retrieveString",
"(",
"KEY_REFRESH_TOKEN",
")",
";",
"Stri... | Checks if a non-expired pair of credentials can be obtained from this manager.
@return whether there are valid credentials stored on this manager. | [
"Checks",
"if",
"a",
"non",
"-",
"expired",
"pair",
"of",
"credentials",
"can",
"be",
"obtained",
"from",
"this",
"manager",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java#L108-L117 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java | CredentialsManager.clearCredentials | public void clearCredentials() {
storage.remove(KEY_ACCESS_TOKEN);
storage.remove(KEY_REFRESH_TOKEN);
storage.remove(KEY_ID_TOKEN);
storage.remove(KEY_TOKEN_TYPE);
storage.remove(KEY_EXPIRES_AT);
storage.remove(KEY_SCOPE);
} | java | public void clearCredentials() {
storage.remove(KEY_ACCESS_TOKEN);
storage.remove(KEY_REFRESH_TOKEN);
storage.remove(KEY_ID_TOKEN);
storage.remove(KEY_TOKEN_TYPE);
storage.remove(KEY_EXPIRES_AT);
storage.remove(KEY_SCOPE);
} | [
"public",
"void",
"clearCredentials",
"(",
")",
"{",
"storage",
".",
"remove",
"(",
"KEY_ACCESS_TOKEN",
")",
";",
"storage",
".",
"remove",
"(",
"KEY_REFRESH_TOKEN",
")",
";",
"storage",
".",
"remove",
"(",
"KEY_ID_TOKEN",
")",
";",
"storage",
".",
"remove",... | Removes the credentials from the storage if present. | [
"Removes",
"the",
"credentials",
"from",
"the",
"storage",
"if",
"present",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java#L122-L129 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java | SecureCredentialsManager.clearCredentials | public void clearCredentials() {
storage.remove(KEY_CREDENTIALS);
storage.remove(KEY_EXPIRES_AT);
storage.remove(KEY_CAN_REFRESH);
Log.d(TAG, "Credentials were just removed from the storage");
} | java | public void clearCredentials() {
storage.remove(KEY_CREDENTIALS);
storage.remove(KEY_EXPIRES_AT);
storage.remove(KEY_CAN_REFRESH);
Log.d(TAG, "Credentials were just removed from the storage");
} | [
"public",
"void",
"clearCredentials",
"(",
")",
"{",
"storage",
".",
"remove",
"(",
"KEY_CREDENTIALS",
")",
";",
"storage",
".",
"remove",
"(",
"KEY_EXPIRES_AT",
")",
";",
"storage",
".",
"remove",
"(",
"KEY_CAN_REFRESH",
")",
";",
"Log",
".",
"d",
"(",
... | Delete the stored credentials | [
"Delete",
"the",
"stored",
"credentials"
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java#L195-L200 | train |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java | SecureCredentialsManager.hasValidCredentials | public boolean hasValidCredentials() {
String encryptedEncoded = storage.retrieveString(KEY_CREDENTIALS);
Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT);
Boolean canRefresh = storage.retrieveBoolean(KEY_CAN_REFRESH);
return !(isEmpty(encryptedEncoded) ||
expiresAt ... | java | public boolean hasValidCredentials() {
String encryptedEncoded = storage.retrieveString(KEY_CREDENTIALS);
Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT);
Boolean canRefresh = storage.retrieveBoolean(KEY_CAN_REFRESH);
return !(isEmpty(encryptedEncoded) ||
expiresAt ... | [
"public",
"boolean",
"hasValidCredentials",
"(",
")",
"{",
"String",
"encryptedEncoded",
"=",
"storage",
".",
"retrieveString",
"(",
"KEY_CREDENTIALS",
")",
";",
"Long",
"expiresAt",
"=",
"storage",
".",
"retrieveLong",
"(",
"KEY_EXPIRES_AT",
")",
";",
"Boolean",
... | Returns whether this manager contains a valid non-expired pair of credentials.
@return whether this manager contains a valid non-expired pair of credentials or not. | [
"Returns",
"whether",
"this",
"manager",
"contains",
"a",
"valid",
"non",
"-",
"expired",
"pair",
"of",
"credentials",
"."
] | ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156 | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java#L207-L214 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java | EntryIterator.hasNext | @Override
public boolean hasNext() {
if (!members.hasNext()) {
try {
getNextEntries();
} catch (final Exception ignored) {
LOG.error("An error occured while getting next entries", ignored);
}
}
return members.hasNext();
... | java | @Override
public boolean hasNext() {
if (!members.hasNext()) {
try {
getNextEntries();
} catch (final Exception ignored) {
LOG.error("An error occured while getting next entries", ignored);
}
}
return members.hasNext();
... | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"if",
"(",
"!",
"members",
".",
"hasNext",
"(",
")",
")",
"{",
"try",
"{",
"getNextEntries",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"Exception",
"ignored",
")",
"{",
"LOG",
".",
"e... | Returns true if more entries are available. | [
"Returns",
"true",
"if",
"more",
"entries",
"are",
"available",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java#L61-L71 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java | EntryIterator.next | @Override
public ClientEntry next() {
if (hasNext()) {
final Entry romeEntry = members.next();
try {
if (!romeEntry.isMediaEntry()) {
return new ClientEntry(null, collection, romeEntry, true);
} else {
return new... | java | @Override
public ClientEntry next() {
if (hasNext()) {
final Entry romeEntry = members.next();
try {
if (!romeEntry.isMediaEntry()) {
return new ClientEntry(null, collection, romeEntry, true);
} else {
return new... | [
"@",
"Override",
"public",
"ClientEntry",
"next",
"(",
")",
"{",
"if",
"(",
"hasNext",
"(",
")",
")",
"{",
"final",
"Entry",
"romeEntry",
"=",
"members",
".",
"next",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"romeEntry",
".",
"isMediaEntry",
"(",
... | Get next entry in collection. | [
"Get",
"next",
"entry",
"in",
"collection",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java#L76-L91 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java | ClientCollection.getEntry | public ClientEntry getEntry(final String uri) throws ProponoException {
final GetMethod method = new GetMethod(uri);
authStrategy.addAuthentication(httpClient, method);
try {
httpClient.executeMethod(method);
if (method.getStatusCode() != 200) {
throw new ... | java | public ClientEntry getEntry(final String uri) throws ProponoException {
final GetMethod method = new GetMethod(uri);
authStrategy.addAuthentication(httpClient, method);
try {
httpClient.executeMethod(method);
if (method.getStatusCode() != 200) {
throw new ... | [
"public",
"ClientEntry",
"getEntry",
"(",
"final",
"String",
"uri",
")",
"throws",
"ProponoException",
"{",
"final",
"GetMethod",
"method",
"=",
"new",
"GetMethod",
"(",
"uri",
")",
";",
"authStrategy",
".",
"addAuthentication",
"(",
"httpClient",
",",
"method",... | Get full entry specified by entry edit URI. Note that entry may or may not be associated with
this collection.
@return ClientEntry or ClientMediaEntry specified by URI. | [
"Get",
"full",
"entry",
"specified",
"by",
"entry",
"edit",
"URI",
".",
"Note",
"that",
"entry",
"may",
"or",
"may",
"not",
"be",
"associated",
"with",
"this",
"collection",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L100-L119 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java | ClientCollection.createMediaEntry | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final byte[] bytes) throws ProponoException {
if (!isWritable()) {
throw new ProponoException("Collection is not writable");
}
return new ClientMediaEntry(service, this, title, s... | java | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final byte[] bytes) throws ProponoException {
if (!isWritable()) {
throw new ProponoException("Collection is not writable");
}
return new ClientMediaEntry(service, this, title, s... | [
"public",
"ClientMediaEntry",
"createMediaEntry",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"slug",
",",
"final",
"String",
"contentType",
",",
"final",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"ProponoException",
"{",
"if",
"(",
"!",
"isWritab... | Create new media entry assocaited with collection, but do not save. server. Depending on the
Atom server, you may or may not be able to persist the properties of the entry that is
returned.
@param title Title to used for uploaded file.
@param slug String to be used in file-name of stored file
@param contentType MIME c... | [
"Create",
"new",
"media",
"entry",
"assocaited",
"with",
"collection",
"but",
"do",
"not",
"save",
".",
"server",
".",
"Depending",
"on",
"the",
"Atom",
"server",
"you",
"may",
"or",
"may",
"not",
"be",
"able",
"to",
"persist",
"the",
"properties",
"of",
... | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L158-L163 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java | ClientCollection.createMediaEntry | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final InputStream is) throws ProponoException {
if (!isWritable()) {
throw new ProponoException("Collection is not writable");
}
return new ClientMediaEntry(service, this, title,... | java | public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final InputStream is) throws ProponoException {
if (!isWritable()) {
throw new ProponoException("Collection is not writable");
}
return new ClientMediaEntry(service, this, title,... | [
"public",
"ClientMediaEntry",
"createMediaEntry",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"slug",
",",
"final",
"String",
"contentType",
",",
"final",
"InputStream",
"is",
")",
"throws",
"ProponoException",
"{",
"if",
"(",
"!",
"isWritable",
"("... | Create new media entry assocaited with collection, but do not save. server. Depending on the
Atom server, you may or may not be able to. persist the properties of the entry that is
returned.
@param title Title to used for uploaded file.
@param slug String to be used in file-name of stored file
@param contentType MIME ... | [
"Create",
"new",
"media",
"entry",
"assocaited",
"with",
"collection",
"but",
"do",
"not",
"save",
".",
"server",
".",
"Depending",
"on",
"the",
"Atom",
"server",
"you",
"may",
"or",
"may",
"not",
"be",
"able",
"to",
".",
"persist",
"the",
"properties",
... | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L176-L181 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/rome/AppModuleParser.java | AppModuleParser.parse | @Override
public Module parse(final Element elem, final Locale locale) {
final AppModule m = new AppModuleImpl();
final Element control = elem.getChild("control", getContentNamespace());
if (control != null) {
final Element draftElem = control.getChild("draft", getContentNamespac... | java | @Override
public Module parse(final Element elem, final Locale locale) {
final AppModule m = new AppModuleImpl();
final Element control = elem.getChild("control", getContentNamespace());
if (control != null) {
final Element draftElem = control.getChild("draft", getContentNamespac... | [
"@",
"Override",
"public",
"Module",
"parse",
"(",
"final",
"Element",
"elem",
",",
"final",
"Locale",
"locale",
")",
"{",
"final",
"AppModule",
"m",
"=",
"new",
"AppModuleImpl",
"(",
")",
";",
"final",
"Element",
"control",
"=",
"elem",
".",
"getChild",
... | Parse JDOM element into module | [
"Parse",
"JDOM",
"element",
"into",
"module"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/rome/AppModuleParser.java#L51-L74 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java | ClientMediaEntry.getAsStream | public InputStream getAsStream() throws ProponoException {
if (getContents() != null && !getContents().isEmpty()) {
final Content c = getContents().get(0);
if (c.getSrc() != null) {
return getResourceAsStream();
} else if (inputStream != null) {
... | java | public InputStream getAsStream() throws ProponoException {
if (getContents() != null && !getContents().isEmpty()) {
final Content c = getContents().get(0);
if (c.getSrc() != null) {
return getResourceAsStream();
} else if (inputStream != null) {
... | [
"public",
"InputStream",
"getAsStream",
"(",
")",
"throws",
"ProponoException",
"{",
"if",
"(",
"getContents",
"(",
")",
"!=",
"null",
"&&",
"!",
"getContents",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"Content",
"c",
"=",
"getContents",
"(... | Get media resource as an InputStream, should work regardless of whether you set the media
resource data as an InputStream or as a byte array. | [
"Get",
"media",
"resource",
"as",
"an",
"InputStream",
"should",
"work",
"regardless",
"of",
"whether",
"you",
"set",
"the",
"media",
"resource",
"data",
"as",
"an",
"InputStream",
"or",
"as",
"a",
"byte",
"array",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java#L162-L177 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java | ClientMediaEntry.update | @Override
public void update() throws ProponoException {
if (partial) {
throw new ProponoException("ERROR: attempt to update partial entry");
}
EntityEnclosingMethod method = null;
final Content updateContent = getContents().get(0);
try {
if (getMediaL... | java | @Override
public void update() throws ProponoException {
if (partial) {
throw new ProponoException("ERROR: attempt to update partial entry");
}
EntityEnclosingMethod method = null;
final Content updateContent = getContents().get(0);
try {
if (getMediaL... | [
"@",
"Override",
"public",
"void",
"update",
"(",
")",
"throws",
"ProponoException",
"{",
"if",
"(",
"partial",
")",
"{",
"throw",
"new",
"ProponoException",
"(",
"\"ERROR: attempt to update partial entry\"",
")",
";",
"}",
"EntityEnclosingMethod",
"method",
"=",
... | Update entry on server. | [
"Update",
"entry",
"on",
"server",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java#L198-L243 | train |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/hub/DeltaSyndFeedInfo.java | DeltaSyndFeedInfo.setSyndFeed | @Override
public final synchronized void setSyndFeed(final SyndFeed feed) {
super.setSyndFeed(feed);
changedMap.clear();
final List<SyndEntry> entries = feed.getEntries();
for (final SyndEntry entry : entries) {
final String currentEntryTag = computeEntryTag(entry);
... | java | @Override
public final synchronized void setSyndFeed(final SyndFeed feed) {
super.setSyndFeed(feed);
changedMap.clear();
final List<SyndEntry> entries = feed.getEntries();
for (final SyndEntry entry : entries) {
final String currentEntryTag = computeEntryTag(entry);
... | [
"@",
"Override",
"public",
"final",
"synchronized",
"void",
"setSyndFeed",
"(",
"final",
"SyndFeed",
"feed",
")",
"{",
"super",
".",
"setSyndFeed",
"(",
"feed",
")",
";",
"changedMap",
".",
"clear",
"(",
")",
";",
"final",
"List",
"<",
"SyndEntry",
">",
... | Overrides super class method to update changedMap and entryTagsMap for tracking changed
entries.
@param feed | [
"Overrides",
"super",
"class",
"method",
"to",
"update",
"changedMap",
"and",
"entryTagsMap",
"for",
"tracking",
"changed",
"entries",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/hub/DeltaSyndFeedInfo.java#L91-L107 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java | ClientEntry.setContent | public void setContent(final String contentString, final String type) {
final Content newContent = new Content();
newContent.setType(type == null ? Content.HTML : type);
newContent.setValue(contentString);
final ArrayList<Content> contents = new ArrayList<Content>();
contents.add... | java | public void setContent(final String contentString, final String type) {
final Content newContent = new Content();
newContent.setType(type == null ? Content.HTML : type);
newContent.setValue(contentString);
final ArrayList<Content> contents = new ArrayList<Content>();
contents.add... | [
"public",
"void",
"setContent",
"(",
"final",
"String",
"contentString",
",",
"final",
"String",
"type",
")",
"{",
"final",
"Content",
"newContent",
"=",
"new",
"Content",
"(",
")",
";",
"newContent",
".",
"setType",
"(",
"type",
"==",
"null",
"?",
"Conten... | Set content of entry.
@param contentString content string.
@param type Must be "text" for plain text, "html" for escaped HTML, "xhtml" for XHTML or a
valid MIME content-type. | [
"Set",
"content",
"of",
"entry",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L87-L94 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java | ClientEntry.setContent | public void setContent(final Content c) {
final ArrayList<Content> contents = new ArrayList<Content>();
contents.add(c);
setContents(contents);
} | java | public void setContent(final Content c) {
final ArrayList<Content> contents = new ArrayList<Content>();
contents.add(c);
setContents(contents);
} | [
"public",
"void",
"setContent",
"(",
"final",
"Content",
"c",
")",
"{",
"final",
"ArrayList",
"<",
"Content",
">",
"contents",
"=",
"new",
"ArrayList",
"<",
"Content",
">",
"(",
")",
";",
"contents",
".",
"add",
"(",
"c",
")",
";",
"setContents",
"(",
... | Convenience method to set first content object in content collection. Atom 1.0 allows only
one content element per entry. | [
"Convenience",
"method",
"to",
"set",
"first",
"content",
"object",
"in",
"content",
"collection",
".",
"Atom",
"1",
".",
"0",
"allows",
"only",
"one",
"content",
"element",
"per",
"entry",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L100-L104 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java | ClientEntry.getContent | public Content getContent() {
if (getContents() != null && !getContents().isEmpty()) {
final Content c = getContents().get(0);
return c;
}
return null;
} | java | public Content getContent() {
if (getContents() != null && !getContents().isEmpty()) {
final Content c = getContents().get(0);
return c;
}
return null;
} | [
"public",
"Content",
"getContent",
"(",
")",
"{",
"if",
"(",
"getContents",
"(",
")",
"!=",
"null",
"&&",
"!",
"getContents",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"Content",
"c",
"=",
"getContents",
"(",
")",
".",
"get",
"(",
"0",... | Convenience method to get first content object in content collection. Atom 1.0 allows only
one content element per entry. | [
"Convenience",
"method",
"to",
"get",
"first",
"content",
"object",
"in",
"content",
"collection",
".",
"Atom",
"1",
".",
"0",
"allows",
"only",
"one",
"content",
"element",
"per",
"entry",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L110-L116 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java | ClientEntry.remove | public void remove() throws ProponoException {
if (getEditURI() == null) {
throw new ProponoException("ERROR: cannot delete unsaved entry");
}
final DeleteMethod method = new DeleteMethod(getEditURI());
addAuthentication(method);
try {
getHttpClient().exec... | java | public void remove() throws ProponoException {
if (getEditURI() == null) {
throw new ProponoException("ERROR: cannot delete unsaved entry");
}
final DeleteMethod method = new DeleteMethod(getEditURI());
addAuthentication(method);
try {
getHttpClient().exec... | [
"public",
"void",
"remove",
"(",
")",
"throws",
"ProponoException",
"{",
"if",
"(",
"getEditURI",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"ProponoException",
"(",
"\"ERROR: cannot delete unsaved entry\"",
")",
";",
"}",
"final",
"DeleteMethod",
"method... | Remove entry from server. | [
"Remove",
"entry",
"from",
"server",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L171-L184 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java | ClientEntry.getEditURI | public String getEditURI() {
for (int i = 0; i < getOtherLinks().size(); i++) {
final Link link = getOtherLinks().get(i);
if (link.getRel() != null && link.getRel().equals("edit")) {
return link.getHrefResolved();
}
}
return null;
} | java | public String getEditURI() {
for (int i = 0; i < getOtherLinks().size(); i++) {
final Link link = getOtherLinks().get(i);
if (link.getRel() != null && link.getRel().equals("edit")) {
return link.getHrefResolved();
}
}
return null;
} | [
"public",
"String",
"getEditURI",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getOtherLinks",
"(",
")",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"final",
"Link",
"link",
"=",
"getOtherLinks",
"(",
")",
".",
"get",
"... | Get the URI that can be used to edit the entry via HTTP PUT or DELETE. | [
"Get",
"the",
"URI",
"that",
"can",
"be",
"used",
"to",
"edit",
"the",
"entry",
"via",
"HTTP",
"PUT",
"or",
"DELETE",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L197-L205 | train |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/mediarss/types/MediaGroup.java | MediaGroup.setDefaultContentIndex | public void setDefaultContentIndex(final Integer defaultContentIndex) {
for (int i = 0; i < getContents().length; i++) {
if (i == defaultContentIndex.intValue()) {
getContents()[i].setDefaultContent(true);
} else {
getContents()[i].setDefaultContent(false)... | java | public void setDefaultContentIndex(final Integer defaultContentIndex) {
for (int i = 0; i < getContents().length; i++) {
if (i == defaultContentIndex.intValue()) {
getContents()[i].setDefaultContent(true);
} else {
getContents()[i].setDefaultContent(false)... | [
"public",
"void",
"setDefaultContentIndex",
"(",
"final",
"Integer",
"defaultContentIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getContents",
"(",
")",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
"==",
"defaultConte... | Default content index MediaContent.
@param defaultContentIndex Default content index MediaContent. | [
"Default",
"content",
"index",
"MediaContent",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/mediarss/types/MediaGroup.java#L97-L107 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java | Workspace.workspaceToElement | public Element workspaceToElement() {
final Workspace space = this;
final Element element = new Element("workspace", AtomService.ATOM_PROTOCOL);
final Element titleElem = new Element("title", AtomService.ATOM_FORMAT);
titleElem.setText(space.getTitle());
if (space.getTitleType(... | java | public Element workspaceToElement() {
final Workspace space = this;
final Element element = new Element("workspace", AtomService.ATOM_PROTOCOL);
final Element titleElem = new Element("title", AtomService.ATOM_FORMAT);
titleElem.setText(space.getTitle());
if (space.getTitleType(... | [
"public",
"Element",
"workspaceToElement",
"(",
")",
"{",
"final",
"Workspace",
"space",
"=",
"this",
";",
"final",
"Element",
"element",
"=",
"new",
"Element",
"(",
"\"workspace\"",
",",
"AtomService",
".",
"ATOM_PROTOCOL",
")",
";",
"final",
"Element",
"titl... | Serialize an AtomService.DefaultWorkspace object into an XML element | [
"Serialize",
"an",
"AtomService",
".",
"DefaultWorkspace",
"object",
"into",
"an",
"XML",
"element"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java#L119-L136 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java | Workspace.parseWorkspaceElement | protected void parseWorkspaceElement(final Element element) throws ProponoException {
final Element titleElem = element.getChild("title", AtomService.ATOM_FORMAT);
setTitle(titleElem.getText());
if (titleElem.getAttribute("type", AtomService.ATOM_FORMAT) != null) {
setTitleType(title... | java | protected void parseWorkspaceElement(final Element element) throws ProponoException {
final Element titleElem = element.getChild("title", AtomService.ATOM_FORMAT);
setTitle(titleElem.getText());
if (titleElem.getAttribute("type", AtomService.ATOM_FORMAT) != null) {
setTitleType(title... | [
"protected",
"void",
"parseWorkspaceElement",
"(",
"final",
"Element",
"element",
")",
"throws",
"ProponoException",
"{",
"final",
"Element",
"titleElem",
"=",
"element",
".",
"getChild",
"(",
"\"title\"",
",",
"AtomService",
".",
"ATOM_FORMAT",
")",
";",
"setTitl... | Deserialize a Atom workspace XML element into an object | [
"Deserialize",
"a",
"Atom",
"workspace",
"XML",
"element",
"into",
"an",
"object"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java#L139-L149 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/AtomService.java | AtomService.findWorkspace | public Workspace findWorkspace(final String title) {
for (final Object element : workspaces) {
final Workspace ws = (Workspace) element;
if (title.equals(ws.getTitle())) {
return ws;
}
}
return null;
} | java | public Workspace findWorkspace(final String title) {
for (final Object element : workspaces) {
final Workspace ws = (Workspace) element;
if (title.equals(ws.getTitle())) {
return ws;
}
}
return null;
} | [
"public",
"Workspace",
"findWorkspace",
"(",
"final",
"String",
"title",
")",
"{",
"for",
"(",
"final",
"Object",
"element",
":",
"workspaces",
")",
"{",
"final",
"Workspace",
"ws",
"=",
"(",
"Workspace",
")",
"element",
";",
"if",
"(",
"title",
".",
"eq... | Find workspace by title.
@param title Match this title
@return Matching Workspace or null if none found. | [
"Find",
"workspace",
"by",
"title",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/AtomService.java#L79-L87 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/AtomService.java | AtomService.serviceToDocument | public Document serviceToDocument() {
final AtomService service = this;
final Document doc = new Document();
final Element root = new Element("service", ATOM_PROTOCOL);
doc.setRootElement(root);
final List<Workspace> spaces = service.getWorkspaces();
for (final Workspace... | java | public Document serviceToDocument() {
final AtomService service = this;
final Document doc = new Document();
final Element root = new Element("service", ATOM_PROTOCOL);
doc.setRootElement(root);
final List<Workspace> spaces = service.getWorkspaces();
for (final Workspace... | [
"public",
"Document",
"serviceToDocument",
"(",
")",
"{",
"final",
"AtomService",
"service",
"=",
"this",
";",
"final",
"Document",
"doc",
"=",
"new",
"Document",
"(",
")",
";",
"final",
"Element",
"root",
"=",
"new",
"Element",
"(",
"\"service\"",
",",
"A... | Serialize an AtomService object into an XML document | [
"Serialize",
"an",
"AtomService",
"object",
"into",
"an",
"XML",
"document"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/AtomService.java#L105-L116 | train |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/sle/SortableList.java | SortableList.sortOnProperty | public synchronized void sortOnProperty(final Object value, final boolean ascending, final ValueStrategy strategy) {
final int elementCount = size();
for (int i = 0; i < elementCount - 1; i++) {
for (int j = i + 1; j < elementCount; j++) {
final T entry1 = get(i);
... | java | public synchronized void sortOnProperty(final Object value, final boolean ascending, final ValueStrategy strategy) {
final int elementCount = size();
for (int i = 0; i < elementCount - 1; i++) {
for (int j = i + 1; j < elementCount; j++) {
final T entry1 = get(i);
... | [
"public",
"synchronized",
"void",
"sortOnProperty",
"(",
"final",
"Object",
"value",
",",
"final",
"boolean",
"ascending",
",",
"final",
"ValueStrategy",
"strategy",
")",
"{",
"final",
"int",
"elementCount",
"=",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i"... | performs a selection sort on all the beans in the List | [
"performs",
"a",
"selection",
"sort",
"on",
"all",
"the",
"beans",
"in",
"the",
"List"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/sle/SortableList.java#L34-L68 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/blogclient/metaweblog/MetaWeblogResource.java | MetaWeblogResource.getAsStream | @Override
public InputStream getAsStream() throws BlogClientException {
final HttpClient httpClient = new HttpClient();
final GetMethod method = new GetMethod(permalink);
try {
httpClient.executeMethod(method);
} catch (final Exception e) {
throw new BlogClien... | java | @Override
public InputStream getAsStream() throws BlogClientException {
final HttpClient httpClient = new HttpClient();
final GetMethod method = new GetMethod(permalink);
try {
httpClient.executeMethod(method);
} catch (final Exception e) {
throw new BlogClien... | [
"@",
"Override",
"public",
"InputStream",
"getAsStream",
"(",
")",
"throws",
"BlogClientException",
"{",
"final",
"HttpClient",
"httpClient",
"=",
"new",
"HttpClient",
"(",
")",
";",
"final",
"GetMethod",
"method",
"=",
"new",
"GetMethod",
"(",
"permalink",
")",... | Get media resource as input stream. | [
"Get",
"media",
"resource",
"as",
"input",
"stream",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/blogclient/metaweblog/MetaWeblogResource.java#L75-L92 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/WireFeedInput.java | WireFeedInput.createSAXBuilder | protected SAXBuilder createSAXBuilder() {
SAXBuilder saxBuilder;
if (validate) {
saxBuilder = new SAXBuilder(XMLReaders.DTDVALIDATING);
} else {
saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING);
}
saxBuilder.setEntityResolver(RESOLVER);
//
... | java | protected SAXBuilder createSAXBuilder() {
SAXBuilder saxBuilder;
if (validate) {
saxBuilder = new SAXBuilder(XMLReaders.DTDVALIDATING);
} else {
saxBuilder = new SAXBuilder(XMLReaders.NONVALIDATING);
}
saxBuilder.setEntityResolver(RESOLVER);
//
... | [
"protected",
"SAXBuilder",
"createSAXBuilder",
"(",
")",
"{",
"SAXBuilder",
"saxBuilder",
";",
"if",
"(",
"validate",
")",
"{",
"saxBuilder",
"=",
"new",
"SAXBuilder",
"(",
"XMLReaders",
".",
"DTDVALIDATING",
")",
";",
"}",
"else",
"{",
"saxBuilder",
"=",
"n... | Creates and sets up a org.jdom2.input.SAXBuilder for parsing.
@return a new org.jdom2.input.SAXBuilder object | [
"Creates",
"and",
"sets",
"up",
"a",
"org",
".",
"jdom2",
".",
"input",
".",
"SAXBuilder",
"for",
"parsing",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/WireFeedInput.java#L322-L365 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/utils/ProponoException.java | ProponoException.getRootCauseMessage | public String getRootCauseMessage() {
String rcmessage = null;
if (getRootCause() != null) {
if (getRootCause().getCause() != null) {
rcmessage = getRootCause().getCause().getMessage();
}
rcmessage = rcmessage == null ? getRootCause().getMessage() : rc... | java | public String getRootCauseMessage() {
String rcmessage = null;
if (getRootCause() != null) {
if (getRootCause().getCause() != null) {
rcmessage = getRootCause().getCause().getMessage();
}
rcmessage = rcmessage == null ? getRootCause().getMessage() : rc... | [
"public",
"String",
"getRootCauseMessage",
"(",
")",
"{",
"String",
"rcmessage",
"=",
"null",
";",
"if",
"(",
"getRootCause",
"(",
")",
"!=",
"null",
")",
"{",
"if",
"(",
"getRootCause",
"(",
")",
".",
"getCause",
"(",
")",
"!=",
"null",
")",
"{",
"r... | Get root cause message.
@return Root cause message. | [
"Get",
"root",
"cause",
"message",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/utils/ProponoException.java#L102-L113 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/common/Categories.java | Categories.getHrefResolved | public String getHrefResolved() {
if (Atom10Parser.isAbsoluteURI(href)) {
return href;
} else if (baseURI != null && categoriesElement != null) {
return Atom10Parser.resolveURI(baseURI, categoriesElement, href);
}
return null;
} | java | public String getHrefResolved() {
if (Atom10Parser.isAbsoluteURI(href)) {
return href;
} else if (baseURI != null && categoriesElement != null) {
return Atom10Parser.resolveURI(baseURI, categoriesElement, href);
}
return null;
} | [
"public",
"String",
"getHrefResolved",
"(",
")",
"{",
"if",
"(",
"Atom10Parser",
".",
"isAbsoluteURI",
"(",
"href",
")",
")",
"{",
"return",
"href",
";",
"}",
"else",
"if",
"(",
"baseURI",
"!=",
"null",
"&&",
"categoriesElement",
"!=",
"null",
")",
"{",
... | Get unresolved URI of the collection, or null if impossible to determine | [
"Get",
"unresolved",
"URI",
"of",
"the",
"collection",
"or",
"null",
"if",
"impossible",
"to",
"determine"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/Categories.java#L99-L106 | train |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Lists.java | Lists.createWhenNull | public static <T> List<T> createWhenNull(final List<T> list) {
if (list == null) {
return new ArrayList<T>();
} else {
return list;
}
} | java | public static <T> List<T> createWhenNull(final List<T> list) {
if (list == null) {
return new ArrayList<T>();
} else {
return list;
}
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"createWhenNull",
"(",
"final",
"List",
"<",
"T",
">",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"}",
"else... | Returns the list when it is not null. Returns a new list otherwise.
@param list The list to process, can be null
@return The input list when it is not null, a new list otherwise | [
"Returns",
"the",
"list",
"when",
"it",
"is",
"not",
"null",
".",
"Returns",
"a",
"new",
"list",
"otherwise",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Lists.java#L31-L37 | train |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Lists.java | Lists.create | public static <T> List<T> create(final T item) {
final List<T> list = new ArrayList<T>();
list.add(item);
return list;
} | java | public static <T> List<T> create(final T item) {
final List<T> list = new ArrayList<T>();
list.add(item);
return list;
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"create",
"(",
"final",
"T",
"item",
")",
"{",
"final",
"List",
"<",
"T",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"list",
".",
"add",
"(",
"item",
")",
";",... | Creates a new List with the given item as the first entry.
@param item The item to add to the new list
@return List containing the given item | [
"Creates",
"a",
"new",
"List",
"with",
"the",
"given",
"item",
"as",
"the",
"first",
"entry",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Lists.java#L45-L49 | train |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Lists.java | Lists.firstEntry | public static <T> T firstEntry(final List<T> list) {
if (list != null && !list.isEmpty()) {
return list.get(0);
} else {
return null;
}
} | java | public static <T> T firstEntry(final List<T> list) {
if (list != null && !list.isEmpty()) {
return list.get(0);
} else {
return null;
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"firstEntry",
"(",
"final",
"List",
"<",
"T",
">",
"list",
")",
"{",
"if",
"(",
"list",
"!=",
"null",
"&&",
"!",
"list",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"list",
".",
"get",
"(",
"0",
")",
... | Extracts the first entry of the list when it is not null and contains values.
@param list The list to extract the first entry from, can be null
@return The first entry of the list when it is not null or empty, null otherwise | [
"Extracts",
"the",
"first",
"entry",
"of",
"the",
"list",
"when",
"it",
"is",
"not",
"null",
"and",
"contains",
"values",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Lists.java#L57-L63 | train |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Lists.java | Lists.sizeIs | public static boolean sizeIs(final List<?> list, final int size) {
if (size == 0) {
return list == null || list.isEmpty();
} else {
return list != null && list.size() == size;
}
} | java | public static boolean sizeIs(final List<?> list, final int size) {
if (size == 0) {
return list == null || list.isEmpty();
} else {
return list != null && list.size() == size;
}
} | [
"public",
"static",
"boolean",
"sizeIs",
"(",
"final",
"List",
"<",
"?",
">",
"list",
",",
"final",
"int",
"size",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"list",
"==",
"null",
"||",
"list",
".",
"isEmpty",
"(",
")",
";",
"}",... | Checks whether the list has the given size. A null list is treated like a list without
entries.
@param list The list to check
@param size The size to check
@return true when the list has the given size or when size = 0 and the list is null, false
otherwise | [
"Checks",
"whether",
"the",
"list",
"has",
"the",
"given",
"size",
".",
"A",
"null",
"list",
"is",
"treated",
"like",
"a",
"list",
"without",
"entries",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Lists.java#L94-L100 | train |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Lists.java | Lists.emptyToNull | public static <T> List<T> emptyToNull(final List<T> list) {
if (isEmpty(list)) {
return null;
} else {
return list;
}
} | java | public static <T> List<T> emptyToNull(final List<T> list) {
if (isEmpty(list)) {
return null;
} else {
return list;
}
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"emptyToNull",
"(",
"final",
"List",
"<",
"T",
">",
"list",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"list",
")",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"list",
";",
"}... | Returns null, when the given list is empty or null
@param list The list to process
@return null when the list is empty or null, the given list otherwise | [
"Returns",
"null",
"when",
"the",
"given",
"list",
"is",
"empty",
"or",
"null"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Lists.java#L108-L114 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java | NumberParser.parseLong | public static Long parseLong(final String str) {
if (null != str) {
try {
return new Long(Long.parseLong(str.trim()));
} catch (final Exception e) {
// :IGNORE:
}
}
return null;
} | java | public static Long parseLong(final String str) {
if (null != str) {
try {
return new Long(Long.parseLong(str.trim()));
} catch (final Exception e) {
// :IGNORE:
}
}
return null;
} | [
"public",
"static",
"Long",
"parseLong",
"(",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"null",
"!=",
"str",
")",
"{",
"try",
"{",
"return",
"new",
"Long",
"(",
"Long",
".",
"parseLong",
"(",
"str",
".",
"trim",
"(",
")",
")",
")",
";",
"}",... | Parses a Long out of a string.
@param str string to parse for a Long.
@return the Long represented by the given string, It returns <b>null</b> if it was not
possible to parse the the string. | [
"Parses",
"a",
"Long",
"out",
"of",
"a",
"string",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java#L42-L51 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java | NumberParser.parseFloat | public static Float parseFloat(final String str) {
if (null != str) {
try {
return new Float(Float.parseFloat(str.trim()));
} catch (final Exception e) {
// :IGNORE:
}
}
return null;
} | java | public static Float parseFloat(final String str) {
if (null != str) {
try {
return new Float(Float.parseFloat(str.trim()));
} catch (final Exception e) {
// :IGNORE:
}
}
return null;
} | [
"public",
"static",
"Float",
"parseFloat",
"(",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"null",
"!=",
"str",
")",
"{",
"try",
"{",
"return",
"new",
"Float",
"(",
"Float",
".",
"parseFloat",
"(",
"str",
".",
"trim",
"(",
")",
")",
")",
";",
... | Parse a Float from a String without exceptions. If the String is not a Float then null is
returned
@param str the String to parse
@return The Float represented by the String, or null if it could not be parsed. | [
"Parse",
"a",
"Float",
"from",
"a",
"String",
"without",
"exceptions",
".",
"If",
"the",
"String",
"is",
"not",
"a",
"Float",
"then",
"null",
"is",
"returned"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java#L78-L87 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java | NumberParser.parseFloat | public static float parseFloat(final String str, final float def) {
final Float result = parseFloat(str);
if (result == null) {
return def;
} else {
return result.floatValue();
}
} | java | public static float parseFloat(final String str, final float def) {
final Float result = parseFloat(str);
if (result == null) {
return def;
} else {
return result.floatValue();
}
} | [
"public",
"static",
"float",
"parseFloat",
"(",
"final",
"String",
"str",
",",
"final",
"float",
"def",
")",
"{",
"final",
"Float",
"result",
"=",
"parseFloat",
"(",
"str",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"def",
";",
... | Parse a float from a String, with a default value
@param str
@param def the value to return if the String cannot be parsed | [
"Parse",
"a",
"float",
"from",
"a",
"String",
"with",
"a",
"default",
"value"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java#L95-L102 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java | NumberParser.parseLong | public static long parseLong(final String str, final long def) {
final Long ret = parseLong(str);
if (ret == null) {
return def;
} else {
return ret.longValue();
}
} | java | public static long parseLong(final String str, final long def) {
final Long ret = parseLong(str);
if (ret == null) {
return def;
} else {
return ret.longValue();
}
} | [
"public",
"static",
"long",
"parseLong",
"(",
"final",
"String",
"str",
",",
"final",
"long",
"def",
")",
"{",
"final",
"Long",
"ret",
"=",
"parseLong",
"(",
"str",
")",
";",
"if",
"(",
"ret",
"==",
"null",
")",
"{",
"return",
"def",
";",
"}",
"els... | Parses a long out of a string.
@param str string to parse for a long.
@param def default value to return if it is not possible to parse the the string.
@return the long represented by the given string, or the default. | [
"Parses",
"a",
"long",
"out",
"of",
"a",
"string",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/NumberParser.java#L111-L118 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/PropertiesLoader.java | PropertiesLoader.getPropertiesLoader | public static PropertiesLoader getPropertiesLoader() {
synchronized (PropertiesLoader.class) {
final ClassLoader classLoader = ConfigurableClassLoader.INSTANCE.getClassLoader();
PropertiesLoader loader = clMap.get(classLoader);
if (loader == null) {
try {
loader = new PropertiesLoader(MASTER_PLUGIN_... | java | public static PropertiesLoader getPropertiesLoader() {
synchronized (PropertiesLoader.class) {
final ClassLoader classLoader = ConfigurableClassLoader.INSTANCE.getClassLoader();
PropertiesLoader loader = clMap.get(classLoader);
if (loader == null) {
try {
loader = new PropertiesLoader(MASTER_PLUGIN_... | [
"public",
"static",
"PropertiesLoader",
"getPropertiesLoader",
"(",
")",
"{",
"synchronized",
"(",
"PropertiesLoader",
".",
"class",
")",
"{",
"final",
"ClassLoader",
"classLoader",
"=",
"ConfigurableClassLoader",
".",
"INSTANCE",
".",
"getClassLoader",
"(",
")",
";... | Returns the PropertiesLoader singleton used by ROME to load plugin
components.
@return PropertiesLoader singleton. | [
"Returns",
"the",
"PropertiesLoader",
"singleton",
"used",
"by",
"ROME",
"to",
"load",
"plugin",
"components",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/PropertiesLoader.java#L57-L71 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/Atom10Generator.java | Atom10Generator.serializeEntry | public static void serializeEntry(final Entry entry, final Writer writer) throws IllegalArgumentException, FeedException, IOException {
// Build a feed containing only the entry
final List<Entry> entries = new ArrayList<Entry>();
entries.add(entry);
final Feed feed1 = new Feed();
... | java | public static void serializeEntry(final Entry entry, final Writer writer) throws IllegalArgumentException, FeedException, IOException {
// Build a feed containing only the entry
final List<Entry> entries = new ArrayList<Entry>();
entries.add(entry);
final Feed feed1 = new Feed();
... | [
"public",
"static",
"void",
"serializeEntry",
"(",
"final",
"Entry",
"entry",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IllegalArgumentException",
",",
"FeedException",
",",
"IOException",
"{",
"// Build a feed containing only the entry",
"final",
"List",
"<",
... | Utility method to serialize an entry to writer. | [
"Utility",
"method",
"to",
"serialize",
"an",
"entry",
"to",
"writer",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/Atom10Generator.java#L541-L559 | train |
rometools/rome | rome-fetcher/src/main/java/com/rometools/fetcher/impl/HttpURLFeedFetcher.java | HttpURLFeedFetcher.retrieveFeed | @Override
public SyndFeed retrieveFeed(final String userAgent, final URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException {
if (feedUrl == null) {
throw new IllegalArgumentException("null is not a valid URL");
}
final URLConnection connectio... | java | @Override
public SyndFeed retrieveFeed(final String userAgent, final URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException {
if (feedUrl == null) {
throw new IllegalArgumentException("null is not a valid URL");
}
final URLConnection connectio... | [
"@",
"Override",
"public",
"SyndFeed",
"retrieveFeed",
"(",
"final",
"String",
"userAgent",
",",
"final",
"URL",
"feedUrl",
")",
"throws",
"IllegalArgumentException",
",",
"IOException",
",",
"FeedException",
",",
"FetcherException",
"{",
"if",
"(",
"feedUrl",
"==... | Retrieve a feed over HTTP
@param feedUrl A non-null URL of a RSS/Atom feed to retrieve
@return A {@link com.rometools.rome.feed.synd.SyndFeed} object
@throws IllegalArgumentException if the URL is null;
@throws IOException if a TCP error occurs
@throws FeedException if the feed is not valid
@throws FetcherException if... | [
"Retrieve",
"a",
"feed",
"over",
"HTTP"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-fetcher/src/main/java/com/rometools/fetcher/impl/HttpURLFeedFetcher.java#L118-L184 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/FactoryFinder.java | FactoryFinder.newInstance | private static Object newInstance(final String className, ClassLoader cl, final boolean doFallback) throws ConfigurationError {
try {
Class<?> providerClass;
if (cl == null) {
// If classloader is null Use the bootstrap ClassLoader.
// Thus Class.forName(... | java | private static Object newInstance(final String className, ClassLoader cl, final boolean doFallback) throws ConfigurationError {
try {
Class<?> providerClass;
if (cl == null) {
// If classloader is null Use the bootstrap ClassLoader.
// Thus Class.forName(... | [
"private",
"static",
"Object",
"newInstance",
"(",
"final",
"String",
"className",
",",
"ClassLoader",
"cl",
",",
"final",
"boolean",
"doFallback",
")",
"throws",
"ConfigurationError",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"providerClass",
";",
"if",
"(",
... | Create an instance of a class using the specified ClassLoader and optionally fall back to the
current ClassLoader if not found.
@param className Name of the concrete class corresponding to the service provider
@param cl ClassLoader to use to load the class, null means to use the bootstrap ClassLoader
@param doFallba... | [
"Create",
"an",
"instance",
"of",
"a",
"class",
"using",
"the",
"specified",
"ClassLoader",
"and",
"optionally",
"fall",
"back",
"to",
"the",
"current",
"ClassLoader",
"if",
"not",
"found",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/FactoryFinder.java#L58-L89 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/FactoryFinder.java | FactoryFinder.find | static Object find(final String factoryId, final String fallbackClassName) throws ConfigurationError {
// Figure out which ClassLoader to use for loading the provider
// class. If there is a Context ClassLoader then use it.
ClassLoader classLoader = ss.getContextClassLoader();
if (cla... | java | static Object find(final String factoryId, final String fallbackClassName) throws ConfigurationError {
// Figure out which ClassLoader to use for loading the provider
// class. If there is a Context ClassLoader then use it.
ClassLoader classLoader = ss.getContextClassLoader();
if (cla... | [
"static",
"Object",
"find",
"(",
"final",
"String",
"factoryId",
",",
"final",
"String",
"fallbackClassName",
")",
"throws",
"ConfigurationError",
"{",
"// Figure out which ClassLoader to use for loading the provider",
"// class. If there is a Context ClassLoader then use it.",
"Cl... | Finds the implementation Class object in the specified order. Main entry point.
@return Class object of factory, never null
@param factoryId Name of the factory to find, same as a property name
@param fallbackClassName Implementation class name, if nothing else is found. Use null to
mean no fallback.
Package private... | [
"Finds",
"the",
"implementation",
"Class",
"object",
"in",
"the",
"specified",
"order",
".",
"Main",
"entry",
"point",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/FactoryFinder.java#L102-L171 | train |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Doubles.java | Doubles.parse | public static Double parse(final String s) {
Double parsed = null;
try {
if (s != null) {
parsed = Double.parseDouble(s);
}
} catch (final NumberFormatException e) {
}
return parsed;
} | java | public static Double parse(final String s) {
Double parsed = null;
try {
if (s != null) {
parsed = Double.parseDouble(s);
}
} catch (final NumberFormatException e) {
}
return parsed;
} | [
"public",
"static",
"Double",
"parse",
"(",
"final",
"String",
"s",
")",
"{",
"Double",
"parsed",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"parsed",
"=",
"Double",
".",
"parseDouble",
"(",
"s",
")",
";",
"}",
"}",
"ca... | Converts a String into an Double.
@param s The String to convert, may be null
@return The parsed Double or null when parsing is not possible | [
"Converts",
"a",
"String",
"into",
"an",
"Double",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Doubles.java#L28-L37 | train |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/base/types/PriceTypeEnumeration.java | PriceTypeEnumeration.findByValue | public static PriceTypeEnumeration findByValue(final String value) {
if (value.equalsIgnoreCase("negotiable")) {
return PriceTypeEnumeration.NEGOTIABLE;
} else {
return PriceTypeEnumeration.STARTING;
}
} | java | public static PriceTypeEnumeration findByValue(final String value) {
if (value.equalsIgnoreCase("negotiable")) {
return PriceTypeEnumeration.NEGOTIABLE;
} else {
return PriceTypeEnumeration.STARTING;
}
} | [
"public",
"static",
"PriceTypeEnumeration",
"findByValue",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
".",
"equalsIgnoreCase",
"(",
"\"negotiable\"",
")",
")",
"{",
"return",
"PriceTypeEnumeration",
".",
"NEGOTIABLE",
";",
"}",
"else",
"{",
... | Returns a PriceTypeEnumeration based on the String value or null.
@param value Value to search for.
@return PriceTypeEnumeration or null. | [
"Returns",
"a",
"PriceTypeEnumeration",
"based",
"on",
"the",
"String",
"value",
"or",
"null",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/base/types/PriceTypeEnumeration.java#L57-L63 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/RSS090Generator.java | RSS090Generator.populateChannel | protected void populateChannel(final Channel channel, final Element eChannel) {
final String title = channel.getTitle();
if (title != null) {
eChannel.addContent(generateSimpleElement("title", title));
}
final String link = channel.getLink();
if (link != null) {
... | java | protected void populateChannel(final Channel channel, final Element eChannel) {
final String title = channel.getTitle();
if (title != null) {
eChannel.addContent(generateSimpleElement("title", title));
}
final String link = channel.getLink();
if (link != null) {
... | [
"protected",
"void",
"populateChannel",
"(",
"final",
"Channel",
"channel",
",",
"final",
"Element",
"eChannel",
")",
"{",
"final",
"String",
"title",
"=",
"channel",
".",
"getTitle",
"(",
")",
";",
"if",
"(",
"title",
"!=",
"null",
")",
"{",
"eChannel",
... | Populates the given channel with parsed data from the ROME element that holds the channel
data.
@param channel the channel into which parsed data will be added.
@param eChannel the XML element that holds the data for the channel. | [
"Populates",
"the",
"given",
"channel",
"with",
"parsed",
"data",
"from",
"the",
"ROME",
"element",
"that",
"holds",
"the",
"channel",
"data",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/RSS090Generator.java#L111-L124 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/feed/synd/impl/ConverterForRSS10.java | ConverterForRSS10.createSyndEntry | @Override
protected SyndEntry createSyndEntry(final Item item, final boolean preserveWireItem) {
final SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);
final Description desc = item.getDescription();
if (desc != null) {
final SyndContent descContent = new Sy... | java | @Override
protected SyndEntry createSyndEntry(final Item item, final boolean preserveWireItem) {
final SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);
final Description desc = item.getDescription();
if (desc != null) {
final SyndContent descContent = new Sy... | [
"@",
"Override",
"protected",
"SyndEntry",
"createSyndEntry",
"(",
"final",
"Item",
"item",
",",
"final",
"boolean",
"preserveWireItem",
")",
"{",
"final",
"SyndEntry",
"syndEntry",
"=",
"super",
".",
"createSyndEntry",
"(",
"item",
",",
"preserveWireItem",
")",
... | rss.description -> synd.description | [
"rss",
".",
"description",
"-",
">",
"synd",
".",
"description"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/feed/synd/impl/ConverterForRSS10.java#L64-L92 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/AtomServlet.java | AtomServlet.doDelete | @Override
protected void doDelete(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException {
LOG.debug("Entering");
final AtomHandler handler = createAtomRequestHandler(req, res);
final String userName = handler.getAuthenticatedUsername();
if ... | java | @Override
protected void doDelete(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException {
LOG.debug("Entering");
final AtomHandler handler = createAtomRequestHandler(req, res);
final String userName = handler.getAuthenticatedUsername();
if ... | [
"@",
"Override",
"protected",
"void",
"doDelete",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"Entering\"",
")",
";",
"final",
"Ato... | Handle Atom DELETE by calling appropriate handler. | [
"Handle",
"Atom",
"DELETE",
"by",
"calling",
"appropriate",
"handler",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/AtomServlet.java#L328-L356 | train |
rometools/rome | rome-opml/src/main/java/com/rometools/opml/feed/opml/Outline.java | Outline.getAttributeValue | public String getAttributeValue(final String name) {
final List<Attribute> attributes = Collections.synchronizedList(getAttributes());
for (int i = 0; i < attributes.size(); i++) {
final Attribute a = attributes.get(i);
if (a.getName() != null && a.getName().equals(name)) {
... | java | public String getAttributeValue(final String name) {
final List<Attribute> attributes = Collections.synchronizedList(getAttributes());
for (int i = 0; i < attributes.size(); i++) {
final Attribute a = attributes.get(i);
if (a.getName() != null && a.getName().equals(name)) {
... | [
"public",
"String",
"getAttributeValue",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"List",
"<",
"Attribute",
">",
"attributes",
"=",
"Collections",
".",
"synchronizedList",
"(",
"getAttributes",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0"... | Returns the value of an attribute on the outline or null.
@param name name of the attribute. | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"on",
"the",
"outline",
"or",
"null",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-opml/src/main/java/com/rometools/opml/feed/opml/Outline.java#L310-L320 | train |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java | Publisher.sendUpdateNotification | public void sendUpdateNotification(final String hub, final String topic) throws NotificationException {
try {
final StringBuilder sb = new StringBuilder("hub.mode=publish&hub.url=").append(URLEncoder.encode(topic, "UTF-8"));
final URL hubUrl = new URL(hub);
final HttpURLConne... | java | public void sendUpdateNotification(final String hub, final String topic) throws NotificationException {
try {
final StringBuilder sb = new StringBuilder("hub.mode=publish&hub.url=").append(URLEncoder.encode(topic, "UTF-8"));
final URL hubUrl = new URL(hub);
final HttpURLConne... | [
"public",
"void",
"sendUpdateNotification",
"(",
"final",
"String",
"hub",
",",
"final",
"String",
"topic",
")",
"throws",
"NotificationException",
"{",
"try",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"hub.mode=publish&hub.url=\"",
")... | Sends the HUB url a notification of a change in topic
@param hub URL of the hub to notify.
@param topic The Topic that has changed
@throws NotificationException Any failure | [
"Sends",
"the",
"HUB",
"url",
"a",
"notification",
"of",
"a",
"change",
"in",
"topic"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java#L68-L97 | train |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java | Publisher.sendUpdateNotification | public void sendUpdateNotification(final String topic, final SyndFeed feed) throws NotificationException {
for (final SyndLink link : feed.getLinks()) {
if ("hub".equals(link.getRel())) {
sendUpdateNotification(link.getRel(), topic);
return;
}
}
... | java | public void sendUpdateNotification(final String topic, final SyndFeed feed) throws NotificationException {
for (final SyndLink link : feed.getLinks()) {
if ("hub".equals(link.getRel())) {
sendUpdateNotification(link.getRel(), topic);
return;
}
}
... | [
"public",
"void",
"sendUpdateNotification",
"(",
"final",
"String",
"topic",
",",
"final",
"SyndFeed",
"feed",
")",
"throws",
"NotificationException",
"{",
"for",
"(",
"final",
"SyndLink",
"link",
":",
"feed",
".",
"getLinks",
"(",
")",
")",
"{",
"if",
"(",
... | Sends a notification for a feed located at "topic". The feed MUST contain rel="hub".
@param topic URL for the feed
@param feed The feed itself
@throws NotificationException Any failure | [
"Sends",
"a",
"notification",
"for",
"a",
"feed",
"located",
"at",
"topic",
".",
"The",
"feed",
"MUST",
"contain",
"rel",
"=",
"hub",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java#L106-L115 | train |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java | Publisher.sendUpdateNotification | public void sendUpdateNotification(final SyndFeed feed) throws NotificationException {
SyndLink hub = null;
SyndLink self = null;
for (final SyndLink link : feed.getLinks()) {
if ("hub".equals(link.getRel())) {
hub = link;
}
if ("self".equals... | java | public void sendUpdateNotification(final SyndFeed feed) throws NotificationException {
SyndLink hub = null;
SyndLink self = null;
for (final SyndLink link : feed.getLinks()) {
if ("hub".equals(link.getRel())) {
hub = link;
}
if ("self".equals... | [
"public",
"void",
"sendUpdateNotification",
"(",
"final",
"SyndFeed",
"feed",
")",
"throws",
"NotificationException",
"{",
"SyndLink",
"hub",
"=",
"null",
";",
"SyndLink",
"self",
"=",
"null",
";",
"for",
"(",
"final",
"SyndLink",
"link",
":",
"feed",
".",
"... | Sends a notification for a feed. The feed MUST contain rel="hub" and rel="self" links.
@param feed The feed to notify
@throws NotificationException Any failure | [
"Sends",
"a",
"notification",
"for",
"a",
"feed",
".",
"The",
"feed",
"MUST",
"contain",
"rel",
"=",
"hub",
"and",
"rel",
"=",
"self",
"links",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java#L123-L150 | train |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java | Publisher.sendUpdateNotificationAsyncronously | public void sendUpdateNotificationAsyncronously(final String hub, final String topic, final AsyncNotificationCallback callback) {
final Runnable r = new Runnable() {
@Override
public void run() {
try {
sendUpdateNotification(hub, topic);
... | java | public void sendUpdateNotificationAsyncronously(final String hub, final String topic, final AsyncNotificationCallback callback) {
final Runnable r = new Runnable() {
@Override
public void run() {
try {
sendUpdateNotification(hub, topic);
... | [
"public",
"void",
"sendUpdateNotificationAsyncronously",
"(",
"final",
"String",
"hub",
",",
"final",
"String",
"topic",
",",
"final",
"AsyncNotificationCallback",
"callback",
")",
"{",
"final",
"Runnable",
"r",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Overr... | Sends the HUB url a notification of a change in topic asynchronously
@param hub URL of the hub to notify.
@param topic The Topic that has changed
@param callback A callback invoked when the notification completes.
@throws NotificationException Any failure | [
"Sends",
"the",
"HUB",
"url",
"a",
"notification",
"of",
"a",
"change",
"in",
"topic",
"asynchronously"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/pub/Publisher.java#L160-L178 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.getCategories | @Override
public Categories getCategories(final AtomRequest areq) throws AtomException {
LOG.debug("getCollection");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final FileBased... | java | @Override
public Categories getCategories(final AtomRequest areq) throws AtomException {
LOG.debug("getCollection");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final FileBased... | [
"@",
"Override",
"public",
"Categories",
"getCategories",
"(",
"final",
"AtomRequest",
"areq",
")",
"throws",
"AtomException",
"{",
"LOG",
".",
"debug",
"(",
"\"getCollection\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"StringUtils",
".",
"spli... | Returns null because we use in-line categories.
@throws com.rometools.rome.propono.atom.server.AtomException Unexpected exception.
@return Categories object | [
"Returns",
"null",
"because",
"we",
"use",
"in",
"-",
"line",
"categories",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L138-L146 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.getCollection | @Override
public Feed getCollection(final AtomRequest areq) throws AtomException {
LOG.debug("getCollection");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final FileBasedCollec... | java | @Override
public Feed getCollection(final AtomRequest areq) throws AtomException {
LOG.debug("getCollection");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final FileBasedCollec... | [
"@",
"Override",
"public",
"Feed",
"getCollection",
"(",
"final",
"AtomRequest",
"areq",
")",
"throws",
"AtomException",
"{",
"LOG",
".",
"debug",
"(",
"\"getCollection\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"StringUtils",
".",
"split",
... | Get collection specified by pathinfo.
@param areq Details of HTTP request
@return ROME feed representing collection.
@throws com.rometools.rome.propono.atom.server.AtomException Invalid collection or other
exception. | [
"Get",
"collection",
"specified",
"by",
"pathinfo",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L156-L164 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.postEntry | @Override
public Entry postEntry(final AtomRequest areq, final Entry entry) throws AtomException {
LOG.debug("postEntry");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final Fi... | java | @Override
public Entry postEntry(final AtomRequest areq, final Entry entry) throws AtomException {
LOG.debug("postEntry");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final Fi... | [
"@",
"Override",
"public",
"Entry",
"postEntry",
"(",
"final",
"AtomRequest",
"areq",
",",
"final",
"Entry",
"entry",
")",
"throws",
"AtomException",
"{",
"LOG",
".",
"debug",
"(",
"\"postEntry\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"S... | Create a new entry specified by pathInfo and posted entry. We save the submitted Atom entry
verbatim, but we do set the id and reset the update time.
@param entry Entry to be added to collection.
@param areq Details of HTTP request
@throws com.rometools.rome.propono.atom.server.AtomException On invalid collection or o... | [
"Create",
"a",
"new",
"entry",
"specified",
"by",
"pathInfo",
"and",
"posted",
"entry",
".",
"We",
"save",
"the",
"submitted",
"Atom",
"entry",
"verbatim",
"but",
"we",
"do",
"set",
"the",
"id",
"and",
"reset",
"the",
"update",
"time",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L176-L191 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.putEntry | @Override
public void putEntry(final AtomRequest areq, final Entry entry) throws AtomException {
LOG.debug("putEntry");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final String... | java | @Override
public void putEntry(final AtomRequest areq, final Entry entry) throws AtomException {
LOG.debug("putEntry");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final String... | [
"@",
"Override",
"public",
"void",
"putEntry",
"(",
"final",
"AtomRequest",
"areq",
",",
"final",
"Entry",
"entry",
")",
"throws",
"AtomException",
"{",
"LOG",
".",
"debug",
"(",
"\"putEntry\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"Stri... | Update entry specified by pathInfo and posted entry.
@param entry
@param areq Details of HTTP request
@throws com.rometools.rome.propono.atom.server.AtomException | [
"Update",
"entry",
"specified",
"by",
"pathInfo",
"and",
"posted",
"entry",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L227-L241 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.deleteEntry | @Override
public void deleteEntry(final AtomRequest areq) throws AtomException {
LOG.debug("deleteEntry");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final String fileName = p... | java | @Override
public void deleteEntry(final AtomRequest areq) throws AtomException {
LOG.debug("deleteEntry");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final String fileName = p... | [
"@",
"Override",
"public",
"void",
"deleteEntry",
"(",
"final",
"AtomRequest",
"areq",
")",
"throws",
"AtomException",
"{",
"LOG",
".",
"debug",
"(",
"\"deleteEntry\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"StringUtils",
".",
"split",
"(",... | Delete entry specified by pathInfo.
@param areq Details of HTTP request | [
"Delete",
"entry",
"specified",
"by",
"pathInfo",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L248-L264 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.postMedia | @Override
public Entry postMedia(final AtomRequest areq, final Entry entry) throws AtomException {
// get incoming slug from HTTP header
final String slug = areq.getHeader("Slug");
if (LOG.isDebugEnabled()) {
LOG.debug("postMedia - title: " + entry.getTitle() + " slug:" + slug)... | java | @Override
public Entry postMedia(final AtomRequest areq, final Entry entry) throws AtomException {
// get incoming slug from HTTP header
final String slug = areq.getHeader("Slug");
if (LOG.isDebugEnabled()) {
LOG.debug("postMedia - title: " + entry.getTitle() + " slug:" + slug)... | [
"@",
"Override",
"public",
"Entry",
"postMedia",
"(",
"final",
"AtomRequest",
"areq",
",",
"final",
"Entry",
"entry",
")",
"throws",
"AtomException",
"{",
"// get incoming slug from HTTP header",
"final",
"String",
"slug",
"=",
"areq",
".",
"getHeader",
"(",
"\"Sl... | Store media data in collection specified by pathInfo, create an Atom media-link entry to
store metadata for the new media file and return that entry to the caller.
@param areq Details of HTTP request
@param entry New entry initialzied with only title and content type
@return Location URL of new media entry | [
"Store",
"media",
"data",
"in",
"collection",
"specified",
"by",
"pathInfo",
"create",
"an",
"Atom",
"media",
"-",
"link",
"entry",
"to",
"store",
"metadata",
"for",
"the",
"new",
"media",
"file",
"and",
"return",
"that",
"entry",
"to",
"the",
"caller",
".... | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L274-L308 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.putMedia | @Override
public void putMedia(final AtomRequest areq) throws AtomException {
LOG.debug("putMedia");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final String fileName = pathIn... | java | @Override
public void putMedia(final AtomRequest areq) throws AtomException {
LOG.debug("putMedia");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final String fileName = pathIn... | [
"@",
"Override",
"public",
"void",
"putMedia",
"(",
"final",
"AtomRequest",
"areq",
")",
"throws",
"AtomException",
"{",
"LOG",
".",
"debug",
"(",
"\"putMedia\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"StringUtils",
".",
"split",
"(",
"ar... | Update the media file part of a media-link entry.
@param areq Details of HTTP request Assuming pathInfo of form /user-name/resource/name | [
"Update",
"the",
"media",
"file",
"part",
"of",
"a",
"media",
"-",
"link",
"entry",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L315-L330 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.isAtomServiceURI | @Override
public boolean isAtomServiceURI(final AtomRequest areq) {
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
if (pathInfo.length == 0) {
return true;
}
return false;
} | java | @Override
public boolean isAtomServiceURI(final AtomRequest areq) {
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
if (pathInfo.length == 0) {
return true;
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"isAtomServiceURI",
"(",
"final",
"AtomRequest",
"areq",
")",
"{",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"StringUtils",
".",
"split",
"(",
"areq",
".",
"getPathInfo",
"(",
")",
",",
"\"/\"",
")",
";",
"if",
"... | Return true if specified pathinfo represents URI of service doc. | [
"Return",
"true",
"if",
"specified",
"pathinfo",
"represents",
"URI",
"of",
"service",
"doc",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L351-L358 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.isCategoriesURI | @Override
public boolean isCategoriesURI(final AtomRequest areq) {
LOG.debug("isCategoriesDocumentURI");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
if (pathInfo.length == 3 && "categories".equals(pathInfo[2])) {
return true;
}
return fal... | java | @Override
public boolean isCategoriesURI(final AtomRequest areq) {
LOG.debug("isCategoriesDocumentURI");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
if (pathInfo.length == 3 && "categories".equals(pathInfo[2])) {
return true;
}
return fal... | [
"@",
"Override",
"public",
"boolean",
"isCategoriesURI",
"(",
"final",
"AtomRequest",
"areq",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"isCategoriesDocumentURI\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"StringUtils",
".",
"split",
"(",
"areq",
... | Return true if specified pathinfo represents URI of category doc. | [
"Return",
"true",
"if",
"specified",
"pathinfo",
"represents",
"URI",
"of",
"category",
"doc",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L363-L371 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.isCollectionURI | @Override
public boolean isCollectionURI(final AtomRequest areq) {
LOG.debug("isCollectionURI");
// workspace/collection-plural
// if length is 2 and points to a valid collection then YES
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
if (pathInfo.lengt... | java | @Override
public boolean isCollectionURI(final AtomRequest areq) {
LOG.debug("isCollectionURI");
// workspace/collection-plural
// if length is 2 and points to a valid collection then YES
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
if (pathInfo.lengt... | [
"@",
"Override",
"public",
"boolean",
"isCollectionURI",
"(",
"final",
"AtomRequest",
"areq",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"isCollectionURI\"",
")",
";",
"// workspace/collection-plural",
"// if length is 2 and points to a valid collection then YES",
"final",
"Stri... | Return true if specified pathinfo represents URI of a collection. | [
"Return",
"true",
"if",
"specified",
"pathinfo",
"represents",
"URI",
"of",
"a",
"collection",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L376-L391 | train |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.authenticateBASIC | public String authenticateBASIC(final HttpServletRequest request) {
LOG.debug("authenticateBASIC");
boolean valid = false;
String userID = null;
String password = null;
try {
final String authHeader = request.getHeader("Authorization");
if (authHeader != n... | java | public String authenticateBASIC(final HttpServletRequest request) {
LOG.debug("authenticateBASIC");
boolean valid = false;
String userID = null;
String password = null;
try {
final String authHeader = request.getHeader("Authorization");
if (authHeader != n... | [
"public",
"String",
"authenticateBASIC",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"authenticateBASIC\"",
")",
";",
"boolean",
"valid",
"=",
"false",
";",
"String",
"userID",
"=",
"null",
";",
"String",
"password",
"=... | BASIC authentication. | [
"BASIC",
"authentication",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L438-L471 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/feed/atom/Entry.java | Entry.isMediaEntry | public boolean isMediaEntry() {
boolean mediaEntry = false;
final List<Link> links = getOtherLinks();
for (final Link link : links) {
if ("edit-media".equals(link.getRel())) {
mediaEntry = true;
break;
}
}
return mediaEntry;... | java | public boolean isMediaEntry() {
boolean mediaEntry = false;
final List<Link> links = getOtherLinks();
for (final Link link : links) {
if ("edit-media".equals(link.getRel())) {
mediaEntry = true;
break;
}
}
return mediaEntry;... | [
"public",
"boolean",
"isMediaEntry",
"(",
")",
"{",
"boolean",
"mediaEntry",
"=",
"false",
";",
"final",
"List",
"<",
"Link",
">",
"links",
"=",
"getOtherLinks",
"(",
")",
";",
"for",
"(",
"final",
"Link",
"link",
":",
"links",
")",
"{",
"if",
"(",
"... | Returns true if entry is a media entry, i.e. has rel="edit-media".
@return true if entry is a media entry | [
"Returns",
"true",
"if",
"entry",
"is",
"a",
"media",
"entry",
"i",
".",
"e",
".",
"has",
"rel",
"=",
"edit",
"-",
"media",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/feed/atom/Entry.java#L261-L271 | train |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/hub/notify/standard/ThreadPoolNotifier.java | ThreadPoolNotifier.enqueueNotification | @Override
protected void enqueueNotification(final Notification not) {
final Runnable r = new Runnable() {
@Override
public void run() {
not.lastRun = System.currentTimeMillis();
final SubscriptionSummary summary = postNotification(not.subscriber, not... | java | @Override
protected void enqueueNotification(final Notification not) {
final Runnable r = new Runnable() {
@Override
public void run() {
not.lastRun = System.currentTimeMillis();
final SubscriptionSummary summary = postNotification(not.subscriber, not... | [
"@",
"Override",
"protected",
"void",
"enqueueNotification",
"(",
"final",
"Notification",
"not",
")",
"{",
"final",
"Runnable",
"r",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"not",
".",
"lastRun",
"... | Enqueues a notification to run. If the notification fails, it will be retried every two
minutes until 5 attempts are completed. Notifications to the same callback should be
delivered successfully in order.
@param not | [
"Enqueues",
"a",
"notification",
"to",
"run",
".",
"If",
"the",
"notification",
"fails",
"it",
"will",
"be",
"retried",
"every",
"two",
"minutes",
"until",
"5",
"attempts",
"are",
"completed",
".",
"Notifications",
"to",
"the",
"same",
"callback",
"should",
... | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/hub/notify/standard/ThreadPoolNotifier.java#L62-L84 | train |
rometools/rome | rome-certiorem/src/main/java/com/rometools/certiorem/hub/notify/standard/ThreadPoolNotifier.java | ThreadPoolNotifier.retry | protected void retry(final Notification not) {
if (!pendings.contains(not.subscriber.getCallback())) {
// We don't have a current retry for this callback pending, so we
// will schedule the retry
pendings.add(not.subscriber.getCallback());
timer.schedule(new Timer... | java | protected void retry(final Notification not) {
if (!pendings.contains(not.subscriber.getCallback())) {
// We don't have a current retry for this callback pending, so we
// will schedule the retry
pendings.add(not.subscriber.getCallback());
timer.schedule(new Timer... | [
"protected",
"void",
"retry",
"(",
"final",
"Notification",
"not",
")",
"{",
"if",
"(",
"!",
"pendings",
".",
"contains",
"(",
"not",
".",
"subscriber",
".",
"getCallback",
"(",
")",
")",
")",
"{",
"// We don't have a current retry for this callback pending, so we... | Schedules a notification to retry in two minutes.
@param not Notification to retry | [
"Schedules",
"a",
"notification",
"to",
"retry",
"in",
"two",
"minutes",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/hub/notify/standard/ThreadPoolNotifier.java#L91-L113 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java | RSS091UserlandParser.getItems | @Override
protected List<Element> getItems(final Element rssRoot) {
final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
if (eChannel != null) {
return eChannel.getChildren("item", getRSSNamespace());
} else {
return Collections.emptyList();
... | java | @Override
protected List<Element> getItems(final Element rssRoot) {
final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
if (eChannel != null) {
return eChannel.getChildren("item", getRSSNamespace());
} else {
return Collections.emptyList();
... | [
"@",
"Override",
"protected",
"List",
"<",
"Element",
">",
"getItems",
"(",
"final",
"Element",
"rssRoot",
")",
"{",
"final",
"Element",
"eChannel",
"=",
"rssRoot",
".",
"getChild",
"(",
"\"channel\"",
",",
"getRSSNamespace",
"(",
")",
")",
";",
"if",
"(",... | It looks for the 'item' elements under the 'channel' elemment. | [
"It",
"looks",
"for",
"the",
"item",
"elements",
"under",
"the",
"channel",
"elemment",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java#L202-L213 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java | RSS091UserlandParser.getImage | @Override
protected Element getImage(final Element rssRoot) {
final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
if (eChannel != null) {
return eChannel.getChild("image", getRSSNamespace());
} else {
return null;
}
} | java | @Override
protected Element getImage(final Element rssRoot) {
final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
if (eChannel != null) {
return eChannel.getChild("image", getRSSNamespace());
} else {
return null;
}
} | [
"@",
"Override",
"protected",
"Element",
"getImage",
"(",
"final",
"Element",
"rssRoot",
")",
"{",
"final",
"Element",
"eChannel",
"=",
"rssRoot",
".",
"getChild",
"(",
"\"channel\"",
",",
"getRSSNamespace",
"(",
")",
")",
";",
"if",
"(",
"eChannel",
"!=",
... | It looks for the 'image' elements under the 'channel' elemment. | [
"It",
"looks",
"for",
"the",
"image",
"elements",
"under",
"the",
"channel",
"elemment",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java#L218-L229 | train |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java | RSS091UserlandParser.getTextInput | @Override
protected Element getTextInput(final Element rssRoot) {
final String elementName = getTextInputLabel();
final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
if (eChannel != null) {
return eChannel.getChild(elementName, getRSSNamespace());
}... | java | @Override
protected Element getTextInput(final Element rssRoot) {
final String elementName = getTextInputLabel();
final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
if (eChannel != null) {
return eChannel.getChild(elementName, getRSSNamespace());
}... | [
"@",
"Override",
"protected",
"Element",
"getTextInput",
"(",
"final",
"Element",
"rssRoot",
")",
"{",
"final",
"String",
"elementName",
"=",
"getTextInputLabel",
"(",
")",
";",
"final",
"Element",
"eChannel",
"=",
"rssRoot",
".",
"getChild",
"(",
"\"channel\"",... | It looks for the 'textinput' elements under the 'channel' elemment. | [
"It",
"looks",
"for",
"the",
"textinput",
"elements",
"under",
"the",
"channel",
"elemment",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/RSS091UserlandParser.java#L241-L253 | train |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/itunes/FeedInformationImpl.java | FeedInformationImpl.getCategories | @Override
public List<Category> getCategories() {
return categories == null ? (categories = new ArrayList<Category>()) : categories;
} | java | @Override
public List<Category> getCategories() {
return categories == null ? (categories = new ArrayList<Category>()) : categories;
} | [
"@",
"Override",
"public",
"List",
"<",
"Category",
">",
"getCategories",
"(",
")",
"{",
"return",
"categories",
"==",
"null",
"?",
"(",
"categories",
"=",
"new",
"ArrayList",
"<",
"Category",
">",
"(",
")",
")",
":",
"categories",
";",
"}"
] | The parent categories for this feed
@return The parent categories for this feed | [
"The",
"parent",
"categories",
"for",
"this",
"feed"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/itunes/FeedInformationImpl.java#L54-L57 | train |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Longs.java | Longs.parseDecimal | public static Long parseDecimal(final String s) {
Long parsed = null;
try {
if (s != null) {
parsed = (long) Double.parseDouble(s);
}
} catch (final NumberFormatException e) {
}
return parsed;
} | java | public static Long parseDecimal(final String s) {
Long parsed = null;
try {
if (s != null) {
parsed = (long) Double.parseDouble(s);
}
} catch (final NumberFormatException e) {
}
return parsed;
} | [
"public",
"static",
"Long",
"parseDecimal",
"(",
"final",
"String",
"s",
")",
"{",
"Long",
"parsed",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"parsed",
"=",
"(",
"long",
")",
"Double",
".",
"parseDouble",
"(",
"s",
")",... | Converts a String into a Long by first parsing it as Double and then casting it to Long.
@param s The String to convert, may be null or in decimal format
@return The parsed Long or null when parsing is not possible | [
"Converts",
"a",
"String",
"into",
"a",
"Long",
"by",
"first",
"parsing",
"it",
"as",
"Double",
"and",
"then",
"casting",
"it",
"to",
"Long",
"."
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Longs.java#L28-L37 | train |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/georss/geometries/PositionList.java | PositionList.add | public void add(final double latitude, final double longitude) {
ensureCapacity(size + 1);
this.longitude[size] = longitude;
this.latitude[size] = latitude;
++size;
} | java | public void add(final double latitude, final double longitude) {
ensureCapacity(size + 1);
this.longitude[size] = longitude;
this.latitude[size] = latitude;
++size;
} | [
"public",
"void",
"add",
"(",
"final",
"double",
"latitude",
",",
"final",
"double",
"longitude",
")",
"{",
"ensureCapacity",
"(",
"size",
"+",
"1",
")",
";",
"this",
".",
"longitude",
"[",
"size",
"]",
"=",
"longitude",
";",
"this",
".",
"latitude",
"... | Add a position at the end of the list | [
"Add",
"a",
"position",
"at",
"the",
"end",
"of",
"the",
"list"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/georss/geometries/PositionList.java#L116-L121 | train |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/georss/geometries/PositionList.java | PositionList.insert | public void insert(final int pos, final double latitude, final double longitude) {
ensureCapacity(size + 1);
System.arraycopy(this.longitude, pos, this.longitude, pos + 1, size - pos);
System.arraycopy(this.latitude, pos, this.latitude, pos + 1, size - pos);
this.longitude[pos] = longitu... | java | public void insert(final int pos, final double latitude, final double longitude) {
ensureCapacity(size + 1);
System.arraycopy(this.longitude, pos, this.longitude, pos + 1, size - pos);
System.arraycopy(this.latitude, pos, this.latitude, pos + 1, size - pos);
this.longitude[pos] = longitu... | [
"public",
"void",
"insert",
"(",
"final",
"int",
"pos",
",",
"final",
"double",
"latitude",
",",
"final",
"double",
"longitude",
")",
"{",
"ensureCapacity",
"(",
"size",
"+",
"1",
")",
";",
"System",
".",
"arraycopy",
"(",
"this",
".",
"longitude",
",",
... | Add a position at a given index in the list. The rest of the list is shifted one place to the
"right"
@param pos position index | [
"Add",
"a",
"position",
"at",
"a",
"given",
"index",
"in",
"the",
"list",
".",
"The",
"rest",
"of",
"the",
"list",
"is",
"shifted",
"one",
"place",
"to",
"the",
"right"
] | 5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010 | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/georss/geometries/PositionList.java#L129-L136 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.