code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public static NumberValue numberValue(Number numberValue, boolean isTransient) {
return new NumberValueImpl(numberValue, isTransient);
} | Creates an abstract Number value. Note that this value cannot be used to set variables.
Use the specific methods {@link Variables#integerValue(Integer)}, {@link #shortValue(Short)},
{@link #longValue(Long)} and {@link #doubleValue(Double)} instead. | numberValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static TypedValue untypedNullValue() {
return untypedNullValue(false);
} | Creates a {@link TypedValue} with value {@code null} and type {@link ValueType#NULL} | untypedNullValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static TypedValue untypedNullValue(boolean isTransient) {
if (isTransient) {
return NullValueImpl.INSTANCE_TRANSIENT;
}
else {
return NullValueImpl.INSTANCE;
}
} | Creates a {@link TypedValue} with value {@code null} and type {@link ValueType#NULL} | untypedNullValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static TypedValue untypedValue(Object value) {
Object untypedValue = value;
if (untypedValue instanceof TypedValueBuilder) {
untypedValue = ((TypedValueBuilder<?>) untypedValue).create();
}
if (untypedValue instanceof TypedValue) {
return untypedValue(untypedValue, ((TypedValue) untyp... | Creates an untyped value, i.e. {@link TypedValue#getType()} returns <code>null</code>
for the returned instance. | untypedValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static TypedValue untypedValue(Object value, boolean isTransient) {
if(value == null) {
return untypedNullValue(isTransient);
} else if (value instanceof TypedValueBuilder<?>) {
return ((TypedValueBuilder<?>) value).setTransient(isTransient).create();
} else if (value instanceof TypedValu... | Creates an untyped value, i.e. {@link TypedValue#getType()} returns <code>null</code>
for the returned instance. | untypedValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static FileValueBuilder fileValue(String filename) {
return fileValue(filename, false);
} | Returns a builder to create a new {@link FileValue} with the given
{@code filename}. | fileValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static FileValueBuilder fileValue(String filename, boolean isTransient) {
return new FileValueBuilderImpl(filename).setTransient(isTransient);
} | Returns a builder to create a new {@link FileValue} with the given
{@code filename}. | fileValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static FileValue fileValue(File file){
String contentType = MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(file);
return new FileValueBuilderImpl(file.getName()).file(file).mimeType(contentType).create();
} | Shortcut for calling {@code Variables.fileValue(name).file(file).mimeType(type).create()}.
The name is set to the file name and the mime type is detected via {@link MimetypesFileTypeMap}. | fileValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static FileValue fileValue(File file, boolean isTransient){
String contentType = MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(file);
return new FileValueBuilderImpl(file.getName()).file(file).mimeType(contentType).setTransient(isTransient).create();
} | Shortcut for calling {@code Variables.fileValue(name).file(file).mimeType(type).setTransient(isTransient).create()}.
The name is set to the file name and the mime type is detected via {@link MimetypesFileTypeMap}. | fileValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public static VariableContext emptyVariableContext() {
return EmptyVariableContext.INSTANCE;
} | @return an empty {@link VariableContext} (from which no variables can be resolved). | emptyVariableContext | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/Variables.java | Apache-2.0 |
public TypedValue resolve(String variableName) {
return null;
} | An empty variable context implementation which does
not allow to resolve any variables.
@author Daniel Meyer | resolve | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/EmptyVariableContext.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/EmptyVariableContext.java | Apache-2.0 |
public boolean containsVariable(String variableName) {
return false;
} | An empty variable context implementation which does
not allow to resolve any variables.
@author Daniel Meyer | containsVariable | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/EmptyVariableContext.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/EmptyVariableContext.java | Apache-2.0 |
public Set<String> keySet() {
return Collections.emptySet();
} | An empty variable context implementation which does
not allow to resolve any variables.
@author Daniel Meyer | keySet | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/EmptyVariableContext.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/EmptyVariableContext.java | Apache-2.0 |
public TypedValue resolve(String variableName) {
if(containsVariable(variableName)) {
return typedValue;
}
else {
return null;
}
} | An {@link VariableContext} allowing to resolve a single variable only.
@author Daniel Meyer | resolve | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | Apache-2.0 |
public boolean containsVariable(String name) {
if(this.name == null) {
return name == null;
}
else {
return this.name.equals(name);
}
} | An {@link VariableContext} allowing to resolve a single variable only.
@author Daniel Meyer | containsVariable | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | Apache-2.0 |
public Set<String> keySet() {
return Collections.singleton(name);
} | An {@link VariableContext} allowing to resolve a single variable only.
@author Daniel Meyer | keySet | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | Apache-2.0 |
public static SingleVariableContext singleVariable(String name, TypedValue value) {
return new SingleVariableContext(name, value);
} | An {@link VariableContext} allowing to resolve a single variable only.
@author Daniel Meyer | singleVariable | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/context/SingleVariableContext.java | Apache-2.0 |
public byte[] getByteArray() {
return value;
} | Get the byte array directly without wrapping it inside a stream to evade
not needed wrapping. This method is intended for the internal API, which
needs the byte array anyways. | getByteArray | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | Apache-2.0 |
@Override
public String toString() {
return "FileValueImpl [mimeType=" + mimeType + ", filename=" + filename + ", type=" + type + ", isTransient=" + isTransient + "]";
} | Get the byte array directly without wrapping it inside a stream to evade
not needed wrapping. This method is intended for the internal API, which
needs the byte array anyways. | toString | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | Apache-2.0 |
@Override
public boolean isTransient() {
return isTransient;
} | Get the byte array directly without wrapping it inside a stream to evade
not needed wrapping. This method is intended for the internal API, which
needs the byte array anyways. | isTransient | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | Apache-2.0 |
public void setTransient(boolean isTransient) {
this.isTransient = isTransient;
} | Get the byte array directly without wrapping it inside a stream to evade
not needed wrapping. This method is intended for the internal API, which
needs the byte array anyways. | setTransient | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/FileValueImpl.java | Apache-2.0 |
public Object getValue() {
return value;
} | Used when the type of an object has not been specified by the user and
needs to be autodetected.
@author Daniel Meyer | getValue | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | Apache-2.0 |
public ValueType getType() {
// no type
return null;
} | Used when the type of an object has not been specified by the user and
needs to be autodetected.
@author Daniel Meyer | getType | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | Apache-2.0 |
@Override
public String toString() {
return "Untyped value '"+value+"', isTransient = " + isTransient;
} | Used when the type of an object has not been specified by the user and
needs to be autodetected.
@author Daniel Meyer | toString | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | Apache-2.0 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((value == null) ? 0 : value.hashCode());
result = prime * result + (isTransient ? 1 : 0);
return result;
} | Used when the type of an object has not been specified by the user and
needs to be autodetected.
@author Daniel Meyer | hashCode | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | Apache-2.0 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
UntypedValueImpl other = (UntypedValueImpl) obj;
if (value == null) {
if (other.value != null)
return false;
... | Used when the type of an object has not been specified by the user and
needs to be autodetected.
@author Daniel Meyer | equals | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | Apache-2.0 |
@Override
public boolean isTransient() {
return isTransient;
} | Used when the type of an object has not been specified by the user and
needs to be autodetected.
@author Daniel Meyer | isTransient | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | Apache-2.0 |
public void setTransient(boolean isTransient) {
this.isTransient = isTransient;
} | Used when the type of an object has not been specified by the user and
needs to be autodetected.
@author Daniel Meyer | setTransient | java | camunda/camunda-bpm-platform | commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/typed-values/src/main/java/org/camunda/bpm/engine/variable/impl/value/UntypedValueImpl.java | Apache-2.0 |
public static void ensureNotNull(String parameterName, Object value) {
if(value == null) {
throw LOG.parameterIsNullException(parameterName);
}
} | Ensures that the parameter is not null.
@param parameterName the parameter name
@param value the value to ensure to be not null
@throws IllegalArgumentException if the parameter value is null | ensureNotNull | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/EnsureUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/EnsureUtil.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public static <T> T ensureParamInstanceOf(String objectName, Object object, Class<T> type) {
if(type.isAssignableFrom(object.getClass())) {
return (T) object;
} else {
throw LOG.unsupportedParameterType(objectName, object, type);
}
} | Ensure the object is of a given type and return the casted object
@param objectName the name of the parameter
@param object the parameter value
@param type the expected type
@return the parameter casted to the requested type
@throws IllegalArgumentException in case object cannot be casted to type | ensureParamInstanceOf | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/EnsureUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/EnsureUtil.java | Apache-2.0 |
public static String inputStreamAsString(InputStream inputStream) {
return new String(inputStreamAsByteArray(inputStream), ENCODING_CHARSET);
} | Returns the input stream as String.
@param inputStream the input stream
@return the input stream as String. | inputStreamAsString | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static byte[] inputStreamAsByteArray(InputStream inputStream) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
byte[] buffer = new byte[16 * 1024];
int read;
while((read = inputStream.read(buffer)) > 0) {
os.write(buffer, 0, read);
}
return os.toByteAr... | Returns the input stream as byte[].
@param inputStream the input stream
@return the input stream as byte[]. | inputStreamAsByteArray | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static String readerAsString(Reader reader) {
StringBuilder buffer = new StringBuilder();
char[] chars = new char[16 * 1024];
int numCharsRead;
try {
while ((numCharsRead = reader.read(chars, 0, chars.length)) != -1) {
buffer.append(chars, 0, numCharsRead);
}
return buff... | Returns the Reader content as String.
@param reader the Reader
@return the Reader content as String | readerAsString | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static InputStream stringAsInputStream(String string) {
return new ByteArrayInputStream(string.getBytes(ENCODING_CHARSET));
} | Returns the String as InputStream.
@param string the String to convert
@return the InputStream containing the String | stringAsInputStream | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static void closeSilently(Closeable closeable) {
try {
if (closeable != null) {
closeable.close();
}
} catch (IOException e) {
// ignore
}
} | Close a closable ignoring any IO exception.
@param closeable the closable to close | closeSilently | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static String fileAsString(String filename) {
File classpathFile = getClasspathFile(filename);
return fileAsString(classpathFile);
} | Returns the content of a file with specified filename
@param filename name of the file to load
@return Content of the file as String | fileAsString | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static String fileAsString(File file) {
try {
return inputStreamAsString(new FileInputStream(file));
} catch(FileNotFoundException e) {
throw LOG.fileNotFoundException(file.getAbsolutePath(), e);
}
} | Returns the content of a File.
@param file the file to load
@return Content of the file as String | fileAsString | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static byte[] fileAsByteArray(File file) {
try {
return inputStreamAsByteArray(new FileInputStream(file));
} catch(FileNotFoundException e) {
throw LOG.fileNotFoundException(file.getAbsolutePath(), e);
}
} | Returns the content of a File.
@param file the file to load
@return Content of the file as String | fileAsByteArray | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static InputStream fileAsStream(String filename) {
File classpathFile = getClasspathFile(filename);
return fileAsStream(classpathFile);
} | Returns the input stream of a file with specified filename
@param filename the name of a File to load
@return the file content as input stream
@throws IoUtilException if the file cannot be loaded | fileAsStream | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static InputStream fileAsStream(File file) {
try {
return new BufferedInputStream(new FileInputStream(file));
} catch(FileNotFoundException e) {
throw LOG.fileNotFoundException(file.getAbsolutePath(), e);
}
} | Returns the input stream of a file.
@param file the File to load
@return the file content as input stream
@throws IoUtilException if the file cannot be loaded | fileAsStream | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static File getClasspathFile(String filename) {
if(filename == null) {
throw LOG.nullParameter("filename");
}
return getClasspathFile(filename, null);
} | Returns the File for a filename.
@param filename the filename to load
@return the file object | getClasspathFile | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static File getClasspathFile(String filename, ClassLoader classLoader) {
if(filename == null) {
throw LOG.nullParameter("filename");
}
URL fileUrl = null;
if (classLoader != null) {
fileUrl = classLoader.getResource(filename);
}
if (fileUrl == null) {
// Try the curren... | Returns the File for a filename.
@param filename the filename to load
@param classLoader the classLoader to load file with, if null falls back to TCCL and then this class's classloader
@return the file object
@throws IoUtilException if the file cannot be loaded | getClasspathFile | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/IoUtil.java | Apache-2.0 |
public static boolean isExpression(String text) {
if (text == null) {
return false;
}
text = text.trim();
return text.startsWith("${") || text.startsWith("#{");
} | Checks whether a String seams to be an expression or not
@param text the text to check
@return true if the text seams to be an expression false otherwise | isExpression | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | Apache-2.0 |
public static String[] split(String text, String regex) {
if (text == null) {
return null;
}
else if (regex == null) {
return new String[] { text };
}
else {
String[] result = text.split(regex);
for (int i = 0; i < result.length; i++) {
result[i] = result[i].trim();
... | Splits a String by an expression.
@param text the text to split
@param regex the regex to split by
@return the parts of the text or null if text was null | split | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | Apache-2.0 |
public static String defaultString(String text) {
return text == null ? "" : text;
} | Returns either the passed in String, or if the String is <code>null</code>, an empty String ("").
<pre>
StringUtils.defaultString(null) = ""
StringUtils.defaultString("") = ""
StringUtils.defaultString("bat") = "bat"
</pre>
@param text the String to check, may be null
@return the passed in String, or the empty S... | defaultString | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | Apache-2.0 |
public static String getStackTrace(Throwable throwable) {
StringWriter sw = new StringWriter();
throwable.printStackTrace(new PrintWriter(sw, true));
return sw.toString();
} | Fetches the stack trace of an exception as a String.
@param throwable to get the stack trace from
@return the stack trace as String | getStackTrace | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/StringUtil.java | Apache-2.0 |
@Override
public V get(K key) {
V value = cache.get(key);
if (value != null) {
keys.remove(key);
keys.add(key);
}
return value;
} | Creates the cache with a fixed capacity.
@param capacity max number of cache entries
@throws IllegalArgumentException if capacity is negative | get | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
@Override
public void put(K key, V value) {
if (key == null || value == null) {
throw new NullPointerException();
}
V previousValue = cache.put(key, value);
if (previousValue != null) {
keys.remove(key);
}
keys.add(key);
if (cache.size() > capacity) {
K lruKey = keys.po... | Creates the cache with a fixed capacity.
@param capacity max number of cache entries
@throws IllegalArgumentException if capacity is negative | put | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
@Override
public void remove(K key) {
this.cache.remove(key);
keys.remove(key);
} | Creates the cache with a fixed capacity.
@param capacity max number of cache entries
@throws IllegalArgumentException if capacity is negative | remove | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
@Override
public void clear() {
cache.clear();
keys.clear();
} | Creates the cache with a fixed capacity.
@param capacity max number of cache entries
@throws IllegalArgumentException if capacity is negative | clear | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
@Override
public boolean isEmpty() {
return cache.isEmpty();
} | Creates the cache with a fixed capacity.
@param capacity max number of cache entries
@throws IllegalArgumentException if capacity is negative | isEmpty | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
@Override
public Set<K> keySet() {
return cache.keySet();
} | Creates the cache with a fixed capacity.
@param capacity max number of cache entries
@throws IllegalArgumentException if capacity is negative | keySet | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
@Override
public int size() {
return cache.size();
} | Creates the cache with a fixed capacity.
@param capacity max number of cache entries
@throws IllegalArgumentException if capacity is negative | size | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
protected void removeAll(K key) {
while (keys.remove(key)) {
}
} | Removes all instances of the given key within the keys queue. | removeAll | java | camunda/camunda-bpm-platform | commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | https://github.com/camunda/camunda-bpm-platform/blob/master/commons/utils/src/main/java/org/camunda/commons/utils/cache/ConcurrentLruCache.java | Apache-2.0 |
public static Connectors getInstance() {
return INSTANCE;
} | Provides the global instance of the Connectors manager.
@return the global instance | getInstance | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public static <C extends Connector<? extends ConnectorRequest<?>>> C http() {
return (C) INSTANCE.getConnectorById(HTTP_CONNECTOR_ID);
} | @return the connector for the default http connector id or null if
no connector is registered for this id | http | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public static <C extends Connector<? extends ConnectorRequest<?>>> C soap() {
return (C) INSTANCE.getConnectorById(SOAP_HTTP_CONNECTOR_ID);
} | @return the connector for the default soap http connector id or null
if no connector is registered for this id | soap | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public static <C extends Connector<? extends ConnectorRequest<?>>> C getConnector(String connectorId) {
return (C) INSTANCE.getConnectorById(connectorId);
} | @return the connector for the given id or null if no connector is
registered for this id | getConnector | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected static void registerConnector(String connectorId, Connector<?> connector) {
INSTANCE.registerConnectorInstance(connectorId, connector);
} | Register a new connector under the given connector id. | registerConnector | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public <C extends Connector<? extends ConnectorRequest<?>>> C getConnectorById(String connectorId) {
ensureConnectorProvidersInitialized();
return (C) availableConnectors.get(connectorId);
} | @return the connector for the given id or null if no connector is
registered for this id | getConnectorById | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected void ensureConnectorProvidersInitialized() {
if (availableConnectors == null) {
synchronized (Connectors.class) {
if (availableConnectors == null) {
initializeConnectors(null);
}
}
}
} | Detect all available connectors in the classpath using a {@link ServiceLoader}. | ensureConnectorProvidersInitialized | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected void initializeConnectors(ClassLoader classLoader) {
Map<String, Connector<?>> connectors = new HashMap<String, Connector<?>>();
if(classLoader == null) {
classLoader = Connectors.class.getClassLoader();
}
// discover available custom connector providers on the classpath
registerCo... | Detect all available connectors in the classpath using a {@link ServiceLoader}. | initializeConnectors | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected void registerConnectors(Map<String, Connector<?>> connectors, ClassLoader classLoader) {
ServiceLoader<ConnectorProvider> providers = ServiceLoader.load(ConnectorProvider.class, classLoader);
for (ConnectorProvider provider : providers) {
registerProvider(connectors, provider);
}
} | Detect all available connectors in the classpath using a {@link ServiceLoader}. | registerConnectors | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected void registerProvider(Map<String, Connector<?>> connectors, ConnectorProvider provider) {
String connectorId = provider.getConnectorId();
if (connectors.containsKey(connectorId)) {
throw LOG.multipleConnectorProvidersFound(connectorId);
}
else {
Connector<?> connectorInstance = pr... | Detect all available connectors in the classpath using a {@link ServiceLoader}. | registerProvider | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected void registerConnectorInstance(String connectorId, Connector<?> connector) {
ensureConnectorProvidersInitialized();
synchronized (Connectors.class) {
availableConnectors.put(connectorId, connector);
}
} | Detect all available connectors in the classpath using a {@link ServiceLoader}. | registerConnectorInstance | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected void unregisterConnectorInstance(String connectorId) {
ensureConnectorProvidersInitialized();
synchronized (Connectors.class) {
availableConnectors.remove(connectorId);
}
} | Detect all available connectors in the classpath using a {@link ServiceLoader}. | unregisterConnectorInstance | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
@SuppressWarnings("rawtypes")
protected void applyConfigurators(Map<String, Connector<?>> connectors, ClassLoader classLoader) {
ServiceLoader<ConnectorConfigurator> configurators = ServiceLoader.load(ConnectorConfigurator.class, classLoader);
for (ConnectorConfigurator configurator : configurators) {
... | Detect all available connectors in the classpath using a {@link ServiceLoader}. | applyConfigurators | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void applyConfigurator(Map<String, Connector<?>> connectors, ConnectorConfigurator configurator) {
for (Connector<?> connector : connectors.values()) {
if (configurator.getConnectorClass().isAssignableFrom(connector.getClass())) {
configurator... | Detect all available connectors in the classpath using a {@link ServiceLoader}. | applyConfigurator | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/Connectors.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/Connectors.java | Apache-2.0 |
protected boolean isRequestValid() {
return true;
} | Allows subclasses to provide custom validation logic of the
request parameters.
@return true if the request parameters are valid. | isRequestValid | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | Apache-2.0 |
public void setRequestParameters(Map<String, Object> params) {
for (Entry<String, Object> param : params.entrySet()) {
setRequestParameter(param.getKey(), param.getValue());
}
} | Allows subclasses to provide custom validation logic of the
request parameters.
@return true if the request parameters are valid. | setRequestParameters | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | Apache-2.0 |
public void setRequestParameter(String name, Object value) {
requestParameters.put(name, value);
} | Sets a request parameter on the request
@param name the name of the parameter
@param value the value of the parameter | setRequestParameter | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | Apache-2.0 |
public Map<String, Object> getRequestParameters() {
return requestParameters;
} | @return the parameters as handed in to the request. | getRequestParameters | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public <V> V getRequestParameter(String name) {
return (V) requestParameters.get(name);
} | @return the parameters as handed in to the request. | getRequestParameter | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractConnectorRequest.java | Apache-2.0 |
public T getTarget() {
return target;
} | A simple invocation implementation routing a request through a chain of interceptors.
Implementations must implement the {@link #invokeTarget()} method in order to implement
the actual request execution / target invocation.
@author Daniel Meyer | getTarget | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractRequestInvocation.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractRequestInvocation.java | Apache-2.0 |
public ConnectorRequest<?> getRequest() {
return request;
} | A simple invocation implementation routing a request through a chain of interceptors.
Implementations must implement the {@link #invokeTarget()} method in order to implement
the actual request execution / target invocation.
@author Daniel Meyer | getRequest | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractRequestInvocation.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractRequestInvocation.java | Apache-2.0 |
public Object proceed() throws Exception {
currentIndex++;
if(interceptorChain.size() > currentIndex) {
return interceptorChain.get(currentIndex).handleInvocation(this);
} else {
return invokeTarget();
}
} | A simple invocation implementation routing a request through a chain of interceptors.
Implementations must implement the {@link #invokeTarget()} method in order to implement
the actual request execution / target invocation.
@author Daniel Meyer | proceed | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/AbstractRequestInvocation.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/AbstractRequestInvocation.java | Apache-2.0 |
public Object handleInvocation(ConnectorInvocation invocation) throws Exception {
request = invocation.getRequest();
target = invocation.getTarget();
if (proceed) {
return invocation.proceed();
}
else {
return response;
}
} | <p>
A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
and the raw request ({@link #getTarget()}) for debugging purpose.
</p>
<p>
The boolean constructor flag determines whether the request invocation should be continued
or aborted after this interceptor. Also it is possi... | handleInvocation | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | Apache-2.0 |
public void setProceed(boolean proceed) {
this.proceed = proceed;
} | <p>
A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
and the raw request ({@link #getTarget()}) for debugging purpose.
</p>
<p>
The boolean constructor flag determines whether the request invocation should be continued
or aborted after this interceptor. Also it is possi... | setProceed | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | Apache-2.0 |
public boolean isProceed() {
return proceed;
} | <p>
A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
and the raw request ({@link #getTarget()}) for debugging purpose.
</p>
<p>
The boolean constructor flag determines whether the request invocation should be continued
or aborted after this interceptor. Also it is possi... | isProceed | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | Apache-2.0 |
public void setResponse(Object response) {
this.response = response;
} | <p>
A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
and the raw request ({@link #getTarget()}) for debugging purpose.
</p>
<p>
The boolean constructor flag determines whether the request invocation should be continued
or aborted after this interceptor. Also it is possi... | setResponse | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public <T> T getResponse() {
return (T) response;
} | <p>
A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
and the raw request ({@link #getTarget()}) for debugging purpose.
</p>
<p>
The boolean constructor flag determines whether the request invocation should be continued
or aborted after this interceptor. Also it is possi... | getResponse | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public <T extends ConnectorRequest<?>> T getRequest() {
return (T) request;
} | <p>
A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
and the raw request ({@link #getTarget()}) for debugging purpose.
</p>
<p>
The boolean constructor flag determines whether the request invocation should be continued
or aborted after this interceptor. Also it is possi... | getRequest | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public <T> T getTarget() {
return (T) target;
} | <p>
A dummy debug connector, which saves the {@link ConnectorRequest} ({@link #getRequest()})
and the raw request ({@link #getTarget()}) for debugging purpose.
</p>
<p>
The boolean constructor flag determines whether the request invocation should be continued
or aborted after this interceptor. Also it is possi... | getTarget | java | camunda/camunda-bpm-platform | connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | https://github.com/camunda/camunda-bpm-platform/blob/master/connect/core/src/main/java/org/camunda/connect/impl/DebugRequestInterceptor.java | Apache-2.0 |
@Test
public void shouldRespondWithAccessControlHeaders() {
// given
// preflight request
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.HOST, "localhost");
headers.add(HttpHeaders.ORIGIN, origin);
headers.add(HttpHeaders.ACCESS_CON... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}. (e.g.
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldRespondWithAccessControlHeaders | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAccessControlHeadersTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAccessControlHeadersTest.java | Apache-2.0 |
@Before
public void init() {
authTestRestTemplate = testRestTemplate.withBasicAuth("demo", "demo");
} | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | init | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | Apache-2.0 |
@After
public void tearDown() {
processEngine.getIdentityService().deleteGroup("groupId");
} | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | tearDown | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | Apache-2.0 |
@Test
public void shouldPassAuthenticatedSimpleCorsRequest() {
// given
// cross origin but allowed through wildcard
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
// when
ResponseEntity<List> response = authTestRe... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldPassAuthenticatedSimpleCorsRequest | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | Apache-2.0 |
@Test
public void shouldPassAuthenticatedCorsRequest() {
// given
// cross origin but allowed through wildcard
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
Group group = new GroupEntity("groupId");
// create... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldPassAuthenticatedCorsRequest | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | Apache-2.0 |
@Test
public void shouldNotPassNonAuthenticatedCorsRequest() {
// given
// cross origin but allowed through wildcard
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
// when
ResponseEntity<List> response = testRestTe... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldNotPassNonAuthenticatedCorsRequest | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | Apache-2.0 |
@Test
public void shouldPassNonAuthenticatedPreflightRequest() {
// given
// cross origin but allowed through wildcard
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.HOST, "localhost");
headers.add(HttpHeaders.ORIGIN, origin);
heade... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldPassNonAuthenticatedPreflightRequest | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsAuthenticationTest.java | Apache-2.0 |
@Test
public void shouldRespondWithSupportedCredentials() {
// given
String origin = "http://other.origin:8081";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
headers.add(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, HttpMethod.GET.name());
// when
Respon... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldRespondWithSupportedCredentials | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigAllowCredentialsTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigAllowCredentialsTest.java | Apache-2.0 |
@Test
public void shouldContainPreflightWithAllowedHeaders() {
// given
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
headers.add(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, HttpMethod.GET.name());
// when
Response... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldContainPreflightWithAllowedHeaders | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigAllowedHeadersTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigAllowedHeadersTest.java | Apache-2.0 |
@Test
public void shouldPassSameOriginRequest() {
// given
// same origin
String origin = "http://localhost:" + localPort;
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
// when
ResponseEntity<List> response = testRestTemplate.exchange(CONTEXT_PATH + "/... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldPassSameOriginRequest | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationDisabledTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationDisabledTest.java | Apache-2.0 |
@Test
/* TestRestTemplate does not follow same origin policy. With CORS disabled a cross-origin request
* should not be allowed by the calling client (i.e. browser or TestRestTemplate). Testing this
* manually in a browser should work.*/
@Ignore
public void shouldFailCrossOriginRequest() {
// given
... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldFailCrossOriginRequest | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationDisabledTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationDisabledTest.java | Apache-2.0 |
@Test
public void shouldFailCrossOriginRequestFromNotAllowedOrigin() {
// given
// cross origin and not allowed
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add("Origin", origin);
// when
ResponseEntity<List> response = testRestTemplate.exchange... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldFailCrossOriginRequestFromNotAllowedOrigin | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationEnabledAllowedOriginConfiguredTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationEnabledAllowedOriginConfiguredTest.java | Apache-2.0 |
@Test
public void shouldPassCrossOriginRequestFromAllowedOrigin() {
// given
// cross origin but allowed
String origin = "http://other.origin:8081";
HttpHeaders headers = new HttpHeaders();
headers.add("Origin", origin);
// when
ResponseEntity<List> response = testRestTemplate.exchange(C... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldPassCrossOriginRequestFromAllowedOrigin | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationEnabledAllowedOriginConfiguredTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationEnabledAllowedOriginConfiguredTest.java | Apache-2.0 |
@Test
public void shouldPassCrossOriginRequest() {
// given
// cross origin but allowed through wildcard
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add("Origin", origin);
// when
ResponseEntity<List> response = testRestTemplate.exchange(CONTEX... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldPassCrossOriginRequest | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationEnabledWildcardTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationEnabledWildcardTest.java | Apache-2.0 |
@Test
public void shouldProvideResponseWithExposedHeaders() {
// given
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
headers.add(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, HttpMethod.GET.name());
// when
ResponseE... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldProvideResponseWithExposedHeaders | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationExposedHeadersTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationExposedHeadersTest.java | Apache-2.0 |
@Test
public void shouldUseACustomPreflightAge() {
// given
String origin = "http://other.origin";
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.ORIGIN, origin);
headers.add(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, HttpMethod.GET.name());
// when
ResponseEntity<List>... | Note: To run this test via an IDE you must set the system property
{@code sun.net.http.allowRestrictedHeaders} to {@code true}.
(e.g. System.setProperty("sun.net.http.allowRestrictedHeaders", "true");)
@see https://jira.camunda.com/browse/CAM-11290 | shouldUseACustomPreflightAge | java | camunda/camunda-bpm-platform | distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationPreflightMaxAgeTest.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/core/src/test/java/org/camunda/bpm/run/test/config/cors/CorsConfigurationPreflightMaxAgeTest.java | Apache-2.0 |
@Parameters(name = "Test instance: {index}. Rest: {1}, Webapps: {2}, Example: {3}")
public static Collection<Object[]> commands() {
return Arrays.asList(new Object[][] {
{ new String[0], true, true, true },
{ new String[]{"--rest"}, true, false, false },
{ new String[]{"--rest", "--webapps"}, tr... | Test cases for ensuring connectivity to REST API based on startup parameters | commands | java | camunda/camunda-bpm-platform | distro/run/qa/integration-tests/src/test/java/org/camunda/bpm/run/qa/ComponentAvailabilityIT.java | https://github.com/camunda/camunda-bpm-platform/blob/master/distro/run/qa/integration-tests/src/test/java/org/camunda/bpm/run/qa/ComponentAvailabilityIT.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.