_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q6400
AsciiTable.setPaddingBottom
train
public AsciiTable setPaddingBottom(int paddingBottom) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingBottom(paddingBottom); } } return this; }
java
{ "resource": "" }
q6401
AsciiTable.setPaddingBottomChar
train
public AsciiTable setPaddingBottomChar(Character paddingBottomChar) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingBottomChar(paddingBottomChar); } } return this; }
java
{ "resource": "" }
q6402
AsciiTable.setPaddingLeft
train
public AsciiTable setPaddingLeft(int paddingLeft) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingLeft(paddingLeft); } } return this; }
java
{ "resource": "" }
q6403
AsciiTable.setPaddingLeftChar
train
public AsciiTable setPaddingLeftChar(Character paddingLeftChar) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingLeftChar(paddingLeftChar); } } return this; }
java
{ "resource": "" }
q6404
AsciiTable.setPaddingLeftRight
train
public AsciiTable setPaddingLeftRight(int padding){ for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingLeftRight(padding); } } return this; }
java
{ "resource": "" }
q6405
AsciiTable.setPaddingRight
train
public AsciiTable setPaddingRight(int paddingRight) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingRight(paddingRight); } } return this; }
java
{ "resource": "" }
q6406
AsciiTable.setPaddingRightChar
train
public AsciiTable setPaddingRightChar(Character paddingRightChar) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingRightChar(paddingRightChar); } } return this; }
java
{ "resource": "" }
q6407
AsciiTable.setPaddingTop
train
public AsciiTable setPaddingTop(int paddingTop) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingTop(paddingTop); } } return this; }
java
{ "resource": "" }
q6408
AsciiTable.setPaddingTopChar
train
public AsciiTable setPaddingTopChar(Character paddingTopChar) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setPaddingTopChar(paddingTopChar); } } return this; }
java
{ "resource": "" }
q6409
AsciiTable.setTextAlignment
train
public AsciiTable setTextAlignment(TextAlignment textAlignment){ for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setTextAlignment(textAlignment); } } return this; }
java
{ "resource": "" }
q6410
AsciiTable.setTargetTranslator
train
public AsciiTable setTargetTranslator(TargetTranslator targetTranslator) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setTargetTranslator(targetTranslator); } } return this; }
java
{ "resource": "" }
q6411
AsciiTable.setHtmlElementTranslator
train
public AsciiTable setHtmlElementTranslator(HtmlElementTranslator htmlElementTranslator) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setHtmlElementTranslator(htmlElementTranslator); } } return this; }
java
{ "resource": "" }
q6412
AsciiTable.setCharTranslator
train
public AsciiTable setCharTranslator(CharacterTranslator charTranslator) { for(AT_Row row : this.rows){ if(row.getType()==TableRowType.CONTENT){ row.setCharTranslator(charTranslator); } } return this; }
java
{ "resource": "" }
q6413
Utilities.base64Encode
train
public static String base64Encode(byte[] bytes) { if (bytes == null) { throw new IllegalArgumentException("Input bytes must not be null."); } if (bytes.length >= BASE64_UPPER_BOUND) { throw new IllegalArgumentException( "Input bytes length must not exceed " + BASE64_UPPER_BOUND); } // Every three bytes is encoded into four characters. // // Example: // input |0 1 0 1 0 0 1 0|0 1 1 0 1 1 1 1|0 1 1 0 0 0 1 0| // encode grouping |0 1 0 1 0 0|1 0 0 1 1 0|1 1 1 1 0 1|1 0 0 0 1 0| // encoded ascii | U | m | 9 | i | int triples = bytes.length / 3; // If the number of input bytes is not a multiple of three, padding characters will be added. if (bytes.length % 3 != 0) { triples += 1; } // The encoded string will have four characters for every three bytes. char[] encoding = new char[triples << 2]; for (int in = 0, out = 0; in < bytes.length; in += 3, out += 4) { int triple = (bytes[in] & 0xff) << 16; if (in + 1 < bytes.length) { triple |= ((bytes[in + 1] & 0xff) << 8); } if (in + 2 < bytes.length) { triple |= (bytes[in + 2] & 0xff); } encoding[out] = BASE64_CHARS.charAt((triple >> 18) & 0x3f); encoding[out + 1] = BASE64_CHARS.charAt((triple >> 12) & 0x3f); encoding[out + 2] = BASE64_CHARS.charAt((triple >> 6) & 0x3f); encoding[out + 3] = BASE64_CHARS.charAt(triple & 0x3f); } // Add padding characters if needed. for (int i = encoding.length - (triples * 3 - bytes.length); i < encoding.length; i++) { encoding[i] = '='; } return String.valueOf(encoding); }
java
{ "resource": "" }
q6414
Utilities.md5
train
static String md5(String input) { if (input == null || input.length() == 0) { throw new IllegalArgumentException("Input string must not be blank."); } try { MessageDigest algorithm = MessageDigest.getInstance("MD5"); algorithm.reset(); algorithm.update(input.getBytes()); byte[] messageDigest = algorithm.digest(); StringBuilder hexString = new StringBuilder(); for (byte messageByte : messageDigest) { hexString.append(Integer.toHexString((messageByte & 0xFF) | 0x100).substring(1, 3)); } return hexString.toString(); } catch (Exception e) { throw new RuntimeException(e); } }
java
{ "resource": "" }
q6415
Utilities.hmacSha1
train
static byte[] hmacSha1(StringBuilder message, String key) { try { Mac mac = Mac.getInstance("HmacSHA1"); mac.init(new SecretKeySpec(key.getBytes(), "HmacSHA1")); return mac.doFinal(message.toString().getBytes()); } catch (Exception e) { throw new RuntimeException(e); } }
java
{ "resource": "" }
q6416
Utilities.aes128Encrypt
train
@SuppressWarnings("InsecureCryptoUsage") // Only used in known-weak crypto "legacy" mode. static byte[] aes128Encrypt(StringBuilder message, String key) { try { key = normalizeString(key, 16); rightPadString(message, '{', 16); Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding"); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key.getBytes(), "AES")); return cipher.doFinal(message.toString().getBytes()); } catch (Exception e) { throw new RuntimeException(e); } }
java
{ "resource": "" }
q6417
Thumbor.create
train
public static Thumbor create(String host, String key) { if (key == null || key.length() == 0) { throw new IllegalArgumentException("Key must not be blank."); } return new Thumbor(host, key); }
java
{ "resource": "" }
q6418
Thumbor.buildImage
train
public ThumborUrlBuilder buildImage(String image) { if (image == null || image.length() == 0) { throw new IllegalArgumentException("Image must not be blank."); } return new ThumborUrlBuilder(host, key, image); }
java
{ "resource": "" }
q6419
ThumborUrlBuilder.resize
train
public ThumborUrlBuilder resize(int width, int height) { if (width < 0 && width != ORIGINAL_SIZE) { throw new IllegalArgumentException("Width must be a positive number."); } if (height < 0 && height != ORIGINAL_SIZE) { throw new IllegalArgumentException("Height must be a positive number."); } if (width == 0 && height == 0) { throw new IllegalArgumentException("Both width and height must not be zero."); } hasResize = true; resizeWidth = width; resizeHeight = height; return this; }
java
{ "resource": "" }
q6420
ThumborUrlBuilder.crop
train
public ThumborUrlBuilder crop(int top, int left, int bottom, int right) { if (top < 0) { throw new IllegalArgumentException("Top must be greater or equal to zero."); } if (left < 0) { throw new IllegalArgumentException("Left must be greater or equal to zero."); } if (bottom < 1 || bottom <= top) { throw new IllegalArgumentException("Bottom must be greater than zero and top."); } if (right < 1 || right <= left) { throw new IllegalArgumentException("Right must be greater than zero and left."); } hasCrop = true; cropTop = top; cropLeft = left; cropBottom = bottom; cropRight = right; return this; }
java
{ "resource": "" }
q6421
ThumborUrlBuilder.align
train
public ThumborUrlBuilder align(VerticalAlign valign, HorizontalAlign halign) { return align(valign).align(halign); }
java
{ "resource": "" }
q6422
ThumborUrlBuilder.trim
train
public ThumborUrlBuilder trim(TrimPixelColor value, int colorTolerance) { if (colorTolerance < 0 || colorTolerance > 442) { throw new IllegalArgumentException("Color tolerance must be between 0 and 442."); } if (colorTolerance > 0 && value == null) { throw new IllegalArgumentException("Trim pixel color value must not be null."); } isTrim = true; trimPixelColor = value; trimColorTolerance = colorTolerance; return this; }
java
{ "resource": "" }
q6423
ThumborUrlBuilder.assembleConfig
train
StringBuilder assembleConfig(boolean meta) { StringBuilder builder = new StringBuilder(); if (meta) { builder.append(PREFIX_META); } if (isTrim) { builder.append(PART_TRIM); if (trimPixelColor != null) { builder.append(":").append(trimPixelColor.value); if (trimColorTolerance > 0) { builder.append(":").append(trimColorTolerance); } } builder.append("/"); } if (hasCrop) { builder.append(cropLeft).append("x").append(cropTop) // .append(":").append(cropRight).append("x").append(cropBottom); builder.append("/"); } if (hasResize) { if (fitInStyle != null) { builder.append(fitInStyle.value).append("/"); } if (flipHorizontally) { builder.append("-"); } if (resizeWidth == ORIGINAL_SIZE) { builder.append("orig"); } else { builder.append(resizeWidth); } builder.append("x"); if (flipVertically) { builder.append("-"); } if (resizeHeight == ORIGINAL_SIZE) { builder.append("orig"); } else { builder.append(resizeHeight); } if (isSmart) { builder.append("/").append(PART_SMART); } else { if (cropHorizontalAlign != null) { builder.append("/").append(cropHorizontalAlign.value); } if (cropVerticalAlign != null) { builder.append("/").append(cropVerticalAlign.value); } } builder.append("/"); } if (filters != null) { builder.append(PART_FILTERS); for (String filter : filters) { builder.append(":").append(filter); } builder.append("/"); } builder.append(isLegacy ? md5(image) : image); return builder; }
java
{ "resource": "" }
q6424
ThumborUrlBuilder.rgb
train
public static String rgb(int r, int g, int b) { if (r < -100 || r > 100) { throw new IllegalArgumentException("Red value must be between -100 and 100, inclusive."); } if (g < -100 || g > 100) { throw new IllegalArgumentException("Green value must be between -100 and 100, inclusive."); } if (b < -100 || b > 100) { throw new IllegalArgumentException("Blue value must be between -100 and 100, inclusive."); } return FILTER_RGB + "(" + r + "," + g + "," + b + ")"; }
java
{ "resource": "" }
q6425
ThumborUrlBuilder.roundCorner
train
public static String roundCorner(int radiusInner, int radiusOuter, int color) { if (radiusInner < 1) { throw new IllegalArgumentException("Radius must be greater than zero."); } if (radiusOuter < 0) { throw new IllegalArgumentException("Outer radius must be greater than or equal to zero."); } StringBuilder builder = new StringBuilder(FILTER_ROUND_CORNER).append("(").append(radiusInner); if (radiusOuter > 0) { builder.append("|").append(radiusOuter); } final int r = (color & 0xFF0000) >>> 16; final int g = (color & 0xFF00) >>> 8; final int b = color & 0xFF; return builder.append(",") // .append(r).append(",") // .append(g).append(",") // .append(b).append(")") // .toString(); }
java
{ "resource": "" }
q6426
ThumborUrlBuilder.fill
train
public static String fill(int color) { final String colorCode = Integer.toHexString(color & 0xFFFFFF); // Strip alpha return FILTER_FILL + "(" + colorCode + ")"; }
java
{ "resource": "" }
q6427
ThumborUrlBuilder.format
train
public static String format(ImageFormat format) { if (format == null) { throw new IllegalArgumentException("You must specify an image format."); } return FILTER_FORMAT + "(" + format.value + ")"; }
java
{ "resource": "" }
q6428
ThumborUrlBuilder.frame
train
public static String frame(String imageUrl) { if (imageUrl == null || imageUrl.length() == 0) { throw new IllegalArgumentException("Image URL must not be blank."); } return FILTER_FRAME + "(" + imageUrl + ")"; }
java
{ "resource": "" }
q6429
ThumborUrlBuilder.blur
train
public static String blur(int radius, int sigma) { if (radius < 1) { throw new IllegalArgumentException("Radius must be greater than zero."); } if (radius > 150) { throw new IllegalArgumentException("Radius must be lower or equal than 150."); } if (sigma < 0) { throw new IllegalArgumentException("Sigma must be greater than zero."); } return FILTER_BLUR + "(" + radius + "," + sigma + ")"; }
java
{ "resource": "" }
q6430
ShakeDetector.start
train
public boolean start(SensorManager sensorManager) { // Already started? if (accelerometer != null) { return true; } accelerometer = sensorManager.getDefaultSensor( Sensor.TYPE_ACCELEROMETER); // If this phone has an accelerometer, listen to it. if (accelerometer != null) { this.sensorManager = sensorManager; sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_FASTEST); } return accelerometer != null; }
java
{ "resource": "" }
q6431
ShakeDetector.stop
train
public void stop() { if (accelerometer != null) { queue.clear(); sensorManager.unregisterListener(this, accelerometer); sensorManager = null; accelerometer = null; } }
java
{ "resource": "" }
q6432
TasksBase.findById
train
public ItemRequest<Task> findById(String task) { String path = String.format("/tasks/%s", task); return new ItemRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6433
TasksBase.update
train
public ItemRequest<Task> update(String task) { String path = String.format("/tasks/%s", task); return new ItemRequest<Task>(this, Task.class, path, "PUT"); }
java
{ "resource": "" }
q6434
TasksBase.delete
train
public ItemRequest<Task> delete(String task) { String path = String.format("/tasks/%s", task); return new ItemRequest<Task>(this, Task.class, path, "DELETE"); }
java
{ "resource": "" }
q6435
TasksBase.findByProject
train
public CollectionRequest<Task> findByProject(String projectId) { String path = String.format("/projects/%s/tasks", projectId); return new CollectionRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6436
TasksBase.findByTag
train
public CollectionRequest<Task> findByTag(String tag) { String path = String.format("/tags/%s/tasks", tag); return new CollectionRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6437
TasksBase.getTasksWithTag
train
public CollectionRequest<Task> getTasksWithTag(String tag) { String path = String.format("/tags/%s/tasks", tag); return new CollectionRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6438
TasksBase.dependencies
train
public ItemRequest<Task> dependencies(String task) { String path = String.format("/tasks/%s/dependencies", task); return new ItemRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6439
TasksBase.dependents
train
public ItemRequest<Task> dependents(String task) { String path = String.format("/tasks/%s/dependents", task); return new ItemRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6440
TasksBase.removeDependencies
train
public ItemRequest<Task> removeDependencies(String task) { String path = String.format("/tasks/%s/removeDependencies", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6441
TasksBase.removeDependents
train
public ItemRequest<Task> removeDependents(String task) { String path = String.format("/tasks/%s/removeDependents", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6442
TasksBase.addFollowers
train
public ItemRequest<Task> addFollowers(String task) { String path = String.format("/tasks/%s/addFollowers", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6443
TasksBase.removeFollowers
train
public ItemRequest<Task> removeFollowers(String task) { String path = String.format("/tasks/%s/removeFollowers", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6444
TasksBase.projects
train
public CollectionRequest<Task> projects(String task) { String path = String.format("/tasks/%s/projects", task); return new CollectionRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6445
TasksBase.addProject
train
public ItemRequest<Task> addProject(String task) { String path = String.format("/tasks/%s/addProject", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6446
TasksBase.removeProject
train
public ItemRequest<Task> removeProject(String task) { String path = String.format("/tasks/%s/removeProject", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6447
TasksBase.tags
train
public CollectionRequest<Task> tags(String task) { String path = String.format("/tasks/%s/tags", task); return new CollectionRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6448
TasksBase.addTag
train
public ItemRequest<Task> addTag(String task) { String path = String.format("/tasks/%s/addTag", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6449
TasksBase.removeTag
train
public ItemRequest<Task> removeTag(String task) { String path = String.format("/tasks/%s/removeTag", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6450
TasksBase.subtasks
train
public CollectionRequest<Task> subtasks(String task) { String path = String.format("/tasks/%s/subtasks", task); return new CollectionRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6451
TasksBase.addSubtask
train
public ItemRequest<Task> addSubtask(String task) { String path = String.format("/tasks/%s/subtasks", task); return new ItemRequest<Task>(this, Task.class, path, "POST"); }
java
{ "resource": "" }
q6452
TasksBase.stories
train
public CollectionRequest<Task> stories(String task) { String path = String.format("/tasks/%s/stories", task); return new CollectionRequest<Task>(this, Task.class, path, "GET"); }
java
{ "resource": "" }
q6453
TagsBase.createInWorkspace
train
public ItemRequest<Tag> createInWorkspace(String workspace) { String path = String.format("/workspaces/%s/tags", workspace); return new ItemRequest<Tag>(this, Tag.class, path, "POST"); }
java
{ "resource": "" }
q6454
TagsBase.findById
train
public ItemRequest<Tag> findById(String tag) { String path = String.format("/tags/%s", tag); return new ItemRequest<Tag>(this, Tag.class, path, "GET"); }
java
{ "resource": "" }
q6455
TagsBase.update
train
public ItemRequest<Tag> update(String tag) { String path = String.format("/tags/%s", tag); return new ItemRequest<Tag>(this, Tag.class, path, "PUT"); }
java
{ "resource": "" }
q6456
TagsBase.delete
train
public ItemRequest<Tag> delete(String tag) { String path = String.format("/tags/%s", tag); return new ItemRequest<Tag>(this, Tag.class, path, "DELETE"); }
java
{ "resource": "" }
q6457
TagsBase.findByWorkspace
train
public CollectionRequest<Tag> findByWorkspace(String workspace) { String path = String.format("/workspaces/%s/tags", workspace); return new CollectionRequest<Tag>(this, Tag.class, path, "GET"); }
java
{ "resource": "" }
q6458
ProjectsBase.createInWorkspace
train
public ItemRequest<Project> createInWorkspace(String workspace) { String path = String.format("/workspaces/%s/projects", workspace); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6459
ProjectsBase.createInTeam
train
public ItemRequest<Project> createInTeam(String team) { String path = String.format("/teams/%s/projects", team); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6460
ProjectsBase.findById
train
public ItemRequest<Project> findById(String project) { String path = String.format("/projects/%s", project); return new ItemRequest<Project>(this, Project.class, path, "GET"); }
java
{ "resource": "" }
q6461
ProjectsBase.update
train
public ItemRequest<Project> update(String project) { String path = String.format("/projects/%s", project); return new ItemRequest<Project>(this, Project.class, path, "PUT"); }
java
{ "resource": "" }
q6462
ProjectsBase.delete
train
public ItemRequest<Project> delete(String project) { String path = String.format("/projects/%s", project); return new ItemRequest<Project>(this, Project.class, path, "DELETE"); }
java
{ "resource": "" }
q6463
ProjectsBase.findByWorkspace
train
public CollectionRequest<Project> findByWorkspace(String workspace) { String path = String.format("/workspaces/%s/projects", workspace); return new CollectionRequest<Project>(this, Project.class, path, "GET"); }
java
{ "resource": "" }
q6464
ProjectsBase.findByTeam
train
public CollectionRequest<Project> findByTeam(String team) { String path = String.format("/teams/%s/projects", team); return new CollectionRequest<Project>(this, Project.class, path, "GET"); }
java
{ "resource": "" }
q6465
ProjectsBase.tasks
train
public CollectionRequest<Project> tasks(String project) { String path = String.format("/projects/%s/tasks", project); return new CollectionRequest<Project>(this, Project.class, path, "GET"); }
java
{ "resource": "" }
q6466
ProjectsBase.addFollowers
train
public ItemRequest<Project> addFollowers(String project) { String path = String.format("/projects/%s/addFollowers", project); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6467
ProjectsBase.removeFollowers
train
public ItemRequest<Project> removeFollowers(String project) { String path = String.format("/projects/%s/removeFollowers", project); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6468
ProjectsBase.addMembers
train
public ItemRequest<Project> addMembers(String project) { String path = String.format("/projects/%s/addMembers", project); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6469
ProjectsBase.removeMembers
train
public ItemRequest<Project> removeMembers(String project) { String path = String.format("/projects/%s/removeMembers", project); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6470
ProjectsBase.addCustomFieldSetting
train
public ItemRequest<Project> addCustomFieldSetting(String project) { String path = String.format("/projects/%s/addCustomFieldSetting", project); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6471
ProjectsBase.removeCustomFieldSetting
train
public ItemRequest<Project> removeCustomFieldSetting(String project) { String path = String.format("/projects/%s/removeCustomFieldSetting", project); return new ItemRequest<Project>(this, Project.class, path, "POST"); }
java
{ "resource": "" }
q6472
PageIterator.retrieveNextPage
train
private void retrieveNextPage() { if (this.pageSize < Long.MAX_VALUE || this.itemLimit < Long.MAX_VALUE) { this.request.query("limit", Math.min(this.pageSize, this.itemLimit - this.count)); } else { this.request.query("limit", null); } ResultBodyCollection<T> page = null; try { page = this.getNext(); } catch (IOException exception) { // See comments in hasNext(). this.ioException = exception; } if (page != null) { this.continuation = this.getContinuation(page); if (page.data != null && !page.data.isEmpty()) { this.count += page.data.size(); this.nextData = page.data; } else { this.nextData = null; } } else { this.continuation = null; this.nextData = null; } }
java
{ "resource": "" }
q6473
UsersBase.findById
train
public ItemRequest<User> findById(String user) { String path = String.format("/users/%s", user); return new ItemRequest<User>(this, User.class, path, "GET"); }
java
{ "resource": "" }
q6474
UsersBase.findByWorkspace
train
public CollectionRequest<User> findByWorkspace(String workspace) { String path = String.format("/workspaces/%s/users", workspace); return new CollectionRequest<User>(this, User.class, path, "GET"); }
java
{ "resource": "" }
q6475
CustomFieldsBase.findById
train
public ItemRequest<CustomField> findById(String customField) { String path = String.format("/custom_fields/%s", customField); return new ItemRequest<CustomField>(this, CustomField.class, path, "GET"); }
java
{ "resource": "" }
q6476
CustomFieldsBase.findByWorkspace
train
public CollectionRequest<CustomField> findByWorkspace(String workspace) { String path = String.format("/workspaces/%s/custom_fields", workspace); return new CollectionRequest<CustomField>(this, CustomField.class, path, "GET"); }
java
{ "resource": "" }
q6477
CustomFieldsBase.update
train
public ItemRequest<CustomField> update(String customField) { String path = String.format("/custom_fields/%s", customField); return new ItemRequest<CustomField>(this, CustomField.class, path, "PUT"); }
java
{ "resource": "" }
q6478
CustomFieldsBase.delete
train
public ItemRequest<CustomField> delete(String customField) { String path = String.format("/custom_fields/%s", customField); return new ItemRequest<CustomField>(this, CustomField.class, path, "DELETE"); }
java
{ "resource": "" }
q6479
CustomFieldsBase.updateEnumOption
train
public ItemRequest<CustomField> updateEnumOption(String enumOption) { String path = String.format("/enum_options/%s", enumOption); return new ItemRequest<CustomField>(this, CustomField.class, path, "PUT"); }
java
{ "resource": "" }
q6480
CustomFieldsBase.insertEnumOption
train
public ItemRequest<CustomField> insertEnumOption(String customField) { String path = String.format("/custom_fields/%s/enum_options/insert", customField); return new ItemRequest<CustomField>(this, CustomField.class, path, "POST"); }
java
{ "resource": "" }
q6481
ProjectStatusesBase.createInProject
train
public ItemRequest<ProjectStatus> createInProject(String project) { String path = String.format("/projects/%s/project_statuses", project); return new ItemRequest<ProjectStatus>(this, ProjectStatus.class, path, "POST"); }
java
{ "resource": "" }
q6482
ProjectStatusesBase.findByProject
train
public CollectionRequest<ProjectStatus> findByProject(String project) { String path = String.format("/projects/%s/project_statuses", project); return new CollectionRequest<ProjectStatus>(this, ProjectStatus.class, path, "GET"); }
java
{ "resource": "" }
q6483
ProjectStatusesBase.findById
train
public ItemRequest<ProjectStatus> findById(String projectStatus) { String path = String.format("/project_statuses/%s", projectStatus); return new ItemRequest<ProjectStatus>(this, ProjectStatus.class, path, "GET"); }
java
{ "resource": "" }
q6484
ProjectStatusesBase.delete
train
public ItemRequest<ProjectStatus> delete(String projectStatus) { String path = String.format("/project_statuses/%s", projectStatus); return new ItemRequest<ProjectStatus>(this, ProjectStatus.class, path, "DELETE"); }
java
{ "resource": "" }
q6485
WebhooksBase.getById
train
public ItemRequest<Webhook> getById(String webhook) { String path = String.format("/webhooks/%s", webhook); return new ItemRequest<Webhook>(this, Webhook.class, path, "GET"); }
java
{ "resource": "" }
q6486
WebhooksBase.deleteById
train
public ItemRequest<Webhook> deleteById(String webhook) { String path = String.format("/webhooks/%s", webhook); return new ItemRequest<Webhook>(this, Webhook.class, path, "DELETE"); }
java
{ "resource": "" }
q6487
Events.get
train
public EventsRequest<Event> get(String resource, String sync) { return new EventsRequest<Event>(this, Event.class, "/events", "GET") .query("resource", resource) .query("sync", sync); }
java
{ "resource": "" }
q6488
ProjectMembershipsBase.findByProject
train
public CollectionRequest<ProjectMembership> findByProject(String project) { String path = String.format("/projects/%s/project_memberships", project); return new CollectionRequest<ProjectMembership>(this, ProjectMembership.class, path, "GET"); }
java
{ "resource": "" }
q6489
ProjectMembershipsBase.findById
train
public ItemRequest<ProjectMembership> findById(String projectMembership) { String path = String.format("/project_memberships/%s", projectMembership); return new ItemRequest<ProjectMembership>(this, ProjectMembership.class, path, "GET"); }
java
{ "resource": "" }
q6490
StoriesBase.findByTask
train
public CollectionRequest<Story> findByTask(String task) { String path = String.format("/tasks/%s/stories", task); return new CollectionRequest<Story>(this, Story.class, path, "GET"); }
java
{ "resource": "" }
q6491
StoriesBase.findById
train
public ItemRequest<Story> findById(String story) { String path = String.format("/stories/%s", story); return new ItemRequest<Story>(this, Story.class, path, "GET"); }
java
{ "resource": "" }
q6492
StoriesBase.update
train
public ItemRequest<Story> update(String story) { String path = String.format("/stories/%s", story); return new ItemRequest<Story>(this, Story.class, path, "PUT"); }
java
{ "resource": "" }
q6493
StoriesBase.delete
train
public ItemRequest<Story> delete(String story) { String path = String.format("/stories/%s", story); return new ItemRequest<Story>(this, Story.class, path, "DELETE"); }
java
{ "resource": "" }
q6494
WorkspacesBase.findById
train
public ItemRequest<Workspace> findById(String workspace) { String path = String.format("/workspaces/%s", workspace); return new ItemRequest<Workspace>(this, Workspace.class, path, "GET"); }
java
{ "resource": "" }
q6495
WorkspacesBase.update
train
public ItemRequest<Workspace> update(String workspace) { String path = String.format("/workspaces/%s", workspace); return new ItemRequest<Workspace>(this, Workspace.class, path, "PUT"); }
java
{ "resource": "" }
q6496
WorkspacesBase.addUser
train
public ItemRequest<Workspace> addUser(String workspace) { String path = String.format("/workspaces/%s/addUser", workspace); return new ItemRequest<Workspace>(this, Workspace.class, path, "POST"); }
java
{ "resource": "" }
q6497
WorkspacesBase.removeUser
train
public ItemRequest<Workspace> removeUser(String workspace) { String path = String.format("/workspaces/%s/removeUser", workspace); return new ItemRequest<Workspace>(this, Workspace.class, path, "POST"); }
java
{ "resource": "" }
q6498
Attachments.createOnTask
train
public ItemRequest<Attachment> createOnTask(String task, InputStream fileContent, String fileName, String fileType) { MultipartContent.Part part = new MultipartContent.Part() .setContent(new InputStreamContent(fileType, fileContent)) .setHeaders(new HttpHeaders().set( "Content-Disposition", String.format("form-data; name=\"file\"; filename=\"%s\"", fileName) // TODO: escape fileName? )); MultipartContent content = new MultipartContent() .setMediaType(new HttpMediaType("multipart/form-data").setParameter("boundary", UUID.randomUUID().toString())) .addPart(part); String path = String.format("/tasks/%s/attachments", task); return new ItemRequest<Attachment>(this, Attachment.class, path, "POST") .data(content); }
java
{ "resource": "" }
q6499
OrganizationExportsBase.findById
train
public ItemRequest<OrganizationExport> findById(String organizationExport) { String path = String.format("/organization_exports/%s", organizationExport); return new ItemRequest<OrganizationExport>(this, OrganizationExport.class, path, "GET"); }
java
{ "resource": "" }