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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
GoogleCloudPlatform/app-gradle-plugin | src/main/java/com/google/cloud/tools/gradle/appengine/standard/ExplodeWarTask.java | ExplodeWarTask.setExplodedAppDirectory | public void setExplodedAppDirectory(File explodedAppDirectory) {
this.explodedAppDirectory = explodedAppDirectory;
into(explodedAppDirectory);
preserve(
patternFilterable ->
patternFilterable.include("WEB-INF/appengine-generated/datastore-indexes-auto.xml"));
} | java | public void setExplodedAppDirectory(File explodedAppDirectory) {
this.explodedAppDirectory = explodedAppDirectory;
into(explodedAppDirectory);
preserve(
patternFilterable ->
patternFilterable.include("WEB-INF/appengine-generated/datastore-indexes-auto.xml"));
} | [
"public",
"void",
"setExplodedAppDirectory",
"(",
"File",
"explodedAppDirectory",
")",
"{",
"this",
".",
"explodedAppDirectory",
"=",
"explodedAppDirectory",
";",
"into",
"(",
"explodedAppDirectory",
")",
";",
"preserve",
"(",
"patternFilterable",
"->",
"patternFilterab... | Sets the output directory of Sync Task and preserves the setting so it can be recovered later
via getter. | [
"Sets",
"the",
"output",
"directory",
"of",
"Sync",
"Task",
"and",
"preserves",
"the",
"setting",
"so",
"it",
"can",
"be",
"recovered",
"later",
"via",
"getter",
"."
] | 86d44fe0668e28f55eee9e002d5e19f0041efa3c | https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/86d44fe0668e28f55eee9e002d5e19f0041efa3c/src/main/java/com/google/cloud/tools/gradle/appengine/standard/ExplodeWarTask.java#L37-L43 | train |
GoogleCloudPlatform/app-gradle-plugin | src/main/java/com/google/cloud/tools/gradle/appengine/appyaml/StageAppYamlExtension.java | StageAppYamlExtension.getExtraFilesDirectoriesAsInputFiles | @Optional
@InputFiles
public FileCollection getExtraFilesDirectoriesAsInputFiles() {
if (extraFilesDirectories == null) {
return null;
}
FileCollection files = project.files();
for (File directory : extraFilesDirectories) {
files = files.plus(project.fileTree(directory));
}
return files;
} | java | @Optional
@InputFiles
public FileCollection getExtraFilesDirectoriesAsInputFiles() {
if (extraFilesDirectories == null) {
return null;
}
FileCollection files = project.files();
for (File directory : extraFilesDirectories) {
files = files.plus(project.fileTree(directory));
}
return files;
} | [
"@",
"Optional",
"@",
"InputFiles",
"public",
"FileCollection",
"getExtraFilesDirectoriesAsInputFiles",
"(",
")",
"{",
"if",
"(",
"extraFilesDirectories",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"FileCollection",
"files",
"=",
"project",
".",
"files",
... | This method is purely for incremental build calculations. | [
"This",
"method",
"is",
"purely",
"for",
"incremental",
"build",
"calculations",
"."
] | 86d44fe0668e28f55eee9e002d5e19f0041efa3c | https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/86d44fe0668e28f55eee9e002d5e19f0041efa3c/src/main/java/com/google/cloud/tools/gradle/appengine/appyaml/StageAppYamlExtension.java#L87-L98 | train |
GoogleCloudPlatform/app-gradle-plugin | src/main/java/com/google/cloud/tools/gradle/appengine/core/AppEngineCorePluginConfiguration.java | AppEngineCorePluginConfiguration.configureCoreProperties | public void configureCoreProperties(
Project project,
AppEngineCoreExtensionProperties appEngineCoreExtensionProperties,
String taskGroup,
boolean requiresAppEngineJava) {
project
.getLogger()
.warn(
"WARNING: You are a using release candidate "
+ getClass().getPackage().getImplementationVersion()
+ ". Behavior of this plugin has changed since 1.3.5. Please see release notes at: "
+ "https://github.com/GoogleCloudPlatform/app-gradle-plugin.");
project
.getLogger()
.warn(
"Missing a feature? Can't get it to work?, please file a bug at: "
+ "https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues.");
checkGradleVersion();
this.project = project;
this.taskGroup = taskGroup;
this.toolsExtension = appEngineCoreExtensionProperties.getTools();
this.deployExtension = appEngineCoreExtensionProperties.getDeploy();
this.requiresAppEngineJava = requiresAppEngineJava;
configureFactories();
createDownloadCloudSdkTask();
createCheckCloudSdkTask();
createLoginTask();
createDeployTask();
createDeployCronTask();
createDeployDispatchTask();
createDeployDosTask();
createDeployIndexTask();
createDeployQueueTask();
createDeployAllTask();
createShowConfigurationTask();
} | java | public void configureCoreProperties(
Project project,
AppEngineCoreExtensionProperties appEngineCoreExtensionProperties,
String taskGroup,
boolean requiresAppEngineJava) {
project
.getLogger()
.warn(
"WARNING: You are a using release candidate "
+ getClass().getPackage().getImplementationVersion()
+ ". Behavior of this plugin has changed since 1.3.5. Please see release notes at: "
+ "https://github.com/GoogleCloudPlatform/app-gradle-plugin.");
project
.getLogger()
.warn(
"Missing a feature? Can't get it to work?, please file a bug at: "
+ "https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues.");
checkGradleVersion();
this.project = project;
this.taskGroup = taskGroup;
this.toolsExtension = appEngineCoreExtensionProperties.getTools();
this.deployExtension = appEngineCoreExtensionProperties.getDeploy();
this.requiresAppEngineJava = requiresAppEngineJava;
configureFactories();
createDownloadCloudSdkTask();
createCheckCloudSdkTask();
createLoginTask();
createDeployTask();
createDeployCronTask();
createDeployDispatchTask();
createDeployDosTask();
createDeployIndexTask();
createDeployQueueTask();
createDeployAllTask();
createShowConfigurationTask();
} | [
"public",
"void",
"configureCoreProperties",
"(",
"Project",
"project",
",",
"AppEngineCoreExtensionProperties",
"appEngineCoreExtensionProperties",
",",
"String",
"taskGroup",
",",
"boolean",
"requiresAppEngineJava",
")",
"{",
"project",
".",
"getLogger",
"(",
")",
".",
... | Configure core tasks for appengine app.yaml and appengine-web.xml based project plugins. | [
"Configure",
"core",
"tasks",
"for",
"appengine",
"app",
".",
"yaml",
"and",
"appengine",
"-",
"web",
".",
"xml",
"based",
"project",
"plugins",
"."
] | 86d44fe0668e28f55eee9e002d5e19f0041efa3c | https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/86d44fe0668e28f55eee9e002d5e19f0041efa3c/src/main/java/com/google/cloud/tools/gradle/appengine/core/AppEngineCorePluginConfiguration.java#L59-L97 | train |
GoogleCloudPlatform/app-gradle-plugin | src/main/java/com/google/cloud/tools/gradle/appengine/util/AppEngineWebXml.java | AppEngineWebXml.isVm | public boolean isVm() {
try {
XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "/appengine-web-app/vm/text()='true'";
return (Boolean) xpath.evaluate(expression, document, XPathConstants.BOOLEAN);
} catch (XPathExpressionException e) {
throw new GradleException("XPath evaluation failed on appengine-web.xml", e);
}
} | java | public boolean isVm() {
try {
XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "/appengine-web-app/vm/text()='true'";
return (Boolean) xpath.evaluate(expression, document, XPathConstants.BOOLEAN);
} catch (XPathExpressionException e) {
throw new GradleException("XPath evaluation failed on appengine-web.xml", e);
}
} | [
"public",
"boolean",
"isVm",
"(",
")",
"{",
"try",
"{",
"XPath",
"xpath",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
".",
"newXPath",
"(",
")",
";",
"String",
"expression",
"=",
"\"/appengine-web-app/vm/text()='true'\"",
";",
"return",
"(",
"Boolean",
... | Check if vm = true. | [
"Check",
"if",
"vm",
"=",
"true",
"."
] | 86d44fe0668e28f55eee9e002d5e19f0041efa3c | https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/86d44fe0668e28f55eee9e002d5e19f0041efa3c/src/main/java/com/google/cloud/tools/gradle/appengine/util/AppEngineWebXml.java#L53-L61 | train |
GoogleCloudPlatform/app-gradle-plugin | src/main/java/com/google/cloud/tools/gradle/appengine/core/ManagedCloudSdkFactory.java | ManagedCloudSdkFactory.newManagedSdk | public ManagedCloudSdk newManagedSdk()
throws UnsupportedOsException, BadCloudSdkVersionException {
if (Strings.isNullOrEmpty(version)) {
return ManagedCloudSdk.newManagedSdk();
} else {
return ManagedCloudSdk.newManagedSdk(new Version(version));
}
} | java | public ManagedCloudSdk newManagedSdk()
throws UnsupportedOsException, BadCloudSdkVersionException {
if (Strings.isNullOrEmpty(version)) {
return ManagedCloudSdk.newManagedSdk();
} else {
return ManagedCloudSdk.newManagedSdk(new Version(version));
}
} | [
"public",
"ManagedCloudSdk",
"newManagedSdk",
"(",
")",
"throws",
"UnsupportedOsException",
",",
"BadCloudSdkVersionException",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"version",
")",
")",
"{",
"return",
"ManagedCloudSdk",
".",
"newManagedSdk",
"(",
")... | Build a new ManagedCloudSdk from a given version. | [
"Build",
"a",
"new",
"ManagedCloudSdk",
"from",
"a",
"given",
"version",
"."
] | 86d44fe0668e28f55eee9e002d5e19f0041efa3c | https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/86d44fe0668e28f55eee9e002d5e19f0041efa3c/src/main/java/com/google/cloud/tools/gradle/appengine/core/ManagedCloudSdkFactory.java#L35-L42 | train |
GoogleCloudPlatform/app-gradle-plugin | src/main/java/com/google/cloud/tools/gradle/appengine/util/ExtensionUtil.java | ExtensionUtil.get | @SuppressWarnings("unchecked")
public <T> T get(String... path) {
ExtensionAware root = searchRoot;
for (String name : path) {
ExtensionContainer children = root.getExtensions();
root = (ExtensionAware) children.getByName(name);
}
return (T) root; // this is potentially unchecked.
} | java | @SuppressWarnings("unchecked")
public <T> T get(String... path) {
ExtensionAware root = searchRoot;
for (String name : path) {
ExtensionContainer children = root.getExtensions();
root = (ExtensionAware) children.getByName(name);
}
return (T) root; // this is potentially unchecked.
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"...",
"path",
")",
"{",
"ExtensionAware",
"root",
"=",
"searchRoot",
";",
"for",
"(",
"String",
"name",
":",
"path",
")",
"{",
"ExtensionContainer",
... | Get an extension by it's path, potentially will throw all kinds of exceptions. Be very careful. | [
"Get",
"an",
"extension",
"by",
"it",
"s",
"path",
"potentially",
"will",
"throw",
"all",
"kinds",
"of",
"exceptions",
".",
"Be",
"very",
"careful",
"."
] | 86d44fe0668e28f55eee9e002d5e19f0041efa3c | https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/86d44fe0668e28f55eee9e002d5e19f0041efa3c/src/main/java/com/google/cloud/tools/gradle/appengine/util/ExtensionUtil.java#L34-L42 | train |
GoogleCloudPlatform/app-gradle-plugin | src/main/java/com/google/cloud/tools/gradle/appengine/sourcecontext/SourceContextPlugin.java | SourceContextPlugin.configureArchiveTask | private void configureArchiveTask(AbstractArchiveTask archiveTask) {
if (archiveTask == null) {
return;
}
archiveTask.dependsOn("_createSourceContext");
archiveTask.from(extension.getOutputDirectory(), copySpec -> copySpec.into("WEB-INF/classes"));
} | java | private void configureArchiveTask(AbstractArchiveTask archiveTask) {
if (archiveTask == null) {
return;
}
archiveTask.dependsOn("_createSourceContext");
archiveTask.from(extension.getOutputDirectory(), copySpec -> copySpec.into("WEB-INF/classes"));
} | [
"private",
"void",
"configureArchiveTask",
"(",
"AbstractArchiveTask",
"archiveTask",
")",
"{",
"if",
"(",
"archiveTask",
"==",
"null",
")",
"{",
"return",
";",
"}",
"archiveTask",
".",
"dependsOn",
"(",
"\"_createSourceContext\"",
")",
";",
"archiveTask",
".",
... | inject source-context into the META-INF directory of a jar or war | [
"inject",
"source",
"-",
"context",
"into",
"the",
"META",
"-",
"INF",
"directory",
"of",
"a",
"jar",
"or",
"war"
] | 86d44fe0668e28f55eee9e002d5e19f0041efa3c | https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/86d44fe0668e28f55eee9e002d5e19f0041efa3c/src/main/java/com/google/cloud/tools/gradle/appengine/sourcecontext/SourceContextPlugin.java#L96-L102 | train |
dmart28/reveno | reveno-metrics/src/main/java/org/reveno/atp/metrics/impl/PickledGraphite.java | PickledGraphite.writeMetrics | private void writeMetrics() throws IOException {
if (metrics.size() > 0) {
try {
byte[] payload = pickleMetrics(metrics);
byte[] header = ByteBuffer.allocate(4).putInt(payload.length).array();
OutputStream outputStream = socket.getOutputStream();
outputStream.write(header);
outputStream.write(payload);
outputStream.flush();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Wrote {} metrics", metrics.size());
}
} catch (IOException e) {
this.failures++;
throw e;
} finally {
// if there was an error, we might miss some data. for now, drop those on the floor and
// try to keep going.
metrics.clear();
}
}
} | java | private void writeMetrics() throws IOException {
if (metrics.size() > 0) {
try {
byte[] payload = pickleMetrics(metrics);
byte[] header = ByteBuffer.allocate(4).putInt(payload.length).array();
OutputStream outputStream = socket.getOutputStream();
outputStream.write(header);
outputStream.write(payload);
outputStream.flush();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Wrote {} metrics", metrics.size());
}
} catch (IOException e) {
this.failures++;
throw e;
} finally {
// if there was an error, we might miss some data. for now, drop those on the floor and
// try to keep going.
metrics.clear();
}
}
} | [
"private",
"void",
"writeMetrics",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"metrics",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"payload",
"=",
"pickleMetrics",
"(",
"metrics",
")",
";",
"byte",
"[",
"]",
"... | 1. Run the pickler script to package all the pending metrics into a single message
2. Send the message to graphite
3. Clear out the list of metrics | [
"1",
".",
"Run",
"the",
"pickler",
"script",
"to",
"package",
"all",
"the",
"pending",
"metrics",
"into",
"a",
"single",
"message",
"2",
".",
"Send",
"the",
"message",
"to",
"graphite",
"3",
".",
"Clear",
"out",
"the",
"list",
"of",
"metrics"
] | 33617651fab8f0c0af70e7d3af7273cdbfe164d2 | https://github.com/dmart28/reveno/blob/33617651fab8f0c0af70e7d3af7273cdbfe164d2/reveno-metrics/src/main/java/org/reveno/atp/metrics/impl/PickledGraphite.java#L224-L248 | train |
dmart28/reveno | reveno-core/src/main/java/org/reveno/atp/core/restore/DefaultSystemStateRestorer.java | DefaultSystemStateRestorer.restore | @Override
public SystemState restore(long fromVersion, TxRepository repository) {
workflowContext.repository(repository);
final long snapshotTransactionId = repository.getO(SystemInfo.class, 0L).orElse(new SystemInfo(0L)).lastTransactionId;
final long[] transactionId = {snapshotTransactionId};
try (InputProcessor processor = new DefaultInputProcessor(journalStorage)) {
processor.process(fromVersion, b -> {
EventsCommitInfo e = eventsContext.serializer().deserialize(eventsContext.eventsCommitBuilder(), b);
eventBus.processNextEvent(e);
}, JournalType.EVENTS);
processor.process(fromVersion, b -> {
TransactionCommitInfo tx = workflowContext.serializer().deserialize(workflowContext.transactionCommitBuilder(), b);
if (tx.transactionId() > transactionId[0] || tx.transactionId() == snapshotTransactionId) {
transactionId[0] = tx.transactionId();
workflowEngine.getPipe().executeRestore(eventBus, tx);
} else if (LOG.isDebugEnabled()) {
LOG.debug("Transaction ID {} less than last Transaction ID {}", tx.transactionId(), transactionId[0]);
}
}, JournalType.TRANSACTIONS);
} catch (Throwable t) {
LOG.error("restore", t);
throw new RuntimeException(t);
}
workflowEngine.getPipe().sync();
workflowContext.eventPublisher().getPipe().sync();
return new SystemState(transactionId[0]);
} | java | @Override
public SystemState restore(long fromVersion, TxRepository repository) {
workflowContext.repository(repository);
final long snapshotTransactionId = repository.getO(SystemInfo.class, 0L).orElse(new SystemInfo(0L)).lastTransactionId;
final long[] transactionId = {snapshotTransactionId};
try (InputProcessor processor = new DefaultInputProcessor(journalStorage)) {
processor.process(fromVersion, b -> {
EventsCommitInfo e = eventsContext.serializer().deserialize(eventsContext.eventsCommitBuilder(), b);
eventBus.processNextEvent(e);
}, JournalType.EVENTS);
processor.process(fromVersion, b -> {
TransactionCommitInfo tx = workflowContext.serializer().deserialize(workflowContext.transactionCommitBuilder(), b);
if (tx.transactionId() > transactionId[0] || tx.transactionId() == snapshotTransactionId) {
transactionId[0] = tx.transactionId();
workflowEngine.getPipe().executeRestore(eventBus, tx);
} else if (LOG.isDebugEnabled()) {
LOG.debug("Transaction ID {} less than last Transaction ID {}", tx.transactionId(), transactionId[0]);
}
}, JournalType.TRANSACTIONS);
} catch (Throwable t) {
LOG.error("restore", t);
throw new RuntimeException(t);
}
workflowEngine.getPipe().sync();
workflowContext.eventPublisher().getPipe().sync();
return new SystemState(transactionId[0]);
} | [
"@",
"Override",
"public",
"SystemState",
"restore",
"(",
"long",
"fromVersion",
",",
"TxRepository",
"repository",
")",
"{",
"workflowContext",
".",
"repository",
"(",
"repository",
")",
";",
"final",
"long",
"snapshotTransactionId",
"=",
"repository",
".",
"getO... | Reads all journals and restores all previous system mode state from them
into the given repository. Also, re-publish all events that were not sent
by the reason of failure, abortion, etc.
@param repository into which latest state of model will be loaded
@return information about last system state, such as last transactionId, etc. | [
"Reads",
"all",
"journals",
"and",
"restores",
"all",
"previous",
"system",
"mode",
"state",
"from",
"them",
"into",
"the",
"given",
"repository",
".",
"Also",
"re",
"-",
"publish",
"all",
"events",
"that",
"were",
"not",
"sent",
"by",
"the",
"reason",
"of... | 33617651fab8f0c0af70e7d3af7273cdbfe164d2 | https://github.com/dmart28/reveno/blob/33617651fab8f0c0af70e7d3af7273cdbfe164d2/reveno-core/src/main/java/org/reveno/atp/core/restore/DefaultSystemStateRestorer.java#L39-L65 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/DbUtils.java | DbUtils.printStackTrace | public static void printStackTrace(SQLException e, PrintWriter pw) {
SQLException next = e;
while (next != null) {
next.printStackTrace(pw);
next = next.getNextException();
if (next != null) {
pw.println("Next SQLException:");
}
}
} | java | public static void printStackTrace(SQLException e, PrintWriter pw) {
SQLException next = e;
while (next != null) {
next.printStackTrace(pw);
next = next.getNextException();
if (next != null) {
pw.println("Next SQLException:");
}
}
} | [
"public",
"static",
"void",
"printStackTrace",
"(",
"SQLException",
"e",
",",
"PrintWriter",
"pw",
")",
"{",
"SQLException",
"next",
"=",
"e",
";",
"while",
"(",
"next",
"!=",
"null",
")",
"{",
"next",
".",
"printStackTrace",
"(",
"pw",
")",
";",
"next",... | Print the stack trace for a SQLException to a
specified PrintWriter.
@param e SQLException to print stack trace of
@param pw PrintWriter to print to | [
"Print",
"the",
"stack",
"trace",
"for",
"a",
"SQLException",
"to",
"a",
"specified",
"PrintWriter",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/DbUtils.java#L207-L217 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/DbUtils.java | DbUtils.printWarnings | public static void printWarnings(Connection conn, PrintWriter pw) {
if (conn != null) {
try {
printStackTrace(conn.getWarnings(), pw);
} catch (SQLException e) {
printStackTrace(e, pw);
}
}
} | java | public static void printWarnings(Connection conn, PrintWriter pw) {
if (conn != null) {
try {
printStackTrace(conn.getWarnings(), pw);
} catch (SQLException e) {
printStackTrace(e, pw);
}
}
} | [
"public",
"static",
"void",
"printWarnings",
"(",
"Connection",
"conn",
",",
"PrintWriter",
"pw",
")",
"{",
"if",
"(",
"conn",
"!=",
"null",
")",
"{",
"try",
"{",
"printStackTrace",
"(",
"conn",
".",
"getWarnings",
"(",
")",
",",
"pw",
")",
";",
"}",
... | Print warnings on a Connection to a specified PrintWriter.
@param conn Connection to print warnings from
@param pw PrintWriter to print to | [
"Print",
"warnings",
"on",
"a",
"Connection",
"to",
"a",
"specified",
"PrintWriter",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/DbUtils.java#L234-L242 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapSocketConnector.java | BootstrapSocketConnector.connect | public XComponentContext connect(String host, int port) throws BootstrapException {
String unoConnectString = "uno:socket,host=" + host + ",port=" + port + ";urp;StarOffice.ComponentContext";
return connect(unoConnectString);
} | java | public XComponentContext connect(String host, int port) throws BootstrapException {
String unoConnectString = "uno:socket,host=" + host + ",port=" + port + ";urp;StarOffice.ComponentContext";
return connect(unoConnectString);
} | [
"public",
"XComponentContext",
"connect",
"(",
"String",
"host",
",",
"int",
"port",
")",
"throws",
"BootstrapException",
"{",
"String",
"unoConnectString",
"=",
"\"uno:socket,host=\"",
"+",
"host",
"+",
"\",port=\"",
"+",
"port",
"+",
"\";urp;StarOffice.ComponentCont... | Connects to an OOo server using the specified host and port for the
socket and returns a component context for using the connection to the
OOo server.
@param host The host
@param port The port
@return The component context | [
"Connects",
"to",
"an",
"OOo",
"server",
"using",
"the",
"specified",
"host",
"and",
"port",
"for",
"the",
"socket",
"and",
"returns",
"a",
"component",
"context",
"for",
"using",
"the",
"connection",
"to",
"the",
"OOo",
"server",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapSocketConnector.java#L45-L48 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/xls/AreaDependencyManager.java | AreaDependencyManager.addDependency | public void addDependency(Area main, Area dependent) {
List<Area> set = areasDependency.get(main);
if (set == null) {
set = new ArrayList<Area>();
areasDependency.put(main, set);
}
set.add(dependent);
} | java | public void addDependency(Area main, Area dependent) {
List<Area> set = areasDependency.get(main);
if (set == null) {
set = new ArrayList<Area>();
areasDependency.put(main, set);
}
set.add(dependent);
} | [
"public",
"void",
"addDependency",
"(",
"Area",
"main",
",",
"Area",
"dependent",
")",
"{",
"List",
"<",
"Area",
">",
"set",
"=",
"areasDependency",
".",
"get",
"(",
"main",
")",
";",
"if",
"(",
"set",
"==",
"null",
")",
"{",
"set",
"=",
"new",
"Ar... | Adds area dependency for formula calculations
@param main Main area
@param dependent Dependent area | [
"Adds",
"area",
"dependency",
"for",
"formula",
"calculations"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/xls/AreaDependencyManager.java#L40-L48 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/OOServer.java | OOServer.kill | public synchronized void kill() {
if (oooProcess != null) {
log.info("OOServer is killing office instance with port {}", port);
List<Long> pids = processManager.findPid(host, port);
processManager.kill(oooProcess, pids);
oooProcess = null;
}
} | java | public synchronized void kill() {
if (oooProcess != null) {
log.info("OOServer is killing office instance with port {}", port);
List<Long> pids = processManager.findPid(host, port);
processManager.kill(oooProcess, pids);
oooProcess = null;
}
} | [
"public",
"synchronized",
"void",
"kill",
"(",
")",
"{",
"if",
"(",
"oooProcess",
"!=",
"null",
")",
"{",
"log",
".",
"info",
"(",
"\"OOServer is killing office instance with port {}\"",
",",
"port",
")",
";",
"List",
"<",
"Long",
">",
"pids",
"=",
"processM... | Kills the OOo server process from the previous start.
If there has been no previous start of the OOo server, the kill does
nothing.
If there has been a previous start, kill destroys the process. | [
"Kills",
"the",
"OOo",
"server",
"process",
"from",
"the",
"previous",
"start",
".",
"If",
"there",
"has",
"been",
"no",
"previous",
"start",
"of",
"the",
"OOo",
"server",
"the",
"kill",
"does",
"nothing",
".",
"If",
"there",
"has",
"been",
"a",
"previou... | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/OOServer.java#L130-L137 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java | BootstrapConnector.connect | public XComponentContext connect(String oooConnectionString) throws BootstrapException {
this.oooConnectionString = oooConnectionString;
XComponentContext xContext = null;
try {
// get local context
XComponentContext xLocalContext = getLocalContext();
oooServer.start();
// initial service manager
XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();
if ( xLocalServiceManager == null )
throw new BootstrapException("no initial service manager!");
// create a URL resolver
XUnoUrlResolver xUrlResolver = UnoUrlResolver.create(xLocalContext);
// wait until office is started
for (int i = 0;; ++i) {
try {
xContext = getRemoteContext(xUrlResolver);
break;
} catch ( NoConnectException ex ) {
// Wait 500 ms, then try to connect again, but do not wait
// longer than 5 sec total:
if (i == 10) {
throw new BootstrapException(ex);
}
Thread.sleep(500);
}
}
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new BootstrapException(e);
}
return xContext;
} | java | public XComponentContext connect(String oooConnectionString) throws BootstrapException {
this.oooConnectionString = oooConnectionString;
XComponentContext xContext = null;
try {
// get local context
XComponentContext xLocalContext = getLocalContext();
oooServer.start();
// initial service manager
XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();
if ( xLocalServiceManager == null )
throw new BootstrapException("no initial service manager!");
// create a URL resolver
XUnoUrlResolver xUrlResolver = UnoUrlResolver.create(xLocalContext);
// wait until office is started
for (int i = 0;; ++i) {
try {
xContext = getRemoteContext(xUrlResolver);
break;
} catch ( NoConnectException ex ) {
// Wait 500 ms, then try to connect again, but do not wait
// longer than 5 sec total:
if (i == 10) {
throw new BootstrapException(ex);
}
Thread.sleep(500);
}
}
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new BootstrapException(e);
}
return xContext;
} | [
"public",
"XComponentContext",
"connect",
"(",
"String",
"oooConnectionString",
")",
"throws",
"BootstrapException",
"{",
"this",
".",
"oooConnectionString",
"=",
"oooConnectionString",
";",
"XComponentContext",
"xContext",
"=",
"null",
";",
"try",
"{",
"// get local co... | Connects to an OOo server using the specified accept option and
connection string and returns a component context for using the
connection to the OOo server.
The accept option and the connection string should match to get a
connection. OOo provides to different types of connections:
1) The socket connection
2) The named pipe connection
To create a socket connection a host and port must be provided.
For example using the host "localhost" and the port "8100" the
accept option and connection string looks like this:
- accept option : -accept=socket,host=localhost,port=8100;urp;
- connection string: uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext
To create a named pipe a pipe name must be provided. For example using
the pipe name "oooPipe" the accept option and connection string looks
like this:
- accept option : -accept=pipe,name=oooPipe;urp;
- connection string: uno:pipe,name=oooPipe;urp;StarOffice.ComponentContext
@param oooConnectionString The connection string
@return The component context | [
"Connects",
"to",
"an",
"OOo",
"server",
"using",
"the",
"specified",
"accept",
"option",
"and",
"connection",
"string",
"and",
"returns",
"a",
"component",
"context",
"for",
"using",
"the",
"connection",
"to",
"the",
"OOo",
"server",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java#L94-L133 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java | BootstrapConnector.disconnect | public void disconnect() {
if (oooConnectionString == null)
return;
// call office to terminate itself
try {
// get local context
XComponentContext xLocalContext = getLocalContext();
// create a URL resolver
XUnoUrlResolver xUrlResolver = UnoUrlResolver.create(xLocalContext);
// get remote context
XComponentContext xRemoteContext = getRemoteContext(xUrlResolver);
// get desktop to terminate office
Object desktop = xRemoteContext.getServiceManager().createInstanceWithContext("com.sun.star.frame.Desktop",xRemoteContext);
XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, desktop);
xDesktop.terminate();
}
catch (Exception e) {
// Bad luck, unable to terminate office
}
oooServer.kill();
oooConnectionString = null;
} | java | public void disconnect() {
if (oooConnectionString == null)
return;
// call office to terminate itself
try {
// get local context
XComponentContext xLocalContext = getLocalContext();
// create a URL resolver
XUnoUrlResolver xUrlResolver = UnoUrlResolver.create(xLocalContext);
// get remote context
XComponentContext xRemoteContext = getRemoteContext(xUrlResolver);
// get desktop to terminate office
Object desktop = xRemoteContext.getServiceManager().createInstanceWithContext("com.sun.star.frame.Desktop",xRemoteContext);
XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, desktop);
xDesktop.terminate();
}
catch (Exception e) {
// Bad luck, unable to terminate office
}
oooServer.kill();
oooConnectionString = null;
} | [
"public",
"void",
"disconnect",
"(",
")",
"{",
"if",
"(",
"oooConnectionString",
"==",
"null",
")",
"return",
";",
"// call office to terminate itself",
"try",
"{",
"// get local context",
"XComponentContext",
"xLocalContext",
"=",
"getLocalContext",
"(",
")",
";",
... | Disconnects from an OOo server using the connection string from the
previous connect.
If there has been no previous connect, the disconnects does nothing.
If there has been a previous connect, disconnect tries to terminate
the OOo server and kills the OOo server process the connect started. | [
"Disconnects",
"from",
"an",
"OOo",
"server",
"using",
"the",
"connection",
"string",
"from",
"the",
"previous",
"connect",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java#L144-L171 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java | BootstrapConnector.getLocalContext | protected XComponentContext getLocalContext() throws BootstrapException, Exception {
XComponentContext xLocalContext = Bootstrap.createInitialComponentContext(null);
if (xLocalContext == null) {
throw new BootstrapException("no local component context!");
}
return xLocalContext;
} | java | protected XComponentContext getLocalContext() throws BootstrapException, Exception {
XComponentContext xLocalContext = Bootstrap.createInitialComponentContext(null);
if (xLocalContext == null) {
throw new BootstrapException("no local component context!");
}
return xLocalContext;
} | [
"protected",
"XComponentContext",
"getLocalContext",
"(",
")",
"throws",
"BootstrapException",
",",
"Exception",
"{",
"XComponentContext",
"xLocalContext",
"=",
"Bootstrap",
".",
"createInitialComponentContext",
"(",
"null",
")",
";",
"if",
"(",
"xLocalContext",
"==",
... | Create default local component context.
@return The default local component context | [
"Create",
"default",
"local",
"component",
"context",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java#L178-L185 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java | BootstrapConnector.getRemoteContext | protected XComponentContext getRemoteContext(XUnoUrlResolver xUrlResolver) throws BootstrapException, ConnectionSetupException, IllegalArgumentException, NoConnectException {
Object context = xUrlResolver.resolve(oooConnectionString);
XComponentContext xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, context);
if (xContext == null) {
throw new BootstrapException("no component context!");
}
return xContext;
} | java | protected XComponentContext getRemoteContext(XUnoUrlResolver xUrlResolver) throws BootstrapException, ConnectionSetupException, IllegalArgumentException, NoConnectException {
Object context = xUrlResolver.resolve(oooConnectionString);
XComponentContext xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, context);
if (xContext == null) {
throw new BootstrapException("no component context!");
}
return xContext;
} | [
"protected",
"XComponentContext",
"getRemoteContext",
"(",
"XUnoUrlResolver",
"xUrlResolver",
")",
"throws",
"BootstrapException",
",",
"ConnectionSetupException",
",",
"IllegalArgumentException",
",",
"NoConnectException",
"{",
"Object",
"context",
"=",
"xUrlResolver",
".",
... | Try to connect to office.
@return The remote component context | [
"Try",
"to",
"connect",
"to",
"office",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/doc/connector/BootstrapConnector.java#L192-L200 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/jasper/JRBandDataDataSource.java | JRBandDataDataSource.next | @Override
public boolean next() throws JRException {
List<BandData> children = currentBand.getChildrenList();
if (children != null && !children.isEmpty() && !visitedBands.containsKey(currentBand)) {
currentIterator = children.iterator();
visitedBands.put(currentBand, currentIterator);
} else if (currentIterator == null) {
currentIterator = Collections.singletonList(currentBand).iterator();
}
if (currentIterator.hasNext()) {
currentBand = currentIterator.next();
if (readBands.contains(currentBand) || currentBand.getData().isEmpty())
return next();
return true;
} else {
BandData parentBand = currentBand.getParentBand();
currentBand = parentBand;
currentIterator = visitedBands.get(parentBand);
if (parentBand == null || parentBand.equals(root))
return false;
return next();
}
} | java | @Override
public boolean next() throws JRException {
List<BandData> children = currentBand.getChildrenList();
if (children != null && !children.isEmpty() && !visitedBands.containsKey(currentBand)) {
currentIterator = children.iterator();
visitedBands.put(currentBand, currentIterator);
} else if (currentIterator == null) {
currentIterator = Collections.singletonList(currentBand).iterator();
}
if (currentIterator.hasNext()) {
currentBand = currentIterator.next();
if (readBands.contains(currentBand) || currentBand.getData().isEmpty())
return next();
return true;
} else {
BandData parentBand = currentBand.getParentBand();
currentBand = parentBand;
currentIterator = visitedBands.get(parentBand);
if (parentBand == null || parentBand.equals(root))
return false;
return next();
}
} | [
"@",
"Override",
"public",
"boolean",
"next",
"(",
")",
"throws",
"JRException",
"{",
"List",
"<",
"BandData",
">",
"children",
"=",
"currentBand",
".",
"getChildrenList",
"(",
")",
";",
"if",
"(",
"children",
"!=",
"null",
"&&",
"!",
"children",
".",
"i... | Maintains visitedBands to continue bypass on the same
level after return from deeper level of hierarchy.
Creates iterator for each level. | [
"Maintains",
"visitedBands",
"to",
"continue",
"bypass",
"on",
"the",
"same",
"level",
"after",
"return",
"from",
"deeper",
"level",
"of",
"hierarchy",
".",
"Creates",
"iterator",
"for",
"each",
"level",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/jasper/JRBandDataDataSource.java#L54-L81 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/jasper/JRBandDataDataSource.java | JRBandDataDataSource.subDataSource | public JRBandDataDataSource subDataSource(String bandName) {
if (containsVisitedBand(bandName))
return null;
BandData newParentBand = createNewBand(bandName);
currentBand = root;
currentIterator = root.getChildrenList().iterator();
visitedBands.put(root, currentIterator);
return new JRBandDataDataSource(newParentBand);
} | java | public JRBandDataDataSource subDataSource(String bandName) {
if (containsVisitedBand(bandName))
return null;
BandData newParentBand = createNewBand(bandName);
currentBand = root;
currentIterator = root.getChildrenList().iterator();
visitedBands.put(root, currentIterator);
return new JRBandDataDataSource(newParentBand);
} | [
"public",
"JRBandDataDataSource",
"subDataSource",
"(",
"String",
"bandName",
")",
"{",
"if",
"(",
"containsVisitedBand",
"(",
"bandName",
")",
")",
"return",
"null",
";",
"BandData",
"newParentBand",
"=",
"createNewBand",
"(",
"bandName",
")",
";",
"currentBand",... | Search for first level children band with specified name
and return new datasource with this band as root element. | [
"Search",
"for",
"first",
"level",
"children",
"band",
"with",
"specified",
"name",
"and",
"return",
"new",
"datasource",
"with",
"this",
"band",
"as",
"root",
"element",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/jasper/JRBandDataDataSource.java#L99-L110 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java | QueryRunner.query | public <T> T query(Connection conn, String sql, Object param,
ResultSetHandler<T> rsh) throws SQLException {
return this.query(conn, sql, new Object[] { param }, rsh);
} | java | public <T> T query(Connection conn, String sql, Object param,
ResultSetHandler<T> rsh) throws SQLException {
return this.query(conn, sql, new Object[] { param }, rsh);
} | [
"public",
"<",
"T",
">",
"T",
"query",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"param",
",",
"ResultSetHandler",
"<",
"T",
">",
"rsh",
")",
"throws",
"SQLException",
"{",
"return",
"this",
".",
"query",
"(",
"conn",
",",
"sql",
... | Execute an SQL SELECT query with a single replacement parameter. The
caller is responsible for closing the connection.
@param conn The connection to execute the query in.
@param sql The query to execute.
@param param The replacement parameter.
@param rsh The handler that converts the results into an object.
@return The object returned by the handler.
@throws java.sql.SQLException if a database access error occurs | [
"Execute",
"an",
"SQL",
"SELECT",
"query",
"with",
"a",
"single",
"replacement",
"parameter",
".",
"The",
"caller",
"is",
"responsible",
"for",
"closing",
"the",
"connection",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java#L265-L269 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java | QueryRunner.query | public <T> T query(Connection conn, String sql, Object[] params,
ResultSetHandler<T> rsh) throws SQLException {
PreparedStatement stmt = null;
ResultSet rs = null;
T result = null;
try {
stmt = this.prepareStatement(conn, sql);
this.fillStatement(stmt, params);
rs = this.wrap(stmt.executeQuery());
result = rsh.handle(rs);
} catch (SQLException e) {
this.rethrow(e, sql, params);
} finally {
try {
close(rs);
} finally {
close(stmt);
}
}
return result;
} | java | public <T> T query(Connection conn, String sql, Object[] params,
ResultSetHandler<T> rsh) throws SQLException {
PreparedStatement stmt = null;
ResultSet rs = null;
T result = null;
try {
stmt = this.prepareStatement(conn, sql);
this.fillStatement(stmt, params);
rs = this.wrap(stmt.executeQuery());
result = rsh.handle(rs);
} catch (SQLException e) {
this.rethrow(e, sql, params);
} finally {
try {
close(rs);
} finally {
close(stmt);
}
}
return result;
} | [
"public",
"<",
"T",
">",
"T",
"query",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"[",
"]",
"params",
",",
"ResultSetHandler",
"<",
"T",
">",
"rsh",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
... | Execute an SQL SELECT query with replacement parameters. The
caller is responsible for closing the connection.
@param conn The connection to execute the query in.
@param sql The query to execute.
@param params The replacement parameters.
@param rsh The handler that converts the results into an object.
@return The object returned by the handler.
@throws java.sql.SQLException if a database access error occurs | [
"Execute",
"an",
"SQL",
"SELECT",
"query",
"with",
"replacement",
"parameters",
".",
"The",
"caller",
"is",
"responsible",
"for",
"closing",
"the",
"connection",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java#L282-L307 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java | QueryRunner.update | public int update(Connection conn, String sql) throws SQLException {
return this.update(conn, sql, (Object[]) null);
} | java | public int update(Connection conn, String sql) throws SQLException {
return this.update(conn, sql, (Object[]) null);
} | [
"public",
"int",
"update",
"(",
"Connection",
"conn",
",",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"return",
"this",
".",
"update",
"(",
"conn",
",",
"sql",
",",
"(",
"Object",
"[",
"]",
")",
"null",
")",
";",
"}"
] | Execute an SQL INSERT, UPDATE, or DELETE query without replacement
parameters.
@param conn The connection to use to run the query.
@param sql The SQL to execute.
@return The number of rows updated.
@throws java.sql.SQLException if a database access error occurs | [
"Execute",
"an",
"SQL",
"INSERT",
"UPDATE",
"or",
"DELETE",
"query",
"without",
"replacement",
"parameters",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java#L443-L445 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java | QueryRunner.update | public int update(Connection conn, String sql, Object param)
throws SQLException {
return this.update(conn, sql, new Object[] { param });
} | java | public int update(Connection conn, String sql, Object param)
throws SQLException {
return this.update(conn, sql, new Object[] { param });
} | [
"public",
"int",
"update",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"param",
")",
"throws",
"SQLException",
"{",
"return",
"this",
".",
"update",
"(",
"conn",
",",
"sql",
",",
"new",
"Object",
"[",
"]",
"{",
"param",
"}",
")",
... | Execute an SQL INSERT, UPDATE, or DELETE query with a single replacement
parameter.
@param conn The connection to use to run the query.
@param sql The SQL to execute.
@param param The replacement parameter.
@return The number of rows updated.
@throws java.sql.SQLException if a database access error occurs | [
"Execute",
"an",
"SQL",
"INSERT",
"UPDATE",
"or",
"DELETE",
"query",
"with",
"a",
"single",
"replacement",
"parameter",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java#L457-L461 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java | QueryRunner.update | public int update(Connection conn, String sql, Object[] params, int[] paramTypes)
throws SQLException {
if ((paramTypes != null) && params.length != paramTypes.length) {
throw new IllegalArgumentException("Sizes of params and paramTypes must be equal!");
}
PreparedStatement stmt = null;
int rows = 0;
try {
stmt = this.prepareStatement(conn, sql);
this.fillStatement(stmt, params, paramTypes);
rows = stmt.executeUpdate();
} catch (SQLException e) {
this.rethrow(e, sql, params);
} finally {
close(stmt);
}
return rows;
} | java | public int update(Connection conn, String sql, Object[] params, int[] paramTypes)
throws SQLException {
if ((paramTypes != null) && params.length != paramTypes.length) {
throw new IllegalArgumentException("Sizes of params and paramTypes must be equal!");
}
PreparedStatement stmt = null;
int rows = 0;
try {
stmt = this.prepareStatement(conn, sql);
this.fillStatement(stmt, params, paramTypes);
rows = stmt.executeUpdate();
} catch (SQLException e) {
this.rethrow(e, sql, params);
} finally {
close(stmt);
}
return rows;
} | [
"public",
"int",
"update",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"[",
"]",
"params",
",",
"int",
"[",
"]",
"paramTypes",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"(",
"paramTypes",
"!=",
"null",
")",
"&&",
"params",
".",... | Execute an SQL INSERT, UPDATE, or DELETE query.
@param conn The connection to use to run the query.
@param sql The SQL to execute.
@param params The query replacement parameters.
@param paramTypes The query replacement parameters.
@return The number of rows updated.
@throws java.sql.SQLException if a database access error occurs | [
"Execute",
"an",
"SQL",
"INSERT",
"UPDATE",
"or",
"DELETE",
"query",
"."
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/util/db/QueryRunner.java#L488-L511 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java | XLSFormatter.copyMergeRegions | protected void copyMergeRegions(HSSFSheet resultSheet, String rangeName,
int firstTargetRangeRow, int firstTargetRangeColumn) {
int rangeNameIdx = templateWorkbook.getNameIndex(rangeName);
if (rangeNameIdx == -1) return;
HSSFName aNamedRange = templateWorkbook.getNameAt(rangeNameIdx);
AreaReference aref = new AreaReference(aNamedRange.getRefersToFormula(), SpreadsheetVersion.EXCEL97);
int column = aref.getFirstCell().getCol();
int row = aref.getFirstCell().getRow();
List<SheetRange> regionsList = mergeRegionsForRangeNames.get(rangeName);
if (regionsList != null)
for (SheetRange sheetRange : regionsList) {
if (resultSheet.getSheetName().equals(sheetRange.getSheetName())) {
CellRangeAddress cra = sheetRange.getCellRangeAddress();
if (cra != null) {
int regionHeight = cra.getLastRow() - cra.getFirstRow() + 1;
int regionWidth = cra.getLastColumn() - cra.getFirstColumn() + 1;
int regionVOffset = cra.getFirstRow() - row;
int regionHOffset = cra.getFirstColumn() - column;
CellRangeAddress newRegion = cra.copy();
newRegion.setFirstColumn(regionHOffset + firstTargetRangeColumn);
newRegion.setLastColumn(regionHOffset + regionWidth - 1 + firstTargetRangeColumn);
newRegion.setFirstRow(regionVOffset + firstTargetRangeRow);
newRegion.setLastRow(regionVOffset + regionHeight - 1 + firstTargetRangeRow);
boolean skipRegion = false;
for (int mergedIndex = 0; mergedIndex < resultSheet.getNumMergedRegions(); mergedIndex++) {
CellRangeAddress mergedRegion = resultSheet.getMergedRegion(mergedIndex);
if (!intersects(newRegion, mergedRegion)) {
continue;
}
skipRegion = true;
}
if (!skipRegion) {
resultSheet.addMergedRegion(newRegion);
}
}
}
}
} | java | protected void copyMergeRegions(HSSFSheet resultSheet, String rangeName,
int firstTargetRangeRow, int firstTargetRangeColumn) {
int rangeNameIdx = templateWorkbook.getNameIndex(rangeName);
if (rangeNameIdx == -1) return;
HSSFName aNamedRange = templateWorkbook.getNameAt(rangeNameIdx);
AreaReference aref = new AreaReference(aNamedRange.getRefersToFormula(), SpreadsheetVersion.EXCEL97);
int column = aref.getFirstCell().getCol();
int row = aref.getFirstCell().getRow();
List<SheetRange> regionsList = mergeRegionsForRangeNames.get(rangeName);
if (regionsList != null)
for (SheetRange sheetRange : regionsList) {
if (resultSheet.getSheetName().equals(sheetRange.getSheetName())) {
CellRangeAddress cra = sheetRange.getCellRangeAddress();
if (cra != null) {
int regionHeight = cra.getLastRow() - cra.getFirstRow() + 1;
int regionWidth = cra.getLastColumn() - cra.getFirstColumn() + 1;
int regionVOffset = cra.getFirstRow() - row;
int regionHOffset = cra.getFirstColumn() - column;
CellRangeAddress newRegion = cra.copy();
newRegion.setFirstColumn(regionHOffset + firstTargetRangeColumn);
newRegion.setLastColumn(regionHOffset + regionWidth - 1 + firstTargetRangeColumn);
newRegion.setFirstRow(regionVOffset + firstTargetRangeRow);
newRegion.setLastRow(regionVOffset + regionHeight - 1 + firstTargetRangeRow);
boolean skipRegion = false;
for (int mergedIndex = 0; mergedIndex < resultSheet.getNumMergedRegions(); mergedIndex++) {
CellRangeAddress mergedRegion = resultSheet.getMergedRegion(mergedIndex);
if (!intersects(newRegion, mergedRegion)) {
continue;
}
skipRegion = true;
}
if (!skipRegion) {
resultSheet.addMergedRegion(newRegion);
}
}
}
}
} | [
"protected",
"void",
"copyMergeRegions",
"(",
"HSSFSheet",
"resultSheet",
",",
"String",
"rangeName",
",",
"int",
"firstTargetRangeRow",
",",
"int",
"firstTargetRangeColumn",
")",
"{",
"int",
"rangeNameIdx",
"=",
"templateWorkbook",
".",
"getNameIndex",
"(",
"rangeNam... | Create new merge regions in result sheet identically to range's merge regions from template.
Not support copy of frames and rules
@param resultSheet - result sheet
@param rangeName - range name
@param firstTargetRangeRow - first column of target range
@param firstTargetRangeColumn - first column of target range | [
"Create",
"new",
"merge",
"regions",
"in",
"result",
"sheet",
"identically",
"to",
"range",
"s",
"merge",
"regions",
"from",
"template",
".",
"Not",
"support",
"copy",
"of",
"frames",
"and",
"rules"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java#L526-L573 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java | XLSFormatter.copyCellFromTemplate | private HSSFCell copyCellFromTemplate(HSSFCell templateCell, HSSFRow resultRow, int resultColumn, BandData band) {
checkThreadInterrupted();
if (templateCell == null) return null;
HSSFCell resultCell = resultRow.createCell(resultColumn);
HSSFCellStyle templateStyle = templateCell.getCellStyle();
HSSFCellStyle resultStyle = copyCellStyle(templateStyle);
resultCell.setCellStyle(resultStyle);
String templateCellValue = "";
int cellType = templateCell.getCellType();
if (cellType != HSSFCell.CELL_TYPE_FORMULA && cellType != HSSFCell.CELL_TYPE_NUMERIC) {
HSSFRichTextString richStringCellValue = templateCell.getRichStringCellValue();
templateCellValue = richStringCellValue != null ? richStringCellValue.getString() : "";
templateCellValue = extractStyles(templateCell, resultCell, templateCellValue, band);
}
if (cellType == HSSFCell.CELL_TYPE_STRING && containsJustOneAlias(templateCellValue)) {
updateValueCell(rootBand, band, templateCellValue, resultCell,
drawingPatriarchsMap.get(resultCell.getSheet()));
} else {
String cellValue = inlineBandDataToCellString(templateCell, templateCellValue, band);
setValueToCell(resultCell, cellValue, cellType);
}
return resultCell;
} | java | private HSSFCell copyCellFromTemplate(HSSFCell templateCell, HSSFRow resultRow, int resultColumn, BandData band) {
checkThreadInterrupted();
if (templateCell == null) return null;
HSSFCell resultCell = resultRow.createCell(resultColumn);
HSSFCellStyle templateStyle = templateCell.getCellStyle();
HSSFCellStyle resultStyle = copyCellStyle(templateStyle);
resultCell.setCellStyle(resultStyle);
String templateCellValue = "";
int cellType = templateCell.getCellType();
if (cellType != HSSFCell.CELL_TYPE_FORMULA && cellType != HSSFCell.CELL_TYPE_NUMERIC) {
HSSFRichTextString richStringCellValue = templateCell.getRichStringCellValue();
templateCellValue = richStringCellValue != null ? richStringCellValue.getString() : "";
templateCellValue = extractStyles(templateCell, resultCell, templateCellValue, band);
}
if (cellType == HSSFCell.CELL_TYPE_STRING && containsJustOneAlias(templateCellValue)) {
updateValueCell(rootBand, band, templateCellValue, resultCell,
drawingPatriarchsMap.get(resultCell.getSheet()));
} else {
String cellValue = inlineBandDataToCellString(templateCell, templateCellValue, band);
setValueToCell(resultCell, cellValue, cellType);
}
return resultCell;
} | [
"private",
"HSSFCell",
"copyCellFromTemplate",
"(",
"HSSFCell",
"templateCell",
",",
"HSSFRow",
"resultRow",
",",
"int",
"resultColumn",
",",
"BandData",
"band",
")",
"{",
"checkThreadInterrupted",
"(",
")",
";",
"if",
"(",
"templateCell",
"==",
"null",
")",
"re... | copies template cell to result row into result column. Fills this cell with data from band
@param templateCell - template cell
@param resultRow - result row
@param resultColumn - result column
@param band - band | [
"copies",
"template",
"cell",
"to",
"result",
"row",
"into",
"result",
"column",
".",
"Fills",
"this",
"cell",
"with",
"data",
"from",
"band"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java#L595-L624 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java | XLSFormatter.updateValueCell | protected void updateValueCell(BandData rootBand, BandData bandData, String templateCellValue, HSSFCell resultCell, HSSFPatriarch patriarch) {
String parameterName = templateCellValue;
parameterName = unwrapParameterName(parameterName);
String fullParameterName = bandData.getName() + "." + parameterName;
if (StringUtils.isEmpty(parameterName)) return;
if (!bandData.getData().containsKey(parameterName)) {
resultCell.setCellValue((String) null);
return;
}
Object value = bandData.getData().get(parameterName);
if (value == null) {
resultCell.setCellType(HSSFCell.CELL_TYPE_BLANK);
return;
}
String formatString = getFormatString(parameterName, fullParameterName);
InlinerAndMatcher inlinerAndMatcher = getContentInlinerForFormat(formatString);
if (inlinerAndMatcher != null) {
inlinerAndMatcher.contentInliner.inlineToXls(patriarch, resultCell, value, inlinerAndMatcher.matcher);
return;
}
if (formatString != null) {
resultCell.setCellValue(new HSSFRichTextString(formatValue(value, parameterName, fullParameterName)));
} else if (value instanceof Number) {
resultCell.setCellValue(((Number) value).doubleValue());
} else if (value instanceof Boolean) {
resultCell.setCellValue((Boolean) value);
} else if (value instanceof Date) {
resultCell.setCellValue((Date) value);
} else {
resultCell.setCellValue(new HSSFRichTextString(formatValue(value, parameterName, fullParameterName)));
}
} | java | protected void updateValueCell(BandData rootBand, BandData bandData, String templateCellValue, HSSFCell resultCell, HSSFPatriarch patriarch) {
String parameterName = templateCellValue;
parameterName = unwrapParameterName(parameterName);
String fullParameterName = bandData.getName() + "." + parameterName;
if (StringUtils.isEmpty(parameterName)) return;
if (!bandData.getData().containsKey(parameterName)) {
resultCell.setCellValue((String) null);
return;
}
Object value = bandData.getData().get(parameterName);
if (value == null) {
resultCell.setCellType(HSSFCell.CELL_TYPE_BLANK);
return;
}
String formatString = getFormatString(parameterName, fullParameterName);
InlinerAndMatcher inlinerAndMatcher = getContentInlinerForFormat(formatString);
if (inlinerAndMatcher != null) {
inlinerAndMatcher.contentInliner.inlineToXls(patriarch, resultCell, value, inlinerAndMatcher.matcher);
return;
}
if (formatString != null) {
resultCell.setCellValue(new HSSFRichTextString(formatValue(value, parameterName, fullParameterName)));
} else if (value instanceof Number) {
resultCell.setCellValue(((Number) value).doubleValue());
} else if (value instanceof Boolean) {
resultCell.setCellValue((Boolean) value);
} else if (value instanceof Date) {
resultCell.setCellValue((Date) value);
} else {
resultCell.setCellValue(new HSSFRichTextString(formatValue(value, parameterName, fullParameterName)));
}
} | [
"protected",
"void",
"updateValueCell",
"(",
"BandData",
"rootBand",
",",
"BandData",
"bandData",
",",
"String",
"templateCellValue",
",",
"HSSFCell",
"resultCell",
",",
"HSSFPatriarch",
"patriarch",
")",
"{",
"String",
"parameterName",
"=",
"templateCellValue",
";",
... | Copies template cell to result cell and fills it with bandData data
@param bandData - bandData
@param templateCellValue - template cell value
@param resultCell - result cell | [
"Copies",
"template",
"cell",
"to",
"result",
"cell",
"and",
"fills",
"it",
"with",
"bandData",
"data"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java#L633-L670 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java | XLSFormatter.addRangeBounds | protected void addRangeBounds(BandData band, CellReference[] crefs) {
if (templateBounds.containsKey(band.getName()))
return;
Bounds bounds = new Bounds(crefs[0].getRow(), crefs[0].getCol(), crefs[crefs.length - 1].getRow(), crefs[crefs.length - 1].getCol());
templateBounds.put(band.getName(), bounds);
} | java | protected void addRangeBounds(BandData band, CellReference[] crefs) {
if (templateBounds.containsKey(band.getName()))
return;
Bounds bounds = new Bounds(crefs[0].getRow(), crefs[0].getCol(), crefs[crefs.length - 1].getRow(), crefs[crefs.length - 1].getCol());
templateBounds.put(band.getName(), bounds);
} | [
"protected",
"void",
"addRangeBounds",
"(",
"BandData",
"band",
",",
"CellReference",
"[",
"]",
"crefs",
")",
"{",
"if",
"(",
"templateBounds",
".",
"containsKey",
"(",
"band",
".",
"getName",
"(",
")",
")",
")",
"return",
";",
"Bounds",
"bounds",
"=",
"... | This method adds range bounds to cache. Key is bandName
@param band - band
@param crefs - range | [
"This",
"method",
"adds",
"range",
"bounds",
"to",
"cache",
".",
"Key",
"is",
"bandName"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java#L710-L715 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java | XLSFormatter.getEscherAggregate | protected EscherAggregate getEscherAggregate(HSSFSheet sheet) {
EscherAggregate agg = sheetToEscherAggregate.get(sheet.getSheetName());
if (agg == null) {
agg = sheet.getDrawingEscherAggregate();
sheetToEscherAggregate.put(sheet.getSheetName(), agg);
}
return agg;
} | java | protected EscherAggregate getEscherAggregate(HSSFSheet sheet) {
EscherAggregate agg = sheetToEscherAggregate.get(sheet.getSheetName());
if (agg == null) {
agg = sheet.getDrawingEscherAggregate();
sheetToEscherAggregate.put(sheet.getSheetName(), agg);
}
return agg;
} | [
"protected",
"EscherAggregate",
"getEscherAggregate",
"(",
"HSSFSheet",
"sheet",
")",
"{",
"EscherAggregate",
"agg",
"=",
"sheetToEscherAggregate",
".",
"get",
"(",
"sheet",
".",
"getSheetName",
"(",
")",
")",
";",
"if",
"(",
"agg",
"==",
"null",
")",
"{",
"... | Returns EscherAggregate from sheet
@param sheet - HSSFSheet
@return - EscherAggregate from sheet | [
"Returns",
"EscherAggregate",
"from",
"sheet"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java#L784-L791 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java | XLSFormatter.copyPicturesFromTemplateToResult | protected void copyPicturesFromTemplateToResult(HSSFSheet templateSheet, HSSFSheet resultSheet) {
List<HSSFClientAnchor> list = getAllAnchors(getEscherAggregate(templateSheet));
int i = 0;
if (CollectionUtils.isNotEmpty(orderedPicturesId)) {//just a shitty workaround for anchors without pictures
for (HSSFClientAnchor anchor : list) {
Cell topLeft = getCellFromTemplate(new Cell(anchor.getCol1(), anchor.getRow1()));
anchor.setCol1(topLeft.getCol());
anchor.setRow1(topLeft.getRow());
anchor.setCol2(topLeft.getCol() + anchor.getCol2() - anchor.getCol1());
anchor.setRow2(topLeft.getRow() + anchor.getRow2() - anchor.getRow1());
HSSFPatriarch sheetPatriarch = drawingPatriarchsMap.get(resultSheet);
if (sheetPatriarch != null) {
sheetPatriarch.createPicture(anchor, orderedPicturesId.get(i++));
}
}
}
} | java | protected void copyPicturesFromTemplateToResult(HSSFSheet templateSheet, HSSFSheet resultSheet) {
List<HSSFClientAnchor> list = getAllAnchors(getEscherAggregate(templateSheet));
int i = 0;
if (CollectionUtils.isNotEmpty(orderedPicturesId)) {//just a shitty workaround for anchors without pictures
for (HSSFClientAnchor anchor : list) {
Cell topLeft = getCellFromTemplate(new Cell(anchor.getCol1(), anchor.getRow1()));
anchor.setCol1(topLeft.getCol());
anchor.setRow1(topLeft.getRow());
anchor.setCol2(topLeft.getCol() + anchor.getCol2() - anchor.getCol1());
anchor.setRow2(topLeft.getRow() + anchor.getRow2() - anchor.getRow1());
HSSFPatriarch sheetPatriarch = drawingPatriarchsMap.get(resultSheet);
if (sheetPatriarch != null) {
sheetPatriarch.createPicture(anchor, orderedPicturesId.get(i++));
}
}
}
} | [
"protected",
"void",
"copyPicturesFromTemplateToResult",
"(",
"HSSFSheet",
"templateSheet",
",",
"HSSFSheet",
"resultSheet",
")",
"{",
"List",
"<",
"HSSFClientAnchor",
">",
"list",
"=",
"getAllAnchors",
"(",
"getEscherAggregate",
"(",
"templateSheet",
")",
")",
";",
... | Copies all pictures from template sheet to result sheet, shift picture depending on area dependencies
@param templateSheet - template sheet
@param resultSheet - result sheet | [
"Copies",
"all",
"pictures",
"from",
"template",
"sheet",
"to",
"result",
"sheet",
"shift",
"picture",
"depending",
"on",
"area",
"dependencies"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XLSFormatter.java#L799-L818 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java | XlsxFormatter.updateFormulas | protected void updateFormulas() {
CTCalcChain calculationChain = getCalculationChain();
int formulaCount = processInnerFormulas(calculationChain);
processOuterFormulas(formulaCount, calculationChain);
} | java | protected void updateFormulas() {
CTCalcChain calculationChain = getCalculationChain();
int formulaCount = processInnerFormulas(calculationChain);
processOuterFormulas(formulaCount, calculationChain);
} | [
"protected",
"void",
"updateFormulas",
"(",
")",
"{",
"CTCalcChain",
"calculationChain",
"=",
"getCalculationChain",
"(",
")",
";",
"int",
"formulaCount",
"=",
"processInnerFormulas",
"(",
"calculationChain",
")",
";",
"processOuterFormulas",
"(",
"formulaCount",
",",... | todo support formulas without range but with list of cells | [
"todo",
"support",
"formulas",
"without",
"range",
"but",
"with",
"list",
"of",
"cells"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java#L312-L316 | train |
cuba-platform/yarg | core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java | XlsxFormatter.createFakeTemplateCellsForEmptyOnes | protected void createFakeTemplateCellsForEmptyOnes(Range oneRowRange,
Map<CellReference, Cell> cellsForOneRowRange,
List<Cell> templateCells) {
if (oneRowRange.toCellReferences().size() != templateCells.size()) {
final HashBiMap<CellReference, Cell> referencesToCells = HashBiMap.create(cellsForOneRowRange);
for (CellReference cellReference : oneRowRange.toCellReferences()) {
if (!cellsForOneRowRange.containsKey(cellReference)) {
Cell newCell = Context.getsmlObjectFactory().createCell();
newCell.setV(null);
newCell.setT(STCellType.STR);
newCell.setR(cellReference.toReference());
templateCells.add(newCell);
referencesToCells.put(cellReference, newCell);
}
}
templateCells.sort((o1, o2) -> {
CellReference cellReference1 = referencesToCells.inverse().get(o1);
CellReference cellReference2 = referencesToCells.inverse().get(o2);
return cellReference1.compareTo(cellReference2);
});
}
} | java | protected void createFakeTemplateCellsForEmptyOnes(Range oneRowRange,
Map<CellReference, Cell> cellsForOneRowRange,
List<Cell> templateCells) {
if (oneRowRange.toCellReferences().size() != templateCells.size()) {
final HashBiMap<CellReference, Cell> referencesToCells = HashBiMap.create(cellsForOneRowRange);
for (CellReference cellReference : oneRowRange.toCellReferences()) {
if (!cellsForOneRowRange.containsKey(cellReference)) {
Cell newCell = Context.getsmlObjectFactory().createCell();
newCell.setV(null);
newCell.setT(STCellType.STR);
newCell.setR(cellReference.toReference());
templateCells.add(newCell);
referencesToCells.put(cellReference, newCell);
}
}
templateCells.sort((o1, o2) -> {
CellReference cellReference1 = referencesToCells.inverse().get(o1);
CellReference cellReference2 = referencesToCells.inverse().get(o2);
return cellReference1.compareTo(cellReference2);
});
}
} | [
"protected",
"void",
"createFakeTemplateCellsForEmptyOnes",
"(",
"Range",
"oneRowRange",
",",
"Map",
"<",
"CellReference",
",",
"Cell",
">",
"cellsForOneRowRange",
",",
"List",
"<",
"Cell",
">",
"templateCells",
")",
"{",
"if",
"(",
"oneRowRange",
".",
"toCellRefe... | XLSX document does not store empty cells and it might be an issue for formula calculations and etc.
So we need to create fake template cell for each empty cell. | [
"XLSX",
"document",
"does",
"not",
"store",
"empty",
"cells",
"and",
"it",
"might",
"be",
"an",
"issue",
"for",
"formula",
"calculations",
"and",
"etc",
".",
"So",
"we",
"need",
"to",
"create",
"fake",
"template",
"cell",
"for",
"each",
"empty",
"cell",
... | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/core/src/com/haulmont/yarg/formatters/impl/XlsxFormatter.java#L773-L796 | train |
cuba-platform/yarg | core/modules/api/src/com/haulmont/yarg/reporting/RunParams.java | RunParams.templateCode | public RunParams templateCode(String templateCode) {
if (templateCode == null) {
throw new NullPointerException("\"templateCode\" parameter can not be null");
}
this.reportTemplate = report.getReportTemplates().get(templateCode);
if (reportTemplate == null) {
throw new NullPointerException(String.format("Report template not found for code [%s]", templateCode));
}
return this;
} | java | public RunParams templateCode(String templateCode) {
if (templateCode == null) {
throw new NullPointerException("\"templateCode\" parameter can not be null");
}
this.reportTemplate = report.getReportTemplates().get(templateCode);
if (reportTemplate == null) {
throw new NullPointerException(String.format("Report template not found for code [%s]", templateCode));
}
return this;
} | [
"public",
"RunParams",
"templateCode",
"(",
"String",
"templateCode",
")",
"{",
"if",
"(",
"templateCode",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"\\\"templateCode\\\" parameter can not be null\"",
")",
";",
"}",
"this",
".",
"reportT... | Setup necessary template by string code. Throws validation exception if code is null or template not found
@param templateCode - string code of template | [
"Setup",
"necessary",
"template",
"by",
"string",
"code",
".",
"Throws",
"validation",
"exception",
"if",
"code",
"is",
"null",
"or",
"template",
"not",
"found"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/api/src/com/haulmont/yarg/reporting/RunParams.java#L43-L52 | train |
cuba-platform/yarg | core/modules/api/src/com/haulmont/yarg/reporting/RunParams.java | RunParams.params | public RunParams params(Map<String, Object> params) {
if (params == null) {
throw new NullPointerException("\"params\" parameter can not be null");
}
this.params.putAll(params);
return this;
} | java | public RunParams params(Map<String, Object> params) {
if (params == null) {
throw new NullPointerException("\"params\" parameter can not be null");
}
this.params.putAll(params);
return this;
} | [
"public",
"RunParams",
"params",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"if",
"(",
"params",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"\\\"params\\\" parameter can not be null\"",
")",
";",
"}",
"this",... | Adds parameters from map | [
"Adds",
"parameters",
"from",
"map"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/api/src/com/haulmont/yarg/reporting/RunParams.java#L68-L74 | train |
cuba-platform/yarg | core/modules/api/src/com/haulmont/yarg/reporting/RunParams.java | RunParams.param | public RunParams param(String key, Object value) {
params.put(key, value);
return this;
} | java | public RunParams param(String key, Object value) {
params.put(key, value);
return this;
} | [
"public",
"RunParams",
"param",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"params",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add single parameter | [
"Add",
"single",
"parameter"
] | d157286cbe29448f3e1f445e8c5dd88808351da0 | https://github.com/cuba-platform/yarg/blob/d157286cbe29448f3e1f445e8c5dd88808351da0/core/modules/api/src/com/haulmont/yarg/reporting/RunParams.java#L79-L82 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollection.java | BoxApiCollection.getCollectionsRequest | public BoxRequestsCollections.GetCollections getCollectionsRequest() {
BoxRequestsCollections.GetCollections request = new BoxRequestsCollections.GetCollections(getCollectionsUrl(), mSession);
return request;
} | java | public BoxRequestsCollections.GetCollections getCollectionsRequest() {
BoxRequestsCollections.GetCollections request = new BoxRequestsCollections.GetCollections(getCollectionsUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsCollections",
".",
"GetCollections",
"getCollectionsRequest",
"(",
")",
"{",
"BoxRequestsCollections",
".",
"GetCollections",
"request",
"=",
"new",
"BoxRequestsCollections",
".",
"GetCollections",
"(",
"getCollectionsUrl",
"(",
")",
",",
"mSession",... | Gets a request that gets the collections belonging to the user
@return request to get collections belonging to the user | [
"Gets",
"a",
"request",
"that",
"gets",
"the",
"collections",
"belonging",
"to",
"the",
"user"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollection.java#L44-L47 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollection.java | BoxApiCollection.getItemsRequest | public BoxRequestsCollections.GetCollectionItems getItemsRequest(String id) {
BoxRequestsCollections.GetCollectionItems request = new BoxRequestsCollections.GetCollectionItems(id, getCollectionItemsUrl(id), mSession);
return request;
} | java | public BoxRequestsCollections.GetCollectionItems getItemsRequest(String id) {
BoxRequestsCollections.GetCollectionItems request = new BoxRequestsCollections.GetCollectionItems(id, getCollectionItemsUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsCollections",
".",
"GetCollectionItems",
"getItemsRequest",
"(",
"String",
"id",
")",
"{",
"BoxRequestsCollections",
".",
"GetCollectionItems",
"request",
"=",
"new",
"BoxRequestsCollections",
".",
"GetCollectionItems",
"(",
"id",
",",
"getCollection... | Gets a request that gets the items of a collection
@param id id of collection to retrieve items of
@return request to get a collections items | [
"Gets",
"a",
"request",
"that",
"gets",
"the",
"items",
"of",
"a",
"collection"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiCollection.java#L55-L58 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUser.java | BoxUser.createFromId | public static BoxUser createFromId(String userId) {
JsonObject object = new JsonObject();
object.add(BoxCollaborator.FIELD_ID, userId);
object.add(BoxCollaborator.FIELD_TYPE, BoxUser.TYPE);
BoxUser user = new BoxUser();
user.createFromJson(object);
return user;
} | java | public static BoxUser createFromId(String userId) {
JsonObject object = new JsonObject();
object.add(BoxCollaborator.FIELD_ID, userId);
object.add(BoxCollaborator.FIELD_TYPE, BoxUser.TYPE);
BoxUser user = new BoxUser();
user.createFromJson(object);
return user;
} | [
"public",
"static",
"BoxUser",
"createFromId",
"(",
"String",
"userId",
")",
"{",
"JsonObject",
"object",
"=",
"new",
"JsonObject",
"(",
")",
";",
"object",
".",
"add",
"(",
"BoxCollaborator",
".",
"FIELD_ID",
",",
"userId",
")",
";",
"object",
".",
"add",... | A convenience method to create an empty user with just the id and type fields set. This allows
the ability to interact with the content sdk in a more descriptive and type safe manner
@param userId the id of user to create
@return an empty BoxUser object that only contains id and type information | [
"A",
"convenience",
"method",
"to",
"create",
"an",
"empty",
"user",
"with",
"just",
"the",
"id",
"and",
"type",
"fields",
"set",
".",
"This",
"allows",
"the",
"ability",
"to",
"interact",
"with",
"the",
"content",
"sdk",
"in",
"a",
"more",
"descriptive",
... | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUser.java#L92-L99 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiEvent.java | BoxApiEvent.getUserEventsRequest | public BoxRequestsEvent.GetUserEvents getUserEventsRequest() {
BoxRequestsEvent.GetUserEvents request = new BoxRequestsEvent.GetUserEvents( getEventsUrl(), mSession);
return request;
} | java | public BoxRequestsEvent.GetUserEvents getUserEventsRequest() {
BoxRequestsEvent.GetUserEvents request = new BoxRequestsEvent.GetUserEvents( getEventsUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsEvent",
".",
"GetUserEvents",
"getUserEventsRequest",
"(",
")",
"{",
"BoxRequestsEvent",
".",
"GetUserEvents",
"request",
"=",
"new",
"BoxRequestsEvent",
".",
"GetUserEvents",
"(",
"getEventsUrl",
"(",
")",
",",
"mSession",
")",
";",
"return",
... | Gets a request that retrieves user events
@return request to get user events | [
"Gets",
"a",
"request",
"that",
"retrieves",
"user",
"events"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiEvent.java#L32-L35 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiEvent.java | BoxApiEvent.getEnterpriseEventsRequest | public BoxRequestsEvent.GetEnterpriseEvents getEnterpriseEventsRequest() {
BoxRequestsEvent.GetEnterpriseEvents request = new BoxRequestsEvent.GetEnterpriseEvents(getEventsUrl(), mSession);
return request;
} | java | public BoxRequestsEvent.GetEnterpriseEvents getEnterpriseEventsRequest() {
BoxRequestsEvent.GetEnterpriseEvents request = new BoxRequestsEvent.GetEnterpriseEvents(getEventsUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsEvent",
".",
"GetEnterpriseEvents",
"getEnterpriseEventsRequest",
"(",
")",
"{",
"BoxRequestsEvent",
".",
"GetEnterpriseEvents",
"request",
"=",
"new",
"BoxRequestsEvent",
".",
"GetEnterpriseEvents",
"(",
"getEventsUrl",
"(",
")",
",",
"mSession",
... | Gets a request that retrieves enterprise events
@return request to retrieve enterprise events | [
"Gets",
"a",
"request",
"that",
"retrieves",
"enterprise",
"events"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiEvent.java#L42-L45 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiEvent.java | BoxApiEvent.getLongPollServerConnection | public RealTimeServerConnection getLongPollServerConnection(RealTimeServerConnection.OnChangeListener changeListener) {
BoxRequestsEvent.EventRealTimeServerRequest request = new BoxRequestsEvent.EventRealTimeServerRequest(getEventsUrl(), mSession);
return new RealTimeServerConnection(request,changeListener, mSession );
} | java | public RealTimeServerConnection getLongPollServerConnection(RealTimeServerConnection.OnChangeListener changeListener) {
BoxRequestsEvent.EventRealTimeServerRequest request = new BoxRequestsEvent.EventRealTimeServerRequest(getEventsUrl(), mSession);
return new RealTimeServerConnection(request,changeListener, mSession );
} | [
"public",
"RealTimeServerConnection",
"getLongPollServerConnection",
"(",
"RealTimeServerConnection",
".",
"OnChangeListener",
"changeListener",
")",
"{",
"BoxRequestsEvent",
".",
"EventRealTimeServerRequest",
"request",
"=",
"new",
"BoxRequestsEvent",
".",
"EventRealTimeServerRe... | Gets a request that retrieves a RealTimeServerConnection, which is used to create a long poll to check for some generic change
to the user's account. This can be combined with syncing logic using getUserEventsRequest or getEnterpriseEventsRequest to discover what has changed.
@param changeListener A listener that will get triggered when a change has been made to the user's account or an exception has occurred.
@return A RealTimeServerConnection that checks for a change to a user's account. | [
"Gets",
"a",
"request",
"that",
"retrieves",
"a",
"RealTimeServerConnection",
"which",
"is",
"used",
"to",
"create",
"a",
"long",
"poll",
"to",
"check",
"for",
"some",
"generic",
"change",
"to",
"the",
"user",
"s",
"account",
".",
"This",
"can",
"be",
"com... | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiEvent.java#L54-L57 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxJsonObject.java | BoxJsonObject.getPropertyValue | public JsonValue getPropertyValue(String name) {
// Return a copy of json value to ensure user can't change the underlying object directly
JsonValue jsonValue = mCacheMap.getAsJsonValue(name);
return jsonValue == null ? null : JsonValue.readFrom(jsonValue.toString());
} | java | public JsonValue getPropertyValue(String name) {
// Return a copy of json value to ensure user can't change the underlying object directly
JsonValue jsonValue = mCacheMap.getAsJsonValue(name);
return jsonValue == null ? null : JsonValue.readFrom(jsonValue.toString());
} | [
"public",
"JsonValue",
"getPropertyValue",
"(",
"String",
"name",
")",
"{",
"// Return a copy of json value to ensure user can't change the underlying object directly",
"JsonValue",
"jsonValue",
"=",
"mCacheMap",
".",
"getAsJsonValue",
"(",
"name",
")",
";",
"return",
"jsonVa... | Gets the value associated with the key in the property map
@param name name of the property
@return Value of the key | [
"Gets",
"the",
"value",
"associated",
"with",
"the",
"key",
"in",
"the",
"property",
"map"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxJsonObject.java#L104-L108 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java | BoxRequestCommentAdd.setMessage | public R setMessage(String message) {
mBodyMap.put(BoxComment.FIELD_MESSAGE, message);
return (R) this;
} | java | public R setMessage(String message) {
mBodyMap.put(BoxComment.FIELD_MESSAGE, message);
return (R) this;
} | [
"public",
"R",
"setMessage",
"(",
"String",
"message",
")",
"{",
"mBodyMap",
".",
"put",
"(",
"BoxComment",
".",
"FIELD_MESSAGE",
",",
"message",
")",
";",
"return",
"(",
"R",
")",
"this",
";",
"}"
] | Sets the message used in the request to create a new comment.
@param message message for the new comment.
@return request with the updated message. | [
"Sets",
"the",
"message",
"used",
"in",
"the",
"request",
"to",
"create",
"a",
"new",
"comment",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java#L46-L49 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java | BoxRequestCommentAdd.getItemId | public String getItemId() {
return mBodyMap.containsKey(BoxComment.FIELD_ITEM) ?
(String) mBodyMap.get(BoxItem.FIELD_ID) :
null;
} | java | public String getItemId() {
return mBodyMap.containsKey(BoxComment.FIELD_ITEM) ?
(String) mBodyMap.get(BoxItem.FIELD_ID) :
null;
} | [
"public",
"String",
"getItemId",
"(",
")",
"{",
"return",
"mBodyMap",
".",
"containsKey",
"(",
"BoxComment",
".",
"FIELD_ITEM",
")",
"?",
"(",
"String",
")",
"mBodyMap",
".",
"get",
"(",
"BoxItem",
".",
"FIELD_ID",
")",
":",
"null",
";",
"}"
] | Returns the id of the item currently set in the request to add a comment to.
@return id of the item to add a comment to. | [
"Returns",
"the",
"id",
"of",
"the",
"item",
"currently",
"set",
"in",
"the",
"request",
"to",
"add",
"a",
"comment",
"to",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java#L61-L65 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java | BoxRequestCommentAdd.setItemId | protected R setItemId(String id) {
JsonObject object = new JsonObject();
if (mBodyMap.containsKey(BoxComment.FIELD_ITEM)) {
BoxEntity item = (BoxEntity) mBodyMap.get(BoxComment.FIELD_ITEM);
object = item.toJsonObject();
}
object.add(BoxEntity.FIELD_ID, id);
BoxEntity item = new BoxEntity(object);
mBodyMap.put(BoxComment.FIELD_ITEM, item);
return (R) this;
} | java | protected R setItemId(String id) {
JsonObject object = new JsonObject();
if (mBodyMap.containsKey(BoxComment.FIELD_ITEM)) {
BoxEntity item = (BoxEntity) mBodyMap.get(BoxComment.FIELD_ITEM);
object = item.toJsonObject();
}
object.add(BoxEntity.FIELD_ID, id);
BoxEntity item = new BoxEntity(object);
mBodyMap.put(BoxComment.FIELD_ITEM, item);
return (R) this;
} | [
"protected",
"R",
"setItemId",
"(",
"String",
"id",
")",
"{",
"JsonObject",
"object",
"=",
"new",
"JsonObject",
"(",
")",
";",
"if",
"(",
"mBodyMap",
".",
"containsKey",
"(",
"BoxComment",
".",
"FIELD_ITEM",
")",
")",
"{",
"BoxEntity",
"item",
"=",
"(",
... | Sets the id of the item used in the request to add a comment to.
@param id id of the item to add a comment to.
@return request with the updated item id. | [
"Sets",
"the",
"id",
"of",
"the",
"item",
"used",
"in",
"the",
"request",
"to",
"add",
"a",
"comment",
"to",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java#L73-L83 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java | BoxRequestCommentAdd.getItemType | public String getItemType() {
return mBodyMap.containsKey(BoxComment.FIELD_ITEM) ?
(String) mBodyMap.get(BoxItem.FIELD_TYPE) :
null;
} | java | public String getItemType() {
return mBodyMap.containsKey(BoxComment.FIELD_ITEM) ?
(String) mBodyMap.get(BoxItem.FIELD_TYPE) :
null;
} | [
"public",
"String",
"getItemType",
"(",
")",
"{",
"return",
"mBodyMap",
".",
"containsKey",
"(",
"BoxComment",
".",
"FIELD_ITEM",
")",
"?",
"(",
"String",
")",
"mBodyMap",
".",
"get",
"(",
"BoxItem",
".",
"FIELD_TYPE",
")",
":",
"null",
";",
"}"
] | Returns the type of item used in the request to add a comment to.
@return type of item to add a comment to. | [
"Returns",
"the",
"type",
"of",
"item",
"used",
"in",
"the",
"request",
"to",
"add",
"a",
"comment",
"to",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java#L90-L94 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java | BoxRequestCommentAdd.setItemType | protected R setItemType(String type) {
JsonObject object = new JsonObject();
if (mBodyMap.containsKey(BoxComment.FIELD_ITEM)) {
BoxEntity item = (BoxEntity) mBodyMap.get(BoxComment.FIELD_ITEM);
object = item.toJsonObject();
}
object.add(BoxEntity.FIELD_TYPE, type);
BoxEntity item = new BoxEntity(object);
mBodyMap.put(BoxComment.FIELD_ITEM, item);
return (R) this;
} | java | protected R setItemType(String type) {
JsonObject object = new JsonObject();
if (mBodyMap.containsKey(BoxComment.FIELD_ITEM)) {
BoxEntity item = (BoxEntity) mBodyMap.get(BoxComment.FIELD_ITEM);
object = item.toJsonObject();
}
object.add(BoxEntity.FIELD_TYPE, type);
BoxEntity item = new BoxEntity(object);
mBodyMap.put(BoxComment.FIELD_ITEM, item);
return (R) this;
} | [
"protected",
"R",
"setItemType",
"(",
"String",
"type",
")",
"{",
"JsonObject",
"object",
"=",
"new",
"JsonObject",
"(",
")",
";",
"if",
"(",
"mBodyMap",
".",
"containsKey",
"(",
"BoxComment",
".",
"FIELD_ITEM",
")",
")",
"{",
"BoxEntity",
"item",
"=",
"... | Sets the type of item used in the request to add a comment to.
@param type type of item used in the request. Must be "file", "comment", or "web_link".
@return request with the updated item type. | [
"Sets",
"the",
"type",
"of",
"item",
"used",
"in",
"the",
"request",
"to",
"add",
"a",
"comment",
"to",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestCommentAdd.java#L102-L112 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpResponse.java | BoxHttpResponse.open | public void open() throws IOException {
mConnection.connect();
mContentType = mConnection.getContentType();
mResponseCode = mConnection.getResponseCode();
mContentEncoding = mConnection.getContentEncoding();
} | java | public void open() throws IOException {
mConnection.connect();
mContentType = mConnection.getContentType();
mResponseCode = mConnection.getResponseCode();
mContentEncoding = mConnection.getContentEncoding();
} | [
"public",
"void",
"open",
"(",
")",
"throws",
"IOException",
"{",
"mConnection",
".",
"connect",
"(",
")",
";",
"mContentType",
"=",
"mConnection",
".",
"getContentType",
"(",
")",
";",
"mResponseCode",
"=",
"mConnection",
".",
"getResponseCode",
"(",
")",
"... | Open connection to the resource.
@throws IOException if an error occurs connecting to server. | [
"Open",
"connection",
"to",
"the",
"resource",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpResponse.java#L60-L65 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestList.java | BoxRequestList.setLimit | public R setLimit(int limit) {
mQueryMap.put(LIMIT, String.valueOf(limit));
return (R) this;
} | java | public R setLimit(int limit) {
mQueryMap.put(LIMIT, String.valueOf(limit));
return (R) this;
} | [
"public",
"R",
"setLimit",
"(",
"int",
"limit",
")",
"{",
"mQueryMap",
".",
"put",
"(",
"LIMIT",
",",
"String",
".",
"valueOf",
"(",
"limit",
")",
")",
";",
"return",
"(",
"R",
")",
"this",
";",
"}"
] | Sets the limit of items that should be returned
@param limit limit of items to return
@return the get folder items request | [
"Sets",
"the",
"limit",
"of",
"items",
"that",
"should",
"be",
"returned"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestList.java#L39-L42 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestList.java | BoxRequestList.setOffset | public R setOffset(int offset) {
mQueryMap.put(OFFSET, String.valueOf(offset));
return (R) this;
} | java | public R setOffset(int offset) {
mQueryMap.put(OFFSET, String.valueOf(offset));
return (R) this;
} | [
"public",
"R",
"setOffset",
"(",
"int",
"offset",
")",
"{",
"mQueryMap",
".",
"put",
"(",
"OFFSET",
",",
"String",
".",
"valueOf",
"(",
"offset",
")",
")",
";",
"return",
"(",
"R",
")",
"this",
";",
"}"
] | Sets the offset of the items that should be returned
@param offset offset of items to return
@return the offset of the items to return | [
"Sets",
"the",
"offset",
"of",
"the",
"items",
"that",
"should",
"be",
"returned"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestList.java#L50-L53 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApi.java | BoxApi.getBaseUri | protected String getBaseUri() {
if (mSession != null && mSession.getAuthInfo() != null && mSession.getAuthInfo().getBaseDomain() != null){
return String.format(BoxConstants.BASE_URI_TEMPLATE,mSession.getAuthInfo().getBaseDomain());
}
return mBaseUri;
} | java | protected String getBaseUri() {
if (mSession != null && mSession.getAuthInfo() != null && mSession.getAuthInfo().getBaseDomain() != null){
return String.format(BoxConstants.BASE_URI_TEMPLATE,mSession.getAuthInfo().getBaseDomain());
}
return mBaseUri;
} | [
"protected",
"String",
"getBaseUri",
"(",
")",
"{",
"if",
"(",
"mSession",
"!=",
"null",
"&&",
"mSession",
".",
"getAuthInfo",
"(",
")",
"!=",
"null",
"&&",
"mSession",
".",
"getAuthInfo",
"(",
")",
".",
"getBaseDomain",
"(",
")",
"!=",
"null",
")",
"{... | Returns the base URI for the API.
@return base URI for the API. | [
"Returns",
"the",
"base",
"URI",
"for",
"the",
"API",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApi.java#L29-L34 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApi.java | BoxApi.getBaseUploadUri | protected String getBaseUploadUri() {
if (mSession != null && mSession.getAuthInfo() != null && mSession.getAuthInfo().getBaseDomain() != null){
return String.format(BoxConstants.BASE_UPLOAD_URI_TEMPLATE, mSession.getAuthInfo().getBaseDomain());
}
return mBaseUploadUri;
} | java | protected String getBaseUploadUri() {
if (mSession != null && mSession.getAuthInfo() != null && mSession.getAuthInfo().getBaseDomain() != null){
return String.format(BoxConstants.BASE_UPLOAD_URI_TEMPLATE, mSession.getAuthInfo().getBaseDomain());
}
return mBaseUploadUri;
} | [
"protected",
"String",
"getBaseUploadUri",
"(",
")",
"{",
"if",
"(",
"mSession",
"!=",
"null",
"&&",
"mSession",
".",
"getAuthInfo",
"(",
")",
"!=",
"null",
"&&",
"mSession",
".",
"getAuthInfo",
"(",
")",
".",
"getBaseDomain",
"(",
")",
"!=",
"null",
")"... | Returns the base URI for uploads for the API.
@return base upload URI. | [
"Returns",
"the",
"base",
"URI",
"for",
"uploads",
"for",
"the",
"API",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApi.java#L41-L46 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxCollaborationItem.java | BoxCollaborationItem.getAllowedInviteeRoles | public ArrayList<BoxCollaboration.Role> getAllowedInviteeRoles() {
if (mCachedAllowedInviteeRoles != null){
return mCachedAllowedInviteeRoles;
}
ArrayList<String> roles = getPropertyAsStringArray(FIELD_ALLOWED_INVITEE_ROLES);
if (roles == null){
return null;
}
mCachedAllowedInviteeRoles = new ArrayList<BoxCollaboration.Role>(roles.size());
for (String role : roles){
mCachedAllowedInviteeRoles.add(BoxCollaboration.Role.fromString(role));
}
return mCachedAllowedInviteeRoles;
} | java | public ArrayList<BoxCollaboration.Role> getAllowedInviteeRoles() {
if (mCachedAllowedInviteeRoles != null){
return mCachedAllowedInviteeRoles;
}
ArrayList<String> roles = getPropertyAsStringArray(FIELD_ALLOWED_INVITEE_ROLES);
if (roles == null){
return null;
}
mCachedAllowedInviteeRoles = new ArrayList<BoxCollaboration.Role>(roles.size());
for (String role : roles){
mCachedAllowedInviteeRoles.add(BoxCollaboration.Role.fromString(role));
}
return mCachedAllowedInviteeRoles;
} | [
"public",
"ArrayList",
"<",
"BoxCollaboration",
".",
"Role",
">",
"getAllowedInviteeRoles",
"(",
")",
"{",
"if",
"(",
"mCachedAllowedInviteeRoles",
"!=",
"null",
")",
"{",
"return",
"mCachedAllowedInviteeRoles",
";",
"}",
"ArrayList",
"<",
"String",
">",
"roles",
... | Item collaboration settings allowed by the enterprise administrator.
@return list of roles allowed for item collaboration invitees. | [
"Item",
"collaboration",
"settings",
"allowed",
"by",
"the",
"enterprise",
"administrator",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxCollaborationItem.java#L64-L77 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSessionEndpoints.java | BoxUploadSessionEndpoints.getEndpointsMap | public Map<String, String> getEndpointsMap () {
List<String> keys = getPropertiesKeySet();
HashMap<String, String> endpoints = new HashMap<>(keys.size());
for (String key : keys) {
endpoints.put(key, getPropertyAsString(key));
}
return endpoints;
} | java | public Map<String, String> getEndpointsMap () {
List<String> keys = getPropertiesKeySet();
HashMap<String, String> endpoints = new HashMap<>(keys.size());
for (String key : keys) {
endpoints.put(key, getPropertyAsString(key));
}
return endpoints;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getEndpointsMap",
"(",
")",
"{",
"List",
"<",
"String",
">",
"keys",
"=",
"getPropertiesKeySet",
"(",
")",
";",
"HashMap",
"<",
"String",
",",
"String",
">",
"endpoints",
"=",
"new",
"HashMap",
"<>",
... | Get a map of all end points
@return | [
"Get",
"a",
"map",
"of",
"all",
"end",
"points"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSessionEndpoints.java#L63-L70 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxGroup.java | BoxGroup.createFromId | public static BoxGroup createFromId(String groupId) {
JsonObject object = new JsonObject();
object.add(BoxCollaborator.FIELD_ID, groupId);
object.add(BoxCollaborator.FIELD_TYPE, BoxUser.TYPE);
return new BoxGroup(object);
} | java | public static BoxGroup createFromId(String groupId) {
JsonObject object = new JsonObject();
object.add(BoxCollaborator.FIELD_ID, groupId);
object.add(BoxCollaborator.FIELD_TYPE, BoxUser.TYPE);
return new BoxGroup(object);
} | [
"public",
"static",
"BoxGroup",
"createFromId",
"(",
"String",
"groupId",
")",
"{",
"JsonObject",
"object",
"=",
"new",
"JsonObject",
"(",
")",
";",
"object",
".",
"add",
"(",
"BoxCollaborator",
".",
"FIELD_ID",
",",
"groupId",
")",
";",
"object",
".",
"ad... | A convenience method to create an empty group with just the id and type fields set. This allows
the ability to interact with the content sdk in a more descriptive and type safe manner
@param groupId the id of group to create
@return an empty BoxGroup object that only contains id and type information | [
"A",
"convenience",
"method",
"to",
"create",
"an",
"empty",
"group",
"with",
"just",
"the",
"id",
"and",
"type",
"fields",
"set",
".",
"This",
"allows",
"the",
"ability",
"to",
"interact",
"with",
"the",
"content",
"sdk",
"in",
"a",
"more",
"descriptive",... | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxGroup.java#L38-L43 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getAddFolderMetadataRequest | public BoxRequestsMetadata.AddItemMetadata getAddFolderMetadataRequest(String id, LinkedHashMap<String, Object> values, String scope, String template) {
BoxRequestsMetadata.AddItemMetadata request = new BoxRequestsMetadata.AddItemMetadata(values, getFolderMetadataUrl(id, scope, template), mSession);
return request;
} | java | public BoxRequestsMetadata.AddItemMetadata getAddFolderMetadataRequest(String id, LinkedHashMap<String, Object> values, String scope, String template) {
BoxRequestsMetadata.AddItemMetadata request = new BoxRequestsMetadata.AddItemMetadata(values, getFolderMetadataUrl(id, scope, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"AddItemMetadata",
"getAddFolderMetadataRequest",
"(",
"String",
"id",
",",
"LinkedHashMap",
"<",
"String",
",",
"Object",
">",
"values",
",",
"String",
"scope",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
... | Gets a request that adds metadata to a folder
@param id id of the folder to add metadata to
@param values mapping of the template keys to their values
@param scope currently only global and enterprise scopes are supported
@param template metadata template to use
@return request to add metadata to a folder | [
"Gets",
"a",
"request",
"that",
"adds",
"metadata",
"to",
"a",
"folder"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L129-L132 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getFolderMetadataRequest | public BoxRequestsMetadata.GetItemMetadata getFolderMetadataRequest(String id, String template) {
BoxRequestsMetadata.GetItemMetadata request = new BoxRequestsMetadata.GetItemMetadata(getFolderMetadataUrl(id, template), mSession);
return request;
} | java | public BoxRequestsMetadata.GetItemMetadata getFolderMetadataRequest(String id, String template) {
BoxRequestsMetadata.GetItemMetadata request = new BoxRequestsMetadata.GetItemMetadata(getFolderMetadataUrl(id, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"GetItemMetadata",
"getFolderMetadataRequest",
"(",
"String",
"id",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"GetItemMetadata",
"request",
"=",
"new",
"BoxRequestsMetadata",
".",
"GetItemMetadata",
"(",
"getF... | Gets a request that retrieves the metadata for a specific template on a folder
@param id id of the folder to retrieve metadata for
@param template metadata template requested
@return request to retrieve metadata on a folder | [
"Gets",
"a",
"request",
"that",
"retrieves",
"the",
"metadata",
"for",
"a",
"specific",
"template",
"on",
"a",
"folder"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L201-L204 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getUpdateFileMetadataRequest | public BoxRequestsMetadata.UpdateFileMetadata getUpdateFileMetadataRequest(String id, String scope, String template) {
BoxRequestsMetadata.UpdateFileMetadata request = new BoxRequestsMetadata.UpdateFileMetadata(getFileMetadataUrl(id, scope, template), mSession);
return request;
} | java | public BoxRequestsMetadata.UpdateFileMetadata getUpdateFileMetadataRequest(String id, String scope, String template) {
BoxRequestsMetadata.UpdateFileMetadata request = new BoxRequestsMetadata.UpdateFileMetadata(getFileMetadataUrl(id, scope, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"UpdateFileMetadata",
"getUpdateFileMetadataRequest",
"(",
"String",
"id",
",",
"String",
"scope",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"UpdateFileMetadata",
"request",
"=",
"new",
"BoxRequestsMetadata",
... | Gets a request that updates the metadata for a specific template on a file
@param id id of the file to retrieve metadata for
@param scope currently only global and enterprise scopes are supported
@param template metadata template to use
@return request to update metadata on a file | [
"Gets",
"a",
"request",
"that",
"updates",
"the",
"metadata",
"for",
"a",
"specific",
"template",
"on",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L228-L231 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getUpdateFolderMetadataRequest | public BoxRequestsMetadata.UpdateItemMetadata getUpdateFolderMetadataRequest(String id, String scope, String template) {
BoxRequestsMetadata.UpdateItemMetadata request = new BoxRequestsMetadata.UpdateItemMetadata(getFolderMetadataUrl(id, scope, template), mSession);
return request;
} | java | public BoxRequestsMetadata.UpdateItemMetadata getUpdateFolderMetadataRequest(String id, String scope, String template) {
BoxRequestsMetadata.UpdateItemMetadata request = new BoxRequestsMetadata.UpdateItemMetadata(getFolderMetadataUrl(id, scope, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"UpdateItemMetadata",
"getUpdateFolderMetadataRequest",
"(",
"String",
"id",
",",
"String",
"scope",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"UpdateItemMetadata",
"request",
"=",
"new",
"BoxRequestsMetadata",
... | Gets a request that updates the metadata for a specific template on a folder
@param id id of the folder to retrieve metadata for
@param scope currently only global and enterprise scopes are supported
@param template metadata template to use
@return request to update metadata on a folder | [
"Gets",
"a",
"request",
"that",
"updates",
"the",
"metadata",
"for",
"a",
"specific",
"template",
"on",
"a",
"folder"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L241-L244 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getDeleteFileMetadataTemplateRequest | public BoxRequestsMetadata.DeleteFileMetadata getDeleteFileMetadataTemplateRequest(String id, String template) {
BoxRequestsMetadata.DeleteFileMetadata request = new BoxRequestsMetadata.DeleteFileMetadata(getFileMetadataUrl(id, template), mSession);
return request;
} | java | public BoxRequestsMetadata.DeleteFileMetadata getDeleteFileMetadataTemplateRequest(String id, String template) {
BoxRequestsMetadata.DeleteFileMetadata request = new BoxRequestsMetadata.DeleteFileMetadata(getFileMetadataUrl(id, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"DeleteFileMetadata",
"getDeleteFileMetadataTemplateRequest",
"(",
"String",
"id",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"DeleteFileMetadata",
"request",
"=",
"new",
"BoxRequestsMetadata",
".",
"DeleteFileMeta... | Gets a request that deletes the metadata for a specific template on a file
@param id id of the file to retrieve metadata for
@param template metadata template to use
@return request to delete metadata on a file | [
"Gets",
"a",
"request",
"that",
"deletes",
"the",
"metadata",
"for",
"a",
"specific",
"template",
"on",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L265-L268 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getDeleteFolderMetadataTemplateRequest | public BoxRequestsMetadata.DeleteItemMetadata getDeleteFolderMetadataTemplateRequest(String id, String template) {
BoxRequestsMetadata.DeleteItemMetadata request = new BoxRequestsMetadata.DeleteItemMetadata(getFolderMetadataUrl(id, template), mSession);
return request;
} | java | public BoxRequestsMetadata.DeleteItemMetadata getDeleteFolderMetadataTemplateRequest(String id, String template) {
BoxRequestsMetadata.DeleteItemMetadata request = new BoxRequestsMetadata.DeleteItemMetadata(getFolderMetadataUrl(id, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"DeleteItemMetadata",
"getDeleteFolderMetadataTemplateRequest",
"(",
"String",
"id",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"DeleteItemMetadata",
"request",
"=",
"new",
"BoxRequestsMetadata",
".",
"DeleteItemMe... | Gets a request that deletes the metadata for a specific template on a folder
@param id id of the folder to retrieve metadata for
@param template metadata template to use
@return request to delete metadata on a folder | [
"Gets",
"a",
"request",
"that",
"deletes",
"the",
"metadata",
"for",
"a",
"specific",
"template",
"on",
"a",
"folder"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L277-L280 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getMetadataTemplatesRequest | public BoxRequestsMetadata.GetMetadataTemplates getMetadataTemplatesRequest() {
BoxRequestsMetadata.GetMetadataTemplates request = new BoxRequestsMetadata.GetMetadataTemplates(getMetadataTemplatesUrl(), mSession);
return request;
} | java | public BoxRequestsMetadata.GetMetadataTemplates getMetadataTemplatesRequest() {
BoxRequestsMetadata.GetMetadataTemplates request = new BoxRequestsMetadata.GetMetadataTemplates(getMetadataTemplatesUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"GetMetadataTemplates",
"getMetadataTemplatesRequest",
"(",
")",
"{",
"BoxRequestsMetadata",
".",
"GetMetadataTemplates",
"request",
"=",
"new",
"BoxRequestsMetadata",
".",
"GetMetadataTemplates",
"(",
"getMetadataTemplatesUrl",
"(",
")",... | Gets a request that retrieves available metadata templates under the enterprise scope
@return request to retrieve available metadata templates | [
"Gets",
"a",
"request",
"that",
"retrieves",
"available",
"metadata",
"templates",
"under",
"the",
"enterprise",
"scope"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L288-L291 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java | BoxSession.logout | public BoxFutureTask<BoxSession> logout() {
final BoxFutureTask<BoxSession> task = (new BoxSessionLogoutRequest(this)).toTask();
new Thread(){
@Override
public void run() {
task.run();
}
}.start();
return task;
} | java | public BoxFutureTask<BoxSession> logout() {
final BoxFutureTask<BoxSession> task = (new BoxSessionLogoutRequest(this)).toTask();
new Thread(){
@Override
public void run() {
task.run();
}
}.start();
return task;
} | [
"public",
"BoxFutureTask",
"<",
"BoxSession",
">",
"logout",
"(",
")",
"{",
"final",
"BoxFutureTask",
"<",
"BoxSession",
">",
"task",
"=",
"(",
"new",
"BoxSessionLogoutRequest",
"(",
"this",
")",
")",
".",
"toTask",
"(",
")",
";",
"new",
"Thread",
"(",
"... | Logout the currently authenticated user.
@return a task that can be used to block until the user associated with this session has been logged out. | [
"Logout",
"the",
"currently",
"authenticated",
"user",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java#L467-L477 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java | BoxSession.refresh | public BoxFutureTask<BoxSession> refresh() {
if (mRefreshTask != null && mRefreshTask.get() != null){
BoxFutureTask<BoxSession> lastRefreshTask = mRefreshTask.get();
if (!(lastRefreshTask.isCancelled() || lastRefreshTask.isDone())){
return lastRefreshTask;
}
}
final BoxFutureTask<BoxSession> task = (new BoxSessionRefreshRequest(this)).toTask();
new Thread(){
@Override
public void run() {
task.run();
}
}.start();
mRefreshTask = new WeakReference<BoxFutureTask<BoxSession>>(task);
return task;
} | java | public BoxFutureTask<BoxSession> refresh() {
if (mRefreshTask != null && mRefreshTask.get() != null){
BoxFutureTask<BoxSession> lastRefreshTask = mRefreshTask.get();
if (!(lastRefreshTask.isCancelled() || lastRefreshTask.isDone())){
return lastRefreshTask;
}
}
final BoxFutureTask<BoxSession> task = (new BoxSessionRefreshRequest(this)).toTask();
new Thread(){
@Override
public void run() {
task.run();
}
}.start();
mRefreshTask = new WeakReference<BoxFutureTask<BoxSession>>(task);
return task;
} | [
"public",
"BoxFutureTask",
"<",
"BoxSession",
">",
"refresh",
"(",
")",
"{",
"if",
"(",
"mRefreshTask",
"!=",
"null",
"&&",
"mRefreshTask",
".",
"get",
"(",
")",
"!=",
"null",
")",
"{",
"BoxFutureTask",
"<",
"BoxSession",
">",
"lastRefreshTask",
"=",
"mRef... | Refresh authentication information associated with this session.
@return a task that can be used to block until the information associated with this session has been refreshed. | [
"Refresh",
"authentication",
"information",
"associated",
"with",
"this",
"session",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java#L485-L501 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java | BoxSession.onRefreshed | @Override
public void onRefreshed(BoxAuthentication.BoxAuthenticationInfo info) {
if (sameUser(info)) {
BoxAuthentication.BoxAuthenticationInfo.cloneInfo(mAuthInfo, info);
if (sessionAuthListener != null) {
sessionAuthListener.onRefreshed(info);
}
}
} | java | @Override
public void onRefreshed(BoxAuthentication.BoxAuthenticationInfo info) {
if (sameUser(info)) {
BoxAuthentication.BoxAuthenticationInfo.cloneInfo(mAuthInfo, info);
if (sessionAuthListener != null) {
sessionAuthListener.onRefreshed(info);
}
}
} | [
"@",
"Override",
"public",
"void",
"onRefreshed",
"(",
"BoxAuthentication",
".",
"BoxAuthenticationInfo",
"info",
")",
"{",
"if",
"(",
"sameUser",
"(",
"info",
")",
")",
"{",
"BoxAuthentication",
".",
"BoxAuthenticationInfo",
".",
"cloneInfo",
"(",
"mAuthInfo",
... | Called when this session has been refreshed with new authentication info.
@param info the latest info from a successful refresh. | [
"Called",
"when",
"this",
"session",
"has",
"been",
"refreshed",
"with",
"new",
"authentication",
"info",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java#L562-L570 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java | BoxSession.onAuthCreated | @Override
public void onAuthCreated(BoxAuthentication.BoxAuthenticationInfo info) {
if (sameUser(info) || getUserId() == null) {
BoxAuthentication.BoxAuthenticationInfo.cloneInfo(mAuthInfo, info);
if (info.getUser() != null) {
setUserId(info.getUser().getId());
}
if (sessionAuthListener != null) {
sessionAuthListener.onAuthCreated(info);
}
}
} | java | @Override
public void onAuthCreated(BoxAuthentication.BoxAuthenticationInfo info) {
if (sameUser(info) || getUserId() == null) {
BoxAuthentication.BoxAuthenticationInfo.cloneInfo(mAuthInfo, info);
if (info.getUser() != null) {
setUserId(info.getUser().getId());
}
if (sessionAuthListener != null) {
sessionAuthListener.onAuthCreated(info);
}
}
} | [
"@",
"Override",
"public",
"void",
"onAuthCreated",
"(",
"BoxAuthentication",
".",
"BoxAuthenticationInfo",
"info",
")",
"{",
"if",
"(",
"sameUser",
"(",
"info",
")",
"||",
"getUserId",
"(",
")",
"==",
"null",
")",
"{",
"BoxAuthentication",
".",
"BoxAuthentica... | Called when this user has logged in.
@param info the latest info from going through the login flow. | [
"Called",
"when",
"this",
"user",
"has",
"logged",
"in",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java#L577-L588 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java | BoxSession.onAuthFailure | @Override
public void onAuthFailure(BoxAuthentication.BoxAuthenticationInfo info, Exception ex) {
if (sameUser(info) || (info == null && getUserId() == null)) {
if (sessionAuthListener != null) {
sessionAuthListener.onAuthFailure(info, ex);
}
if (ex instanceof BoxException) {
BoxException.ErrorType errorType = ((BoxException) ex).getErrorType();
switch (errorType) {
case NETWORK_ERROR:
toastString(mApplicationContext, R.string.boxsdk_error_network_connection);
break;
case IP_BLOCKED:
}
}
}
} | java | @Override
public void onAuthFailure(BoxAuthentication.BoxAuthenticationInfo info, Exception ex) {
if (sameUser(info) || (info == null && getUserId() == null)) {
if (sessionAuthListener != null) {
sessionAuthListener.onAuthFailure(info, ex);
}
if (ex instanceof BoxException) {
BoxException.ErrorType errorType = ((BoxException) ex).getErrorType();
switch (errorType) {
case NETWORK_ERROR:
toastString(mApplicationContext, R.string.boxsdk_error_network_connection);
break;
case IP_BLOCKED:
}
}
}
} | [
"@",
"Override",
"public",
"void",
"onAuthFailure",
"(",
"BoxAuthentication",
".",
"BoxAuthenticationInfo",
"info",
",",
"Exception",
"ex",
")",
"{",
"if",
"(",
"sameUser",
"(",
"info",
")",
"||",
"(",
"info",
"==",
"null",
"&&",
"getUserId",
"(",
")",
"==... | Called when a failure occurs trying to authenticate or refresh.
@param info The last authentication information available, before the exception.
@param ex the exception that occurred. | [
"Called",
"when",
"a",
"failure",
"occurs",
"trying",
"to",
"authenticate",
"or",
"refresh",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxSession.java#L596-L614 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java | BoxRequestItemCopy.getName | public String getName() {
return mBodyMap.containsKey(BoxItem.FIELD_NAME) ?
(String) mBodyMap.get(BoxItem.FIELD_NAME) :
null;
} | java | public String getName() {
return mBodyMap.containsKey(BoxItem.FIELD_NAME) ?
(String) mBodyMap.get(BoxItem.FIELD_NAME) :
null;
} | [
"public",
"String",
"getName",
"(",
")",
"{",
"return",
"mBodyMap",
".",
"containsKey",
"(",
"BoxItem",
".",
"FIELD_NAME",
")",
"?",
"(",
"String",
")",
"mBodyMap",
".",
"get",
"(",
"BoxItem",
".",
"FIELD_NAME",
")",
":",
"null",
";",
"}"
] | Returns the name currently set for the item copy.
@return name for the item copy, or null if not set | [
"Returns",
"the",
"name",
"currently",
"set",
"for",
"the",
"item",
"copy",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java#L38-L42 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java | BoxRequestItemCopy.setName | public R setName(String name) {
mBodyMap.put(BoxItem.FIELD_NAME, name);
return (R) this;
} | java | public R setName(String name) {
mBodyMap.put(BoxItem.FIELD_NAME, name);
return (R) this;
} | [
"public",
"R",
"setName",
"(",
"String",
"name",
")",
"{",
"mBodyMap",
".",
"put",
"(",
"BoxItem",
".",
"FIELD_NAME",
",",
"name",
")",
";",
"return",
"(",
"R",
")",
"this",
";",
"}"
] | Sets the name used in the request for the item copy.
@param name name for the copy of the item.
@return request with the updated name. | [
"Sets",
"the",
"name",
"used",
"in",
"the",
"request",
"for",
"the",
"item",
"copy",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java#L50-L53 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java | BoxRequestItemCopy.getParentId | public String getParentId() {
return mBodyMap.containsKey(BoxItem.FIELD_PARENT) ?
((BoxFolder) mBodyMap.get(BoxItem.FIELD_PARENT)).getId() :
null;
} | java | public String getParentId() {
return mBodyMap.containsKey(BoxItem.FIELD_PARENT) ?
((BoxFolder) mBodyMap.get(BoxItem.FIELD_PARENT)).getId() :
null;
} | [
"public",
"String",
"getParentId",
"(",
")",
"{",
"return",
"mBodyMap",
".",
"containsKey",
"(",
"BoxItem",
".",
"FIELD_PARENT",
")",
"?",
"(",
"(",
"BoxFolder",
")",
"mBodyMap",
".",
"get",
"(",
"BoxItem",
".",
"FIELD_PARENT",
")",
")",
".",
"getId",
"(... | Returns the parent id currently set for the item copy.
@return id of the parent folder for the item copy. | [
"Returns",
"the",
"parent",
"id",
"currently",
"set",
"for",
"the",
"item",
"copy",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java#L60-L64 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java | BoxRequestItemCopy.setParentId | public R setParentId(String parentId) {
BoxFolder parentFolder = BoxFolder.createFromId(parentId);
mBodyMap.put(BoxItem.FIELD_PARENT, parentFolder);
return (R) this;
} | java | public R setParentId(String parentId) {
BoxFolder parentFolder = BoxFolder.createFromId(parentId);
mBodyMap.put(BoxItem.FIELD_PARENT, parentFolder);
return (R) this;
} | [
"public",
"R",
"setParentId",
"(",
"String",
"parentId",
")",
"{",
"BoxFolder",
"parentFolder",
"=",
"BoxFolder",
".",
"createFromId",
"(",
"parentId",
")",
";",
"mBodyMap",
".",
"put",
"(",
"BoxItem",
".",
"FIELD_PARENT",
",",
"parentFolder",
")",
";",
"ret... | Sets the parent id used in the request for the item copy.
@param parentId id of the parent folder for the item copy.
@return request with the updated parent id. | [
"Sets",
"the",
"parent",
"id",
"used",
"in",
"the",
"request",
"for",
"the",
"item",
"copy",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestItemCopy.java#L72-L76 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSession.java | BoxUploadSession.setPartsSha1 | public void setPartsSha1(List<String> sha1s) {
JsonArray jsonArray = new JsonArray();
for (String s : sha1s) {
jsonArray.add(s);
}
set(FIELD_PARTS_SHA1, jsonArray);
} | java | public void setPartsSha1(List<String> sha1s) {
JsonArray jsonArray = new JsonArray();
for (String s : sha1s) {
jsonArray.add(s);
}
set(FIELD_PARTS_SHA1, jsonArray);
} | [
"public",
"void",
"setPartsSha1",
"(",
"List",
"<",
"String",
">",
"sha1s",
")",
"{",
"JsonArray",
"jsonArray",
"=",
"new",
"JsonArray",
"(",
")",
";",
"for",
"(",
"String",
"s",
":",
"sha1s",
")",
"{",
"jsonArray",
".",
"add",
"(",
"s",
")",
";",
... | Util method for storing sha1 for parts being uploaded | [
"Util",
"method",
"for",
"storing",
"sha1",
"for",
"parts",
"being",
"uploaded"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSession.java#L136-L142 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSession.java | BoxUploadSession.getChunkSize | public static int getChunkSize(BoxUploadSession uploadSession, int partNumber, long fileSize) {
if (partNumber == uploadSession.getTotalParts() - 1) {
return (int) (fileSize - partNumber * uploadSession.getPartSize());
}
return uploadSession.getPartSize();
} | java | public static int getChunkSize(BoxUploadSession uploadSession, int partNumber, long fileSize) {
if (partNumber == uploadSession.getTotalParts() - 1) {
return (int) (fileSize - partNumber * uploadSession.getPartSize());
}
return uploadSession.getPartSize();
} | [
"public",
"static",
"int",
"getChunkSize",
"(",
"BoxUploadSession",
"uploadSession",
",",
"int",
"partNumber",
",",
"long",
"fileSize",
")",
"{",
"if",
"(",
"partNumber",
"==",
"uploadSession",
".",
"getTotalParts",
"(",
")",
"-",
"1",
")",
"{",
"return",
"(... | Computes the actual bytes to be sent in a part, which equals the partsize for all parts
except the last.
@param uploadSession
@param partNumber
@param fileSize
@return | [
"Computes",
"the",
"actual",
"bytes",
"to",
"be",
"sent",
"in",
"a",
"part",
"which",
"equals",
"the",
"partsize",
"for",
"all",
"parts",
"except",
"the",
"last",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxUploadSession.java#L160-L165 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxItem.java | BoxItem.getPathCollection | public BoxIterator<BoxFolder> getPathCollection() {
return (BoxIterator<BoxFolder>)getPropertyAsJsonObject(BoxJsonObject.getBoxJsonObjectCreator(BoxIteratorBoxEntity.class),FIELD_PATH_COLLECTION);
} | java | public BoxIterator<BoxFolder> getPathCollection() {
return (BoxIterator<BoxFolder>)getPropertyAsJsonObject(BoxJsonObject.getBoxJsonObjectCreator(BoxIteratorBoxEntity.class),FIELD_PATH_COLLECTION);
} | [
"public",
"BoxIterator",
"<",
"BoxFolder",
">",
"getPathCollection",
"(",
")",
"{",
"return",
"(",
"BoxIterator",
"<",
"BoxFolder",
">",
")",
"getPropertyAsJsonObject",
"(",
"BoxJsonObject",
".",
"getBoxJsonObjectCreator",
"(",
"BoxIteratorBoxEntity",
".",
"class",
... | Gets the path of folders to the item, starting at the root.
@return the path of folders to the item. | [
"Gets",
"the",
"path",
"of",
"folders",
"to",
"the",
"item",
"starting",
"at",
"the",
"root",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxItem.java#L122-L124 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxItem.java | BoxItem.createBoxItemFromJson | @Deprecated
public static BoxItem createBoxItemFromJson(final String json) {
BoxEntity createdByEntity = new BoxEntity();
createdByEntity.createFromJson(json);
if (createdByEntity.getType().equals(BoxFile.TYPE)) {
BoxFile file = new BoxFile();
file.createFromJson(json);
return file;
} else if (createdByEntity.getType().equals(BoxBookmark.TYPE)) {
BoxBookmark bookmark = new BoxBookmark();
bookmark.createFromJson(json);
return bookmark;
} else if (createdByEntity.getType().equals(BoxFolder.TYPE)) {
BoxFolder folder = new BoxFolder();
folder.createFromJson(json);
return folder;
}
return null;
} | java | @Deprecated
public static BoxItem createBoxItemFromJson(final String json) {
BoxEntity createdByEntity = new BoxEntity();
createdByEntity.createFromJson(json);
if (createdByEntity.getType().equals(BoxFile.TYPE)) {
BoxFile file = new BoxFile();
file.createFromJson(json);
return file;
} else if (createdByEntity.getType().equals(BoxBookmark.TYPE)) {
BoxBookmark bookmark = new BoxBookmark();
bookmark.createFromJson(json);
return bookmark;
} else if (createdByEntity.getType().equals(BoxFolder.TYPE)) {
BoxFolder folder = new BoxFolder();
folder.createFromJson(json);
return folder;
}
return null;
} | [
"@",
"Deprecated",
"public",
"static",
"BoxItem",
"createBoxItemFromJson",
"(",
"final",
"String",
"json",
")",
"{",
"BoxEntity",
"createdByEntity",
"=",
"new",
"BoxEntity",
"(",
")",
";",
"createdByEntity",
".",
"createFromJson",
"(",
"json",
")",
";",
"if",
... | Deprecated use BoxEntity.createEntityFromJson. FromCreates a BoxItem object from a JSON string.
@param json JSON string to convert to a BoxItem.
@return BoxItem object representing information in the JSON string. | [
"Deprecated",
"use",
"BoxEntity",
".",
"createEntityFromJson",
".",
"FromCreates",
"a",
"BoxItem",
"object",
"from",
"a",
"JSON",
"string",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxItem.java#L314-L333 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getUploadSessionForNewFileVersionUrl | protected String getUploadSessionForNewFileVersionUrl(final String id) {
return String.format(Locale.ENGLISH, "%s/files/%s/upload_sessions", getBaseUploadUri(), id);
} | java | protected String getUploadSessionForNewFileVersionUrl(final String id) {
return String.format(Locale.ENGLISH, "%s/files/%s/upload_sessions", getBaseUploadUri(), id);
} | [
"protected",
"String",
"getUploadSessionForNewFileVersionUrl",
"(",
"final",
"String",
"id",
")",
"{",
"return",
"String",
".",
"format",
"(",
"Locale",
".",
"ENGLISH",
",",
"\"%s/files/%s/upload_sessions\"",
",",
"getBaseUploadUri",
"(",
")",
",",
"id",
")",
";",... | Get the URL for uploading file a new version of a file in chunks
@param id id of file to retrieve info on
@return the upload sessions URL | [
"Get",
"the",
"URL",
"for",
"uploading",
"file",
"a",
"new",
"version",
"of",
"a",
"file",
"in",
"chunks"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L162-L164 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getInfoRequest | public BoxRequestsFile.GetFileInfo getInfoRequest(final String id) {
BoxRequestsFile.GetFileInfo request = new BoxRequestsFile.GetFileInfo(id, getFileInfoUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.GetFileInfo getInfoRequest(final String id) {
BoxRequestsFile.GetFileInfo request = new BoxRequestsFile.GetFileInfo(id, getFileInfoUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"GetFileInfo",
"getInfoRequest",
"(",
"final",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"GetFileInfo",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"GetFileInfo",
"(",
"id",
",",
"getFileInfoUrl",
"(",
"id",
")",
",",... | Gets a request that retrieves information on a file
@param id id of file to retrieve info on
@return request to get a files information | [
"Gets",
"a",
"request",
"that",
"retrieves",
"information",
"on",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L174-L177 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getEmbedLinkRequest | public BoxRequestsFile.GetEmbedLinkFileInfo getEmbedLinkRequest(final String id) {
BoxRequestsFile.GetEmbedLinkFileInfo request = new BoxRequestsFile.GetEmbedLinkFileInfo(id, getFileInfoUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.GetEmbedLinkFileInfo getEmbedLinkRequest(final String id) {
BoxRequestsFile.GetEmbedLinkFileInfo request = new BoxRequestsFile.GetEmbedLinkFileInfo(id, getFileInfoUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"GetEmbedLinkFileInfo",
"getEmbedLinkRequest",
"(",
"final",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"GetEmbedLinkFileInfo",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"GetEmbedLinkFileInfo",
"(",
"id",
",",
"getFileInfoUr... | Gets a request that retrieves an expiring embedded link which can be embedded in a webview for a preview.
@param id id of file to retrieve info on
@return request to get a files information | [
"Gets",
"a",
"request",
"that",
"retrieves",
"an",
"expiring",
"embedded",
"link",
"which",
"can",
"be",
"embedded",
"in",
"a",
"webview",
"for",
"a",
"preview",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L186-L189 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getUpdateRequest | public BoxRequestsFile.UpdateFile getUpdateRequest(String id) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.UpdateFile getUpdateRequest(String id) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UpdateFile",
"getUpdateRequest",
"(",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"UpdateFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UpdateFile",
"(",
"id",
",",
"getFileInfoUrl",
"(",
"id",
")",
",",
"mSession... | Gets a request that updates a file's information
@param id id of file to update information on
@return request to update a file's information | [
"Gets",
"a",
"request",
"that",
"updates",
"a",
"file",
"s",
"information"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L197-L200 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getCopyRequest | public BoxRequestsFile.CopyFile getCopyRequest(String id, String parentId) {
BoxRequestsFile.CopyFile request = new BoxRequestsFile.CopyFile(id, parentId, getFileCopyUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.CopyFile getCopyRequest(String id, String parentId) {
BoxRequestsFile.CopyFile request = new BoxRequestsFile.CopyFile(id, parentId, getFileCopyUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"CopyFile",
"getCopyRequest",
"(",
"String",
"id",
",",
"String",
"parentId",
")",
"{",
"BoxRequestsFile",
".",
"CopyFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"CopyFile",
"(",
"id",
",",
"parentId",
",",
"getFileCopy... | Gets a request that copies a file
@param id id of the file to copy
@param parentId id of the parent folder to copy the file into
@return request to copy a file | [
"Gets",
"a",
"request",
"that",
"copies",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L209-L212 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getRenameRequest | public BoxRequestsFile.UpdateFile getRenameRequest(String id, String newName) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
request.setName(newName);
return request;
} | java | public BoxRequestsFile.UpdateFile getRenameRequest(String id, String newName) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
request.setName(newName);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UpdateFile",
"getRenameRequest",
"(",
"String",
"id",
",",
"String",
"newName",
")",
"{",
"BoxRequestsFile",
".",
"UpdateFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UpdateFile",
"(",
"id",
",",
"getFileInfoUrl",
"(",
... | Gets a request that renames a file
@param id id of file to rename
@param newName id of file to retrieve info on
@return request to rename a file | [
"Gets",
"a",
"request",
"that",
"renames",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L221-L225 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getMoveRequest | public BoxRequestsFile.UpdateFile getMoveRequest(String id, String parentId) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
request.setParentId(parentId);
return request;
} | java | public BoxRequestsFile.UpdateFile getMoveRequest(String id, String parentId) {
BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
request.setParentId(parentId);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UpdateFile",
"getMoveRequest",
"(",
"String",
"id",
",",
"String",
"parentId",
")",
"{",
"BoxRequestsFile",
".",
"UpdateFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UpdateFile",
"(",
"id",
",",
"getFileInfoUrl",
"(",
... | Gets a request that moves a file to another folder
@param id id of file to move
@param parentId id of parent folder to move file into
@return request to move a file | [
"Gets",
"a",
"request",
"that",
"moves",
"a",
"file",
"to",
"another",
"folder"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L234-L238 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getCreateSharedLinkRequest | public BoxRequestsFile.UpdatedSharedFile getCreateSharedLinkRequest(String id) {
BoxRequestsFile.UpdatedSharedFile request = new BoxRequestsFile.UpdatedSharedFile(id, getFileInfoUrl(id), mSession)
.setAccess(null);
return request;
} | java | public BoxRequestsFile.UpdatedSharedFile getCreateSharedLinkRequest(String id) {
BoxRequestsFile.UpdatedSharedFile request = new BoxRequestsFile.UpdatedSharedFile(id, getFileInfoUrl(id), mSession)
.setAccess(null);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UpdatedSharedFile",
"getCreateSharedLinkRequest",
"(",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"UpdatedSharedFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UpdatedSharedFile",
"(",
"id",
",",
"getFileInfoUrl",
"(",
... | Gets a request that creates a shared link for a file
@param id id of file to create shared link for
@return request to create a shared link for a file | [
"Gets",
"a",
"request",
"that",
"creates",
"a",
"shared",
"link",
"for",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L257-L261 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getAddCommentRequest | public BoxRequestsFile.AddCommentToFile getAddCommentRequest(String fileId, String message) {
BoxRequestsFile.AddCommentToFile request = new BoxRequestsFile.AddCommentToFile(fileId, message, getCommentUrl(), mSession);
return request;
} | java | public BoxRequestsFile.AddCommentToFile getAddCommentRequest(String fileId, String message) {
BoxRequestsFile.AddCommentToFile request = new BoxRequestsFile.AddCommentToFile(fileId, message, getCommentUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"AddCommentToFile",
"getAddCommentRequest",
"(",
"String",
"fileId",
",",
"String",
"message",
")",
"{",
"BoxRequestsFile",
".",
"AddCommentToFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"AddCommentToFile",
"(",
"fileId",
","... | Gets a request that adds a comment to a file
@param fileId id of the file to add the comment to
@param message message for the comment that will be added
@return request to add a comment to a file | [
"Gets",
"a",
"request",
"that",
"adds",
"a",
"comment",
"to",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L282-L285 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getAddTaggedCommentRequest | public BoxRequestsFile.AddTaggedCommentToFile getAddTaggedCommentRequest(String fileId, String taggedMessage) {
BoxRequestsFile.AddTaggedCommentToFile request = new BoxRequestsFile.AddTaggedCommentToFile(
fileId, taggedMessage, getCommentUrl(), mSession);
return request;
} | java | public BoxRequestsFile.AddTaggedCommentToFile getAddTaggedCommentRequest(String fileId, String taggedMessage) {
BoxRequestsFile.AddTaggedCommentToFile request = new BoxRequestsFile.AddTaggedCommentToFile(
fileId, taggedMessage, getCommentUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"AddTaggedCommentToFile",
"getAddTaggedCommentRequest",
"(",
"String",
"fileId",
",",
"String",
"taggedMessage",
")",
"{",
"BoxRequestsFile",
".",
"AddTaggedCommentToFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"AddTaggedCommentToF... | Gets a request for adding a comment with tags that mention users.
The server will notify mentioned users of the comment.
Tagged users must be collaborators of the parent folder.
Format for adding a tag @[userid:username], E.g. "Hello @[12345:Jane Doe]" will create a comment
'Hello Jane Doe', and notify Jane that she has been mentioned.
@param fileId id of the file to add the comment to
@param taggedMessage message for the comment that will be added
@return request to add a comment to a file | [
"Gets",
"a",
"request",
"for",
"adding",
"a",
"comment",
"with",
"tags",
"that",
"mention",
"users",
".",
"The",
"server",
"will",
"notify",
"mentioned",
"users",
"of",
"the",
"comment",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L299-L303 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getUploadRequest | public BoxRequestsFile.UploadFile getUploadRequest(InputStream fileInputStream, String fileName, String destinationFolderId){
BoxRequestsFile.UploadFile request = new BoxRequestsFile.UploadFile(fileInputStream, fileName, destinationFolderId, getFileUploadUrl(), mSession);
return request;
} | java | public BoxRequestsFile.UploadFile getUploadRequest(InputStream fileInputStream, String fileName, String destinationFolderId){
BoxRequestsFile.UploadFile request = new BoxRequestsFile.UploadFile(fileInputStream, fileName, destinationFolderId, getFileUploadUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UploadFile",
"getUploadRequest",
"(",
"InputStream",
"fileInputStream",
",",
"String",
"fileName",
",",
"String",
"destinationFolderId",
")",
"{",
"BoxRequestsFile",
".",
"UploadFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"... | Gets a request that uploads a file from an input stream
@param fileInputStream input stream of the file
@param fileName name of the new file
@param destinationFolderId id of the parent folder for the new file
@return request to upload a file from an input stream | [
"Gets",
"a",
"request",
"that",
"uploads",
"a",
"file",
"from",
"an",
"input",
"stream"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L313-L316 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getUploadRequest | public BoxRequestsFile.UploadFile getUploadRequest(File file, String destinationFolderId) {
BoxRequestsFile.UploadFile request = new BoxRequestsFile.UploadFile(file, destinationFolderId, getFileUploadUrl(), mSession);
return request;
} | java | public BoxRequestsFile.UploadFile getUploadRequest(File file, String destinationFolderId) {
BoxRequestsFile.UploadFile request = new BoxRequestsFile.UploadFile(file, destinationFolderId, getFileUploadUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UploadFile",
"getUploadRequest",
"(",
"File",
"file",
",",
"String",
"destinationFolderId",
")",
"{",
"BoxRequestsFile",
".",
"UploadFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UploadFile",
"(",
"file",
",",
"destination... | Gets a request that uploads a file from an existing file
@param file file to upload
@param destinationFolderId id of the parent folder for the new file
@return request to upload a file from an existing file | [
"Gets",
"a",
"request",
"that",
"uploads",
"a",
"file",
"from",
"an",
"existing",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L324-L327 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getUploadNewVersionRequest | public BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(InputStream fileInputStream, String destinationFileId){
BoxRequestsFile.UploadNewVersion request = new BoxRequestsFile.UploadNewVersion(fileInputStream, getFileUploadNewVersionUrl(destinationFileId), mSession);
return request;
} | java | public BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(InputStream fileInputStream, String destinationFileId){
BoxRequestsFile.UploadNewVersion request = new BoxRequestsFile.UploadNewVersion(fileInputStream, getFileUploadNewVersionUrl(destinationFileId), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"UploadNewVersion",
"getUploadNewVersionRequest",
"(",
"InputStream",
"fileInputStream",
",",
"String",
"destinationFileId",
")",
"{",
"BoxRequestsFile",
".",
"UploadNewVersion",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"UploadNewVers... | Gets a request that uploads a new file version from an input stream
@param fileInputStream input stream of the new file version
@param destinationFileId id of the file to upload a new version of
@return request to upload a new file version from an input stream | [
"Gets",
"a",
"request",
"that",
"uploads",
"a",
"new",
"file",
"version",
"from",
"an",
"input",
"stream"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L336-L339 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getUploadNewVersionRequest | public BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(File file, String destinationFileId) {
try {
BoxRequestsFile.UploadNewVersion request = getUploadNewVersionRequest(new FileInputStream(file), destinationFileId);
request.setUploadSize(file.length());
request.setModifiedDate(new Date(file.lastModified()));
return request;
} catch (FileNotFoundException e) {
throw new IllegalArgumentException(e);
}
} | java | public BoxRequestsFile.UploadNewVersion getUploadNewVersionRequest(File file, String destinationFileId) {
try {
BoxRequestsFile.UploadNewVersion request = getUploadNewVersionRequest(new FileInputStream(file), destinationFileId);
request.setUploadSize(file.length());
request.setModifiedDate(new Date(file.lastModified()));
return request;
} catch (FileNotFoundException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"BoxRequestsFile",
".",
"UploadNewVersion",
"getUploadNewVersionRequest",
"(",
"File",
"file",
",",
"String",
"destinationFileId",
")",
"{",
"try",
"{",
"BoxRequestsFile",
".",
"UploadNewVersion",
"request",
"=",
"getUploadNewVersionRequest",
"(",
"new",
"File... | Gets a request that uploads a new file version from an existing file
@param file file to upload as a new version
@param destinationFileId id of the file to upload a new version of
@return request to upload a new file version from an existing file | [
"Gets",
"a",
"request",
"that",
"uploads",
"a",
"new",
"file",
"version",
"from",
"an",
"existing",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L348-L357 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadRequest | public BoxRequestsFile.DownloadFile getDownloadRequest(File target, String fileId) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(fileId, target, getFileDownloadUrl(fileId),mSession);
return request;
} | java | public BoxRequestsFile.DownloadFile getDownloadRequest(File target, String fileId) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(fileId, target, getFileDownloadUrl(fileId),mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"DownloadFile",
"getDownloadRequest",
"(",
"File",
"target",
",",
"String",
"fileId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"target",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"("... | Gets a request that downloads a given file to a target file
@param target target file to download to, target can be either a directory or a file
@param fileId id of the file to download
@return request to download a file to a target file
@throws IOException throws FileNotFoundException if target file does not exist. | [
"Gets",
"a",
"request",
"that",
"downloads",
"a",
"given",
"file",
"to",
"a",
"target",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L367-L373 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadUrlRequest | public BoxRequestsFile.DownloadFile getDownloadUrlRequest(File target, String url) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(target, url,mSession);
return request;
} | java | public BoxRequestsFile.DownloadFile getDownloadUrlRequest(File target, String url) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(target, url,mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"DownloadFile",
"getDownloadUrlRequest",
"(",
"File",
"target",
",",
"String",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"target",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"("... | Gets a request that downloads a given asset from the url to a target file
This is used to download miscellaneous url assets for instance from the representations endpoint.
@param target target file to download to, target can be either a directory or a file
@param url url of the asset to download
@return request to download a file to a target file
@throws IOException throws FileNotFoundException if target file does not exist. | [
"Gets",
"a",
"request",
"that",
"downloads",
"a",
"given",
"asset",
"from",
"the",
"url",
"to",
"a",
"target",
"file",
"This",
"is",
"used",
"to",
"download",
"miscellaneous",
"url",
"assets",
"for",
"instance",
"from",
"the",
"representations",
"endpoint",
... | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L383-L389 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadRequest | public BoxRequestsFile.DownloadFile getDownloadRequest(OutputStream outputStream, String fileId) {
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(fileId, outputStream, getFileDownloadUrl(fileId),mSession);
return request;
} | java | public BoxRequestsFile.DownloadFile getDownloadRequest(OutputStream outputStream, String fileId) {
BoxRequestsFile.DownloadFile request = new BoxRequestsFile.DownloadFile(fileId, outputStream, getFileDownloadUrl(fileId),mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"DownloadFile",
"getDownloadRequest",
"(",
"OutputStream",
"outputStream",
",",
"String",
"fileId",
")",
"{",
"BoxRequestsFile",
".",
"DownloadFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"DownloadFile",
"(",
"fileId",
",",
... | Gets a request that downloads the given file to the provided outputStream. Developer is responsible for closing the outputStream provided.
@param outputStream outputStream to write file contents to.
@param fileId the file id to download.
@return request to download a file to an output stream | [
"Gets",
"a",
"request",
"that",
"downloads",
"the",
"given",
"file",
"to",
"the",
"provided",
"outputStream",
".",
"Developer",
"is",
"responsible",
"for",
"closing",
"the",
"outputStream",
"provided",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L398-L401 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadThumbnailRequest | public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(File target, String fileId) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
if (target.isDirectory()){
throw new RuntimeException("This endpoint only supports files and does not support directories");
}
BoxRequestsFile.DownloadThumbnail request = new BoxRequestsFile.DownloadThumbnail(fileId, target, getThumbnailFileDownloadUrl(fileId), mSession);
return request;
} | java | public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(File target, String fileId) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
if (target.isDirectory()){
throw new RuntimeException("This endpoint only supports files and does not support directories");
}
BoxRequestsFile.DownloadThumbnail request = new BoxRequestsFile.DownloadThumbnail(fileId, target, getThumbnailFileDownloadUrl(fileId), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"DownloadThumbnail",
"getDownloadThumbnailRequest",
"(",
"File",
"target",
",",
"String",
"fileId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"target",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileNotFoundExc... | Gets a request that downloads a thumbnail to a target file
@param target target file to download to, target can only be a file
@param fileId id of file to download the thumbnail of
@return request to download a thumbnail to a target file
@throws IOException throws FileNotFoundException if target file does not exist. | [
"Gets",
"a",
"request",
"that",
"downloads",
"a",
"thumbnail",
"to",
"a",
"target",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L411-L420 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadThumbnailRequest | public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(OutputStream outputStream, String fileId) {
BoxRequestsFile.DownloadThumbnail request = new BoxRequestsFile.DownloadThumbnail(fileId, outputStream, getThumbnailFileDownloadUrl(fileId), mSession);
return request;
} | java | public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(OutputStream outputStream, String fileId) {
BoxRequestsFile.DownloadThumbnail request = new BoxRequestsFile.DownloadThumbnail(fileId, outputStream, getThumbnailFileDownloadUrl(fileId), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"DownloadThumbnail",
"getDownloadThumbnailRequest",
"(",
"OutputStream",
"outputStream",
",",
"String",
"fileId",
")",
"{",
"BoxRequestsFile",
".",
"DownloadThumbnail",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"DownloadThumbnail",
"... | Gets a request that downloads the given file thumbnail to the provided outputStream. Developer is responsible for closing the outputStream provided.
@param outputStream outputStream to write file contents to.
@param fileId the file id to download.
@return request to download a file thumbnail | [
"Gets",
"a",
"request",
"that",
"downloads",
"the",
"given",
"file",
"thumbnail",
"to",
"the",
"provided",
"outputStream",
".",
"Developer",
"is",
"responsible",
"for",
"closing",
"the",
"outputStream",
"provided",
"."
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L429-L432 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadRepresentationRequest | public BoxRequestsFile.DownloadRepresentation getDownloadRepresentationRequest(String id, File targetFile, BoxRepresentation representation) {
return new BoxRequestsFile.DownloadRepresentation(id, targetFile, representation, mSession);
} | java | public BoxRequestsFile.DownloadRepresentation getDownloadRepresentationRequest(String id, File targetFile, BoxRepresentation representation) {
return new BoxRequestsFile.DownloadRepresentation(id, targetFile, representation, mSession);
} | [
"public",
"BoxRequestsFile",
".",
"DownloadRepresentation",
"getDownloadRepresentationRequest",
"(",
"String",
"id",
",",
"File",
"targetFile",
",",
"BoxRepresentation",
"representation",
")",
"{",
"return",
"new",
"BoxRequestsFile",
".",
"DownloadRepresentation",
"(",
"i... | Gets a request to download a representation object for a given file representation
@param id id of the file to get the representation from
@param targetFile file to store the thumbnail
@param representation the representation to be downloaded
@return request to download the representation | [
"Gets",
"a",
"request",
"to",
"download",
"a",
"representation",
"object",
"for",
"a",
"given",
"file",
"representation"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L442-L444 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getTrashedFileRequest | public BoxRequestsFile.GetTrashedFile getTrashedFileRequest(String id) {
BoxRequestsFile.GetTrashedFile request = new BoxRequestsFile.GetTrashedFile(id, getTrashedFileUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.GetTrashedFile getTrashedFileRequest(String id) {
BoxRequestsFile.GetTrashedFile request = new BoxRequestsFile.GetTrashedFile(id, getTrashedFileUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"GetTrashedFile",
"getTrashedFileRequest",
"(",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"GetTrashedFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"GetTrashedFile",
"(",
"id",
",",
"getTrashedFileUrl",
"(",
"id",
")"... | Gets a request that returns a file in the trash
@param id id of file to get in the trash
@return request to get a file from the trash | [
"Gets",
"a",
"request",
"that",
"returns",
"a",
"file",
"in",
"the",
"trash"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L452-L455 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDeleteTrashedFileRequest | public BoxRequestsFile.DeleteTrashedFile getDeleteTrashedFileRequest(String id) {
BoxRequestsFile.DeleteTrashedFile request = new BoxRequestsFile.DeleteTrashedFile(id, getTrashedFileUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.DeleteTrashedFile getDeleteTrashedFileRequest(String id) {
BoxRequestsFile.DeleteTrashedFile request = new BoxRequestsFile.DeleteTrashedFile(id, getTrashedFileUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"DeleteTrashedFile",
"getDeleteTrashedFileRequest",
"(",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"DeleteTrashedFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"DeleteTrashedFile",
"(",
"id",
",",
"getTrashedFileUrl",
"("... | Gets a request that permanently deletes a file from the trash
@param id id of file to delete from the trash
@return request to permanently delete a file from the trash | [
"Gets",
"a",
"request",
"that",
"permanently",
"deletes",
"a",
"file",
"from",
"the",
"trash"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L463-L466 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getRestoreTrashedFileRequest | public BoxRequestsFile.RestoreTrashedFile getRestoreTrashedFileRequest(String id) {
BoxRequestsFile.RestoreTrashedFile request = new BoxRequestsFile.RestoreTrashedFile(id, getFileInfoUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.RestoreTrashedFile getRestoreTrashedFileRequest(String id) {
BoxRequestsFile.RestoreTrashedFile request = new BoxRequestsFile.RestoreTrashedFile(id, getFileInfoUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"RestoreTrashedFile",
"getRestoreTrashedFileRequest",
"(",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"RestoreTrashedFile",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"RestoreTrashedFile",
"(",
"id",
",",
"getFileInfoUrl",
"(... | Gets a request that restores a trashed file
@param id id of file to restore
@return request to restore a file from the trash | [
"Gets",
"a",
"request",
"that",
"restores",
"a",
"trashed",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L474-L477 | train |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getCommentsRequest | public BoxRequestsFile.GetFileComments getCommentsRequest(String id) {
BoxRequestsFile.GetFileComments request = new BoxRequestsFile.GetFileComments(id, getFileCommentsUrl(id), mSession);
return request;
} | java | public BoxRequestsFile.GetFileComments getCommentsRequest(String id) {
BoxRequestsFile.GetFileComments request = new BoxRequestsFile.GetFileComments(id, getFileCommentsUrl(id), mSession);
return request;
} | [
"public",
"BoxRequestsFile",
".",
"GetFileComments",
"getCommentsRequest",
"(",
"String",
"id",
")",
"{",
"BoxRequestsFile",
".",
"GetFileComments",
"request",
"=",
"new",
"BoxRequestsFile",
".",
"GetFileComments",
"(",
"id",
",",
"getFileCommentsUrl",
"(",
"id",
")... | Gets a request that retrieves the comments on a file
@param id id of the file to retrieve comments for
@return request to retrieve comments on a file | [
"Gets",
"a",
"request",
"that",
"retrieves",
"the",
"comments",
"on",
"a",
"file"
] | a621ad5ddebf23067fec27529130d72718fc0e88 | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L485-L488 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.