code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private void addFoldersToSearchIn(final List<String> folders) {
if (null == folders) {
return;
}
for (String folder : folders) {
if (!CmsResource.isFolder(folder)) {
folder += "/";
}
m_foldersToSearchIn.add(folder);
}
... | java |
private void setSearchScopeFilter(CmsObject cms) {
final List<String> searchRoots = CmsSearchUtil.computeScopeFolders(cms, this);
// If the resource types contain the type "function" also
// add "/system/modules/" to the search path
if ((null != getResourceTypes()) && containsFunction... | java |
private String dbProp(String name) {
String dbType = m_setupBean.getDatabase();
Object prop = m_setupBean.getDatabaseProperties().get(dbType).get(dbType + "." + name);
if (prop == null) {
return "";
}
return prop.toString();
} | java |
protected void add(Widget child, Element container) {
// Detach new child.
child.removeFromParent();
// Logical attach.
getChildren().add(child);
// Physical attach.
DOM.appendChild(container, child.getElement());
// Adopt.
adopt(child);
} | java |
protected int adjustIndex(Widget child, int beforeIndex) {
checkIndexBoundsForInsertion(beforeIndex);
// Check to see if this widget is already a direct child.
if (child.getParent() == this) {
// If the Widget's previous position was left of the desired new position
// ... | java |
protected void beginDragging(MouseDownEvent event) {
m_dragging = true;
m_windowWidth = Window.getClientWidth();
m_clientLeft = Document.get().getBodyOffsetLeft();
m_clientTop = Document.get().getBodyOffsetTop();
DOM.setCapture(getElement());
m_dragStartX = event.getX();... | java |
protected void endDragging(MouseUpEvent event) {
m_dragging = false;
DOM.releaseCapture(getElement());
removeStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().dragging());
} | java |
public Map<String, String> getParams() {
Map<String, String> params = new HashMap<>(1);
params.put(PARAM_COLLAPSED, Boolean.TRUE.toString());
return params;
} | java |
public static boolean updatingIndexNecessesary(CmsObject cms) {
// Set request to the offline project.
setCmsOfflineProject(cms);
// Check whether the spellcheck index directories are empty.
// If they are, the index has to be built obviously.
if (isSolrSpellcheckIndexDirectory... | java |
private static String getSolrSpellcheckRfsPath() {
String sPath = OpenCms.getSystemInfo().getWebInfRfsPath();
if (!OpenCms.getSystemInfo().getWebInfRfsPath().endsWith(File.separator)) {
sPath += File.separator;
}
return sPath + "solr" + File.separator + "spellcheck" + File... | java |
private static void readAndAddDocumentsFromStream(
final SolrClient client,
final String lang,
final InputStream is,
final List<SolrInputDocument> documents,
final boolean closeStream) {
final BufferedReader br = new BufferedReader(new InputStreamReader(is));
tr... | java |
private static void setCmsOfflineProject(CmsObject cms) {
if (null == cms) {
return;
}
final CmsRequestContext cmsContext = cms.getRequestContext();
final CmsProject cmsProject = cmsContext.getCurrentProject();
if (cmsProject.isOnlineProject()) {
CmsPro... | java |
private String toPath(String name, IconSize size) {
return CmsStringUtil.joinPaths(CmsWorkplace.getSkinUri(), ICON_FOLDER, "" + name.hashCode()) + size.getSuffix();
} | java |
private String toRfsName(String name, IconSize size) {
return CmsStringUtil.joinPaths(m_cache.getRepositoryPath(), "" + name.hashCode()) + size.getSuffix();
} | java |
private I_CmsSearchIndex getIndex() {
I_CmsSearchIndex index = null;
// get the configured index or the selected index
if (isInitialCall()) {
// the search form is in the initial state
// get the configured index
index = OpenCms.getSearchManager().getIndex(ge... | java |
public void transform(String name, String transform) throws Exception {
File configFile = new File(m_configDir, name);
File transformFile = new File(m_xsltDir, transform);
try (InputStream stream = new FileInputStream(transformFile)) {
StreamSource source = new StreamSource(stream);... | java |
public void transformConfig() throws Exception {
List<TransformEntry> entries = readTransformEntries(new File(m_xsltDir, "transforms.xml"));
for (TransformEntry entry : entries) {
transform(entry.getConfigFile(), entry.getXslt());
}
m_isDone = true;
} | java |
public String validationErrors() {
List<String> errors = new ArrayList<>();
for (File config : getConfigFiles()) {
String filename = config.getName();
try (FileInputStream stream = new FileInputStream(config)) {
CmsXmlUtils.unmarshalHelper(CmsFileUtil.readFully(s... | java |
private List<File> getConfigFiles() {
String[] filenames = {
"opencms-modules.xml",
"opencms-system.xml",
"opencms-vfs.xml",
"opencms-importexport.xml",
"opencms-sites.xml",
"opencms-variables.xml",
"opencms-scheduler.xml",
... | java |
private List<TransformEntry> readTransformEntries(File file) throws Exception {
List<TransformEntry> result = new ArrayList<>();
try (FileInputStream fis = new FileInputStream(file)) {
byte[] data = CmsFileUtil.readFully(fis, false);
Document doc = CmsXmlUtils.unmarshalHelper(da... | java |
private void transform(File file, Source transformSource)
throws TransformerConfigurationException, IOException, SAXException, TransformerException,
ParserConfigurationException {
Transformer transformer = m_transformerFactory.newTransformer(transformSource);
transformer.setOutputProperty(Outpu... | java |
public List<CmsJspNavElement> getSubNavigation() {
if (m_subNavigation == null) {
if (m_resource.isFile()) {
m_subNavigation = Collections.emptyList();
} else if (m_navContext == null) {
try {
throw new Exception("Can not get subnaviga... | java |
private Map<String, String> getLocaleProperties() {
if (m_localeProperties == null) {
m_localeProperties = CmsCollectionsGenericWrapper.createLazyMap(
new CmsProperty.CmsPropertyLocaleTransformer(m_properties, m_locale));
}
return m_localeProperties;
} | java |
public void setEveryWorkingDay(final boolean isEveryWorkingDay) {
if (m_model.isEveryWorkingDay() != isEveryWorkingDay) {
removeExceptionsOnChange(new Command() {
public void execute() {
m_model.setEveryWorkingDay(Boolean.valueOf(isEveryWorkingDay));
... | java |
private void removeListener(CmsUUID listenerId) {
getRequest().getSession().removeAttribute(SESSION_ATTRIBUTE_LISTENER_ID);
m_listeners.remove(listenerId);
} | java |
private Map<String, String> parseAttributes(I_CmsXmlContentLocation formatterLoc) {
Map<String, String> result = new LinkedHashMap<>();
for (I_CmsXmlContentValueLocation mappingLoc : formatterLoc.getSubValues(N_ATTRIBUTE)) {
String key = CmsConfigurationReader.getString(m_cms, mappingLoc.ge... | java |
public Set<String> getConfiguredWorkplaceBundles() {
CmsADEConfigData configData = internalLookupConfiguration(null, null);
return configData.getConfiguredWorkplaceBundles();
} | java |
public static String removeOpenCmsContext(final String path) {
String context = OpenCms.getSystemInfo().getOpenCmsContext();
if (path.startsWith(context + "/")) {
return path.substring(context.length());
}
String renderPrefix = OpenCms.getStaticExportManager().getVfsPrefix()... | java |
public String getPermalink(CmsObject cms, String resourceName, CmsUUID detailContentId) {
String permalink = "";
try {
permalink = substituteLink(cms, CmsPermalinkResourceHandler.PERMALINK_HANDLER);
String id = cms.readResource(resourceName, CmsResourceFilter.ALL).getStructureId... | java |
public String getPermalinkForCurrentPage(CmsObject cms) {
return getPermalink(cms, cms.getRequestContext().getUri(), cms.getRequestContext().getDetailContentId());
} | java |
public String getWorkplaceLink(CmsObject cms, String resourceName, boolean forceSecure) {
String result = substituteLinkForUnknownTarget(cms, resourceName, forceSecure);
return appendServerPrefix(cms, result, resourceName, true);
} | java |
private Table buildTable(CmsSqlConsoleResults results) {
IndexedContainer container = new IndexedContainer();
int numCols = results.getColumns().size();
for (int c = 0; c < numCols; c++) {
container.addContainerProperty(Integer.valueOf(c), results.getColumnType(c), null);
}
... | java |
private void updateImageInfo() {
String crop = getCrop();
String point = getPoint();
m_imageInfoDisplay.fillContent(m_info, crop, point);
} | java |
public static CmsShell getTopShell() {
ArrayList<CmsShell> shells = SHELL_STACK.get();
if (shells.isEmpty()) {
return null;
}
return shells.get(shells.size() - 1);
} | java |
public static void popShell() {
ArrayList<CmsShell> shells = SHELL_STACK.get();
if (shells.size() > 0) {
shells.remove(shells.size() - 1);
}
} | java |
public static CmsSearchConfigurationSorting create(
final String sortParam,
final List<I_CmsSearchConfigurationSortOption> options,
final I_CmsSearchConfigurationSortOption defaultOption) {
return (null != sortParam) || ((null != options) && !options.isEmpty()) || (null != defaultOption... | java |
public static CmsResourceTypeStatResultList init(CmsResourceTypeStatResultList resList) {
if (resList == null) {
return new CmsResourceTypeStatResultList();
}
resList.deleteOld();
return resList;
} | java |
protected boolean exportWithMinimalMetaData(String path) {
String checkPath = path.startsWith("/") ? path + "/" : "/" + path + "/";
for (String p : m_parameters.getResourcesToExportWithMetaData()) {
if (checkPath.startsWith(p)) {
return false;
}
}
... | java |
@Override
public void setDraggable(Element elem, String draggable) {
super.setDraggable(elem, draggable);
if ("true".equals(draggable)) {
elem.getStyle().setProperty("webkitUserDrag", "element");
} else {
elem.getStyle().clearProperty("webkitUserDrag");
}
} | java |
protected void createParentXmlElements(CmsXmlContent xmlContent, String xmlPath, Locale l) {
if (CmsXmlUtils.isDeepXpath(xmlPath)) {
String parentPath = CmsXmlUtils.removeLastXpathElement(xmlPath);
if (null == xmlContent.getValue(parentPath, l)) {
createParentXmlElements... | java |
public byte[] join(Map<Integer, byte[]> parts) {
checkArgument(parts.size() > 0, "No parts provided");
final int[] lengths = parts.values().stream().mapToInt(v -> v.length).distinct().toArray();
checkArgument(lengths.length == 1, "Varying lengths of part values");
final byte[] secret = new byte[lengths[... | java |
public static Processor<DataSinkTask> sink(DataSink dataSink, int parallelism, String description, UserConfig taskConf, ActorSystem system) {
io.gearpump.streaming.Processor<DataSinkTask> p = DataSinkProcessor.apply(dataSink, parallelism, description, taskConf, system);
return new Processor(p);
} | java |
public static Processor<DataSourceTask> source(DataSource source, int parallelism, String description, UserConfig taskConf, ActorSystem system) {
io.gearpump.streaming.Processor<DataSourceTask<Object, Object>> p =
DataSourceProcessor.apply(source, parallelism, description, taskConf, system);
return new ... | java |
@Override
public Token recoverInline(Parser recognizer) throws RecognitionException
{
// SINGLE TOKEN DELETION
Token matchedSymbol = singleTokenDeletion(recognizer);
if (matchedSymbol != null)
{
// we have deleted the extra token.
// now, move past ttype token as if all were ok
recognizer.co... | java |
protected DirectiveStatement parseDirectiveStatement(DirectiveStContext node)
{
DirectiveStContext stContext = (DirectiveStContext) node;
DirectiveExpContext direExp = stContext.directiveExp();
Token token = direExp.Identifier().getSymbol();
String directive = token.getText().toLowerCase().intern();
Te... | java |
public static NamingConvention determineNamingConvention(
TypeElement type,
Iterable<ExecutableElement> methods,
Messager messager,
Types types) {
ExecutableElement beanMethod = null;
ExecutableElement prefixlessMethod = null;
for (ExecutableElement method : methods) {
switch (... | java |
public SourceBuilder add(String fmt, Object... args) {
TemplateApplier.withParams(args).onText(source::append).onParam(this::add).parse(fmt);
return this;
} | java |
public SourceBuilder addLine(String fmt, Object... args) {
add(fmt, args);
source.append(LINE_SEPARATOR);
return this;
} | java |
private Map<StandardMethod, UnderrideLevel> findUnderriddenMethods(
Iterable<ExecutableElement> methods) {
Map<StandardMethod, ExecutableElement> standardMethods = new LinkedHashMap<>();
for (ExecutableElement method : methods) {
Optional<StandardMethod> standardMethod = maybeStandardMethod(method);... | java |
private boolean hasToBuilderMethod(
DeclaredType builder,
boolean isExtensible,
Iterable<ExecutableElement> methods) {
for (ExecutableElement method : methods) {
if (isToBuilderMethod(builder, method)) {
if (!isExtensible) {
messager.printMessage(ERROR,
"No ac... | java |
private String generatedBuilderSimpleName(TypeElement type) {
String packageName = elements.getPackageOf(type).getQualifiedName().toString();
String originalName = type.getQualifiedName().toString();
checkState(originalName.startsWith(packageName + "."));
String nameWithoutPackage = originalName.substri... | java |
public static void addToString(
SourceBuilder code,
Datatype datatype,
Map<Property, PropertyCodeGenerator> generatorsByProperty,
boolean forPartial) {
String typename = (forPartial ? "partial " : "") + datatype.getType().getSimpleName();
Predicate<PropertyCodeGenerator> isOptional = gen... | java |
private static void bodyWithConcatenation(
SourceBuilder code,
Map<Property, PropertyCodeGenerator> generatorsByProperty,
String typename) {
code.add(" return \"%s{", typename);
String prefix = "";
for (Property property : generatorsByProperty.keySet()) {
PropertyCodeGenerator gener... | java |
private static void bodyWithBuilder(
SourceBuilder code,
Datatype datatype,
Map<Property, PropertyCodeGenerator> generatorsByProperty,
String typename,
Predicate<PropertyCodeGenerator> isOptional) {
Variable result = new Variable("result");
code.add(" %1$s %2$s = new %1$s(\"%3$s{... | java |
private static void bodyWithBuilderAndSeparator(
SourceBuilder code,
Datatype datatype,
Map<Property, PropertyCodeGenerator> generatorsByProperty,
String typename) {
Variable result = new Variable("result");
Variable separator = new Variable("separator");
code.addLine(" %1$s %2$s =... | java |
public static void addLazyDefinitions(SourceBuilder code) {
Set<Declaration> defined = new HashSet<>();
// Definitions may lazily declare new names; ensure we add them all
List<Declaration> declarations =
code.scope().keysOfType(Declaration.class).stream().sorted().collect(toList());
while (!de... | java |
public void addPartialFieldAssignment(
SourceBuilder code, Excerpt finalField, String builder) {
addFinalFieldAssignment(code, finalField, builder);
} | java |
public static void addActionsTo(
SourceBuilder code,
Set<MergeAction> mergeActions,
boolean forBuilder) {
SetMultimap<String, String> nounsByVerb = TreeMultimap.create();
mergeActions.forEach(mergeAction -> {
if (forBuilder || !mergeAction.builderOnly) {
nounsByVerb.put(mergeActi... | java |
public static Variable upcastToGeneratedBuilder(
SourceBuilder code, Datatype datatype, String builder) {
return code.scope().computeIfAbsent(Declaration.UPCAST, () -> {
Variable base = new Variable("base");
code.addLine(UPCAST_COMMENT)
.addLine("%s %s = %s;", datatype.getGeneratedBuilde... | java |
public static Optional<Variable> freshBuilder(SourceBuilder code, Datatype datatype) {
if (!datatype.getBuilderFactory().isPresent()) {
return Optional.empty();
}
return Optional.of(code.scope().computeIfAbsent(Declaration.FRESH_BUILDER, () -> {
Variable defaults = new Variable("defaults");
... | java |
public JavadocLink javadocMethodLink(String memberName, Type... types) {
return new JavadocLink("%s#%s(%s)",
getQualifiedName(),
memberName,
(Excerpt) code -> {
String separator = "";
for (Type type : types) {
code.add("%s%s", separator, type.getQualifiedName(... | java |
public Excerpt typeParameters() {
if (getTypeParameters().isEmpty()) {
return Excerpts.EMPTY;
} else {
return Excerpts.add("<%s>", Excerpts.join(", ", getTypeParameters()));
}
} | java |
protected Violation createViolation(Integer lineNumber, String sourceLine, String message) {
Violation violation = new Violation();
violation.setRule(this);
violation.setSourceLine(sourceLine);
violation.setLineNumber(lineNumber);
violation.setMessage(message);
return vio... | java |
protected Violation createViolation(SourceCode sourceCode, ASTNode node, String message) {
String sourceLine = sourceCode.line(node.getLineNumber()-1);
return createViolation(node.getLineNumber(), sourceLine, message);
} | java |
protected Violation createViolationForImport(SourceCode sourceCode, ImportNode importNode, String message) {
Map importInfo = ImportUtil.sourceLineAndNumberForImport(sourceCode, importNode);
Violation violation = new Violation();
violation.setRule(this);
violation.setSourceLine((String) ... | java |
protected Violation createViolationForImport(SourceCode sourceCode, String className, String alias, String violationMessage) {
Map importInfo = ImportUtil.sourceLineAndNumberForImport(sourceCode, className, alias);
Violation violation = new Violation();
violation.setRule(this);
violation... | java |
protected boolean shouldApplyThisRuleTo(ClassNode classNode) {
// TODO Consider caching applyTo, doNotApplyTo and associated WildcardPatterns
boolean shouldApply = true;
String applyTo = getApplyToClassNames();
String doNotApplyTo = getDoNotApplyToClassNames();
if (apply... | java |
public Results analyze(RuleSet ruleSet) {
long startTime = System.currentTimeMillis();
DirectoryResults reportResults = new DirectoryResults();
int numThreads = Runtime.getRuntime().availableProcessors() - 1;
numThreads = numThreads > 0 ? numThreads : 1;
ExecutorService ... | java |
private static boolean isPredefinedConstant(Expression expression) {
if (expression instanceof PropertyExpression) {
Expression object = ((PropertyExpression) expression).getObjectExpression();
Expression property = ((PropertyExpression) expression).getProperty();
if (o... | java |
public static boolean isMapLiteralWithOnlyConstantValues(Expression expression) {
if (expression instanceof MapExpression) {
List<MapEntryExpression> entries = ((MapExpression) expression).getMapEntryExpressions();
for (MapEntryExpression entry : entries) {
if (!isCon... | java |
public static boolean isListLiteralWithOnlyConstantValues(Expression expression) {
if (expression instanceof ListExpression) {
List<Expression> expressions = ((ListExpression) expression).getExpressions();
for (Expression e : expressions) {
if (!isConstantOrConstantLi... | java |
public static boolean isConstant(Expression expression, Object expected) {
return expression instanceof ConstantExpression && expected.equals(((ConstantExpression) expression).getValue());
} | java |
public static List<? extends Expression> getMethodArguments(ASTNode methodCall) {
if (methodCall instanceof ConstructorCallExpression) {
return extractExpressions(((ConstructorCallExpression) methodCall).getArguments());
} else if (methodCall instanceof MethodCallExpression) {
... | java |
public static boolean isMethodNamed(MethodCallExpression methodCall, String methodNamePattern, Integer numArguments) {
Expression method = methodCall.getMethod();
// !important: performance enhancement
boolean IS_NAME_MATCH = false;
if (method instanceof ConstantExpression) {
... | java |
public static boolean isConstructorCall(Expression expression, List<String> classNames) {
return expression instanceof ConstructorCallExpression && classNames.contains(expression.getType().getName());
} | java |
public static boolean isConstructorCall(Expression expression, String classNamePattern) {
return expression instanceof ConstructorCallExpression && expression.getType().getName().matches(classNamePattern);
} | java |
public static AnnotationNode getAnnotation(AnnotatedNode node, String name) {
List<AnnotationNode> annotations = node.getAnnotations();
for (AnnotationNode annot : annotations) {
if (annot.getClassNode().getName().equals(name)) {
return annot;
}
}
... | java |
public static boolean hasAnnotation(AnnotatedNode node, String name) {
return AstUtil.getAnnotation(node, name) != null;
} | java |
public static boolean hasAnyAnnotation(AnnotatedNode node, String... names) {
for (String name : names) {
if (hasAnnotation(node, name)) {
return true;
}
}
return false;
} | java |
public static List<Expression> getVariableExpressions(DeclarationExpression declarationExpression) {
Expression leftExpression = declarationExpression.getLeftExpression();
// !important: performance enhancement
if (leftExpression instanceof ArrayExpression) {
List<Expression> e... | java |
public static boolean isFinalVariable(DeclarationExpression declarationExpression, SourceCode sourceCode) {
if (isFromGeneratedSourceCode(declarationExpression)) {
return false;
}
List<Expression> variableExpressions = getVariableExpressions(declarationExpression);
if (!... | java |
public static boolean isTrue(Expression expression) {
if (expression == null) {
return false;
}
if (expression instanceof PropertyExpression
&& classNodeImplementsType(((PropertyExpression) expression).getObjectExpression().getType(), Boolean.class)) {
... | java |
public static boolean isFalse(Expression expression) {
if (expression == null) {
return false;
}
if (expression instanceof PropertyExpression && classNodeImplementsType(((PropertyExpression) expression).getObjectExpression().getType(), Boolean.class)) {
if (((Propert... | java |
public static boolean respondsTo(Object object, String methodName) {
MetaClass metaClass = DefaultGroovyMethods.getMetaClass(object);
if (!metaClass.respondsTo(object, methodName).isEmpty()) {
return true;
}
Map properties = DefaultGroovyMethods.getProperties(object);
... | java |
public static boolean classNodeImplementsType(ClassNode node, Class target) {
ClassNode targetNode = ClassHelper.make(target);
if (node.implementsInterface(targetNode)) {
return true;
}
if (node.isDerivedFrom(targetNode)) {
return true;
}
i... | java |
public static boolean isClosureDeclaration(ASTNode expression) {
if (expression instanceof DeclarationExpression) {
if (((DeclarationExpression) expression).getRightExpression() instanceof ClosureExpression) {
return true;
}
}
if (expression instance... | java |
public static List<String> getParameterNames(MethodNode node) {
ArrayList<String> result = new ArrayList<String>();
if (node.getParameters() != null) {
for (Parameter parameter : node.getParameters()) {
result.add(parameter.getName());
}
}
... | java |
public static List<String> getArgumentNames(MethodCallExpression methodCall) {
ArrayList<String> result = new ArrayList<String>();
Expression arguments = methodCall.getArguments();
List<Expression> argExpressions = null;
if (arguments instanceof ArrayExpression) {
argE... | java |
public static boolean isSafe(Expression expression) {
if (expression instanceof MethodCallExpression) {
return ((MethodCallExpression) expression).isSafe();
}
if (expression instanceof PropertyExpression) {
return ((PropertyExpression) expression).isSafe();
... | java |
public static boolean isSpreadSafe(Expression expression) {
if (expression instanceof MethodCallExpression) {
return ((MethodCallExpression) expression).isSpreadSafe();
}
if (expression instanceof PropertyExpression) {
return ((PropertyExpression) expression).isSprea... | java |
public static boolean isMethodNode(ASTNode node, String methodNamePattern, Integer numArguments, Class returnType) {
if (!(node instanceof MethodNode)) {
return false;
}
if (!(((MethodNode) node).getName().matches(methodNamePattern))) {
return false;
}
... | java |
public static boolean isVariable(ASTNode expression, String pattern) {
return (expression instanceof VariableExpression && ((VariableExpression) expression).getName().matches(pattern));
} | java |
private static Class getClassForClassNode(ClassNode type) {
// todo hamlet - move to a different "InferenceUtil" object
Class primitiveType = getPrimitiveType(type);
if (primitiveType != null) {
return primitiveType;
} else if (classNodeImplementsType(type, String.class)... | java |
public static int findFirstNonAnnotationLine(ASTNode node, SourceCode sourceCode) {
if (node instanceof AnnotatedNode && !((AnnotatedNode) node).getAnnotations().isEmpty()) {
// HACK: Groovy line numbers are broken when annotations have a parameter :(
// so we must look at the lineN... | java |
protected boolean isFirstVisit(Object expression) {
if (visited.contains(expression)) {
return false;
}
visited.add(expression);
return true;
} | java |
protected String sourceLineTrimmed(ASTNode node) {
return sourceCode.line(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);
} | java |
protected String sourceLine(ASTNode node) {
return sourceCode.getLines().get(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);
} | java |
@Deprecated
public static <T> T buildJsonResponse(Response response, Class<T> clazz) throws IOException, SlackApiException {
if (response.code() == 200) {
String body = response.body().string();
DETAILED_LOGGER.accept(new HttpResponseListener.State(SlackConfig.DEFAULT, response, body... | java |
public WebhookResponse send(String url, Payload payload) throws IOException {
SlackHttpClient httpClient = getHttpClient();
Response httpResponse = httpClient.postJsonPostRequest(url, payload);
String body = httpResponse.body().string();
httpClient.runHttpResponseListeners(httpResponse, ... | java |
private void updateSession(Session newSession) {
if (this.currentSession == null) {
this.currentSession = newSession;
} else {
synchronized (this.currentSession) {
this.currentSession = newSession;
}
}
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.