id
int32
0
165k
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
104,400
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java
MLStructure.getKeySetToByteArray
public byte[] getKeySetToByteArray() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); char[] buffer = new char[getMaxFieldLenth()]; try { for ( String s : keys ) { ...
java
public byte[] getKeySetToByteArray() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); char[] buffer = new char[getMaxFieldLenth()]; try { for ( String s : keys ) { ...
[ "public", "byte", "[", "]", "getKeySetToByteArray", "(", ")", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "DataOutputStream", "dos", "=", "new", "DataOutputStream", "(", "baos", ")", ";", "char", "[", "]", "buffer"...
Dumps field names to byte array. Field names are written as Zero End Strings @return
[ "Dumps", "field", "names", "to", "byte", "array", ".", "Field", "names", "are", "written", "as", "Zero", "End", "Strings" ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L114-L137
104,401
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java
MLStructure.getAllFields
public Collection<MLArray> getAllFields() { ArrayList<MLArray> fields = new ArrayList<MLArray>(); for ( Map<String, MLArray> struct : mlStructArray ) { fields.addAll( struct.values() ); } return fields; }
java
public Collection<MLArray> getAllFields() { ArrayList<MLArray> fields = new ArrayList<MLArray>(); for ( Map<String, MLArray> struct : mlStructArray ) { fields.addAll( struct.values() ); } return fields; }
[ "public", "Collection", "<", "MLArray", ">", "getAllFields", "(", ")", "{", "ArrayList", "<", "MLArray", ">", "fields", "=", "new", "ArrayList", "<", "MLArray", ">", "(", ")", ";", "for", "(", "Map", "<", "String", ",", "MLArray", ">", "struct", ":", ...
Gets all field from sruct array as flat list of fields. @return
[ "Gets", "all", "field", "from", "sruct", "array", "as", "flat", "list", "of", "fields", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L143-L152
104,402
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java
MLStructure.getField
public MLArray getField(String name, int index) { if (mlStructArray.isEmpty()) { return null; } return mlStructArray.get(index).get(name); }
java
public MLArray getField(String name, int index) { if (mlStructArray.isEmpty()) { return null; } return mlStructArray.get(index).get(name); }
[ "public", "MLArray", "getField", "(", "String", "name", ",", "int", "index", ")", "{", "if", "(", "mlStructArray", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "return", "mlStructArray", ".", "get", "(", "index", ")", ".", "get", "...
Gets a value of the field described by name from index'th struct in struct array or null if the field doesn't exist. @param name @param index @return value of the field or null if the field doesn't exist
[ "Gets", "a", "value", "of", "the", "field", "described", "by", "name", "from", "index", "th", "struct", "in", "struct", "array", "or", "null", "if", "the", "field", "doesn", "t", "exist", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L198-L204
104,403
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java
MatFileReader.read
public synchronized Map<String, MLArray> read(InputStream stream, MatFileFilter filter) throws IOException { this.filter = filter; data.clear(); ByteBuffer buf = null; final ByteArrayOutputStream2 baos = new ByteArrayOutputStream2(); copy(stream, baos); buf = ByteB...
java
public synchronized Map<String, MLArray> read(InputStream stream, MatFileFilter filter) throws IOException { this.filter = filter; data.clear(); ByteBuffer buf = null; final ByteArrayOutputStream2 baos = new ByteArrayOutputStream2(); copy(stream, baos); buf = ByteB...
[ "public", "synchronized", "Map", "<", "String", ",", "MLArray", ">", "read", "(", "InputStream", "stream", ",", "MatFileFilter", "filter", ")", "throws", "IOException", "{", "this", ".", "filter", "=", "filter", ";", "data", ".", "clear", "(", ")", ";", ...
Read a mat file from a stream. Internally this will read the stream fully into memory before parsing it. @param stream a valid MAT-file stream to be read @param filter the array filter applied during reading @return the same as <code>{@link #getContent()}</code> @see MatFileFilter @throws IOException if error occurs ...
[ "Read", "a", "mat", "file", "from", "a", "stream", ".", "Internally", "this", "will", "read", "the", "stream", "fully", "into", "memory", "before", "parsing", "it", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java#L646-L662
104,404
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java
MatFileReader.readFlags
private int[] readFlags(ByteBuffer buf) throws IOException { ISMatTag tag = new ISMatTag(buf); int[] flags = tag.readToIntArray(); return flags; }
java
private int[] readFlags(ByteBuffer buf) throws IOException { ISMatTag tag = new ISMatTag(buf); int[] flags = tag.readToIntArray(); return flags; }
[ "private", "int", "[", "]", "readFlags", "(", "ByteBuffer", "buf", ")", "throws", "IOException", "{", "ISMatTag", "tag", "=", "new", "ISMatTag", "(", "buf", ")", ";", "int", "[", "]", "flags", "=", "tag", ".", "readToIntArray", "(", ")", ";", "return",...
Reads Matrix flags. Modifies <code>buf</code> position. @param buf <code>ByteBuffer</code> @return flags int array @throws IOException if reading from buffer fails
[ "Reads", "Matrix", "flags", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java#L1319-L1326
104,405
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java
MatFileReader.readDimension
private int[] readDimension(ByteBuffer buf ) throws IOException { ISMatTag tag = new ISMatTag(buf); int[] dims = tag.readToIntArray(); return dims; }
java
private int[] readDimension(ByteBuffer buf ) throws IOException { ISMatTag tag = new ISMatTag(buf); int[] dims = tag.readToIntArray(); return dims; }
[ "private", "int", "[", "]", "readDimension", "(", "ByteBuffer", "buf", ")", "throws", "IOException", "{", "ISMatTag", "tag", "=", "new", "ISMatTag", "(", "buf", ")", ";", "int", "[", "]", "dims", "=", "tag", ".", "readToIntArray", "(", ")", ";", "retur...
Reads Matrix dimensions. Modifies <code>buf</code> position. @param buf <code>ByteBuffer</code> @return dimensions int array @throws IOException if reading from buffer fails
[ "Reads", "Matrix", "dimensions", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java#L1336-L1343
104,406
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java
MatFileReader.readName
private String readName(ByteBuffer buf) throws IOException { ISMatTag tag = new ISMatTag(buf); return tag.readToString(); }
java
private String readName(ByteBuffer buf) throws IOException { ISMatTag tag = new ISMatTag(buf); return tag.readToString(); }
[ "private", "String", "readName", "(", "ByteBuffer", "buf", ")", "throws", "IOException", "{", "ISMatTag", "tag", "=", "new", "ISMatTag", "(", "buf", ")", ";", "return", "tag", ".", "readToString", "(", ")", ";", "}" ]
Reads Matrix name. Modifies <code>buf</code> position. @param buf <code>ByteBuffer</code> @return name <code>String</code> @throws IOException if reading from buffer fails
[ "Reads", "Matrix", "name", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java#L1353-L1358
104,407
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java
MatFileReader.readHeader
private void readHeader(ByteBuffer buf) throws IOException { //header values String description; int version; byte[] endianIndicator = new byte[2]; // This part of the header is missing if the file isn't a regular mat file. So ignore. if (matType == MatFileType.Regu...
java
private void readHeader(ByteBuffer buf) throws IOException { //header values String description; int version; byte[] endianIndicator = new byte[2]; // This part of the header is missing if the file isn't a regular mat file. So ignore. if (matType == MatFileType.Regu...
[ "private", "void", "readHeader", "(", "ByteBuffer", "buf", ")", "throws", "IOException", "{", "//header values", "String", "description", ";", "int", "version", ";", "byte", "[", "]", "endianIndicator", "=", "new", "byte", "[", "2", "]", ";", "// This part of ...
Reads MAT-file header. Modifies <code>buf</code> position. @param buf <code>ByteBuffer</code> @throws IOException if reading from buffer fails or if this is not a valid MAT-file
[ "Reads", "MAT", "-", "file", "header", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java#L1370-L1422
104,408
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/common/MatDataTypes.java
MatDataTypes.sizeOf
public static int sizeOf(int type) { switch ( type ) { case MatDataTypes.miINT8: return miSIZE_INT8; case MatDataTypes.miUINT8: return miSIZE_UINT8; case MatDataTypes.miINT16: return miSIZE_INT16; case Ma...
java
public static int sizeOf(int type) { switch ( type ) { case MatDataTypes.miINT8: return miSIZE_INT8; case MatDataTypes.miUINT8: return miSIZE_UINT8; case MatDataTypes.miINT16: return miSIZE_INT16; case Ma...
[ "public", "static", "int", "sizeOf", "(", "int", "type", ")", "{", "switch", "(", "type", ")", "{", "case", "MatDataTypes", ".", "miINT8", ":", "return", "miSIZE_INT8", ";", "case", "MatDataTypes", ".", "miUINT8", ":", "return", "miSIZE_UINT8", ";", "case"...
Return number of bytes for given type. @param type - <code>MatDataTypes</code> @return
[ "Return", "number", "of", "bytes", "for", "given", "type", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/common/MatDataTypes.java#L45-L70
104,409
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/common/MatDataTypes.java
MatDataTypes.typeToString
public static String typeToString(int type) { String s; switch (type) { case MatDataTypes.miUNKNOWN: s = "unknown"; break; case MatDataTypes.miINT8: s = "int8"; break; case MatDataTypes.miUINT...
java
public static String typeToString(int type) { String s; switch (type) { case MatDataTypes.miUNKNOWN: s = "unknown"; break; case MatDataTypes.miINT8: s = "int8"; break; case MatDataTypes.miUINT...
[ "public", "static", "String", "typeToString", "(", "int", "type", ")", "{", "String", "s", ";", "switch", "(", "type", ")", "{", "case", "MatDataTypes", ".", "miUNKNOWN", ":", "s", "=", "\"unknown\"", ";", "break", ";", "case", "MatDataTypes", ".", "miIN...
Get String representation of a data type @param type - data type @return - String representation
[ "Get", "String", "representation", "of", "a", "data", "type" ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/common/MatDataTypes.java#L77-L134
104,410
diffplug/JMatIO
src/main/java/ca/mjdsystems/jmatio/types/MLDouble.java
MLDouble.getArray
public double[][] getArray() { double[][] result = new double[getM()][]; for ( int m = 0; m < getM(); m++ ) { result[m] = new double[ getN() ]; for ( int n = 0; n < getN(); n++ ) { result[m][n] = getReal(m,n); ...
java
public double[][] getArray() { double[][] result = new double[getM()][]; for ( int m = 0; m < getM(); m++ ) { result[m] = new double[ getN() ]; for ( int n = 0; n < getN(); n++ ) { result[m][n] = getReal(m,n); ...
[ "public", "double", "[", "]", "[", "]", "getArray", "(", ")", "{", "double", "[", "]", "[", "]", "result", "=", "new", "double", "[", "getM", "(", ")", "]", "[", "", "]", ";", "for", "(", "int", "m", "=", "0", ";", "m", "<", "getM", "(", ...
Gets two-dimensional real array. @return - 2D real array
[ "Gets", "two", "-", "dimensional", "real", "array", "." ]
dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6
https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLDouble.java#L85-L99
104,411
hellojavaer/ddal
ddal-spring/src/main/java/org/hellojavaer/ddal/spring/scan/MethodBasedSpelExpression.java
MethodBasedSpelExpression.getParameterNames
private String[] getParameterNames(Method method) { if (notSupportParameterNameDiscoverer) { return null; } else { try { ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();// only support // from spring4 ...
java
private String[] getParameterNames(Method method) { if (notSupportParameterNameDiscoverer) { return null; } else { try { ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();// only support // from spring4 ...
[ "private", "String", "[", "]", "getParameterNames", "(", "Method", "method", ")", "{", "if", "(", "notSupportParameterNameDiscoverer", ")", "{", "return", "null", ";", "}", "else", "{", "try", "{", "ParameterNameDiscoverer", "parameterNameDiscoverer", "=", "new", ...
DefaultParameterNameDiscoverer is supported spring 4.0 @return
[ "DefaultParameterNameDiscoverer", "is", "supported", "spring", "4", ".", "0" ]
876dc32ece8bb983df64e94bdcc9045f0ee5cc3b
https://github.com/hellojavaer/ddal/blob/876dc32ece8bb983df64e94bdcc9045f0ee5cc3b/ddal-spring/src/main/java/org/hellojavaer/ddal/spring/scan/MethodBasedSpelExpression.java#L70-L87
104,412
hellojavaer/ddal
ddal-ddr/src/main/java/org/hellojavaer/ddal/ddr/shard/rule/SpelShardRouteRule.java
SpelShardRouteRule.buildEvaluationContext
private static EvaluationContext buildEvaluationContext(final String expression) { return new DDRSpelEvaluationContext() { @Override public Object lookupVariable(String name) { Object val = null; if (isReservedWords(name)) { val = supe...
java
private static EvaluationContext buildEvaluationContext(final String expression) { return new DDRSpelEvaluationContext() { @Override public Object lookupVariable(String name) { Object val = null; if (isReservedWords(name)) { val = supe...
[ "private", "static", "EvaluationContext", "buildEvaluationContext", "(", "final", "String", "expression", ")", "{", "return", "new", "DDRSpelEvaluationContext", "(", ")", "{", "@", "Override", "public", "Object", "lookupVariable", "(", "String", "name", ")", "{", ...
load order 1.reserved words 2.function 3.user-define var
[ "load", "order", "1", ".", "reserved", "words", "2", ".", "function", "3", ".", "user", "-", "define", "var" ]
876dc32ece8bb983df64e94bdcc9045f0ee5cc3b
https://github.com/hellojavaer/ddal/blob/876dc32ece8bb983df64e94bdcc9045f0ee5cc3b/ddal-ddr/src/main/java/org/hellojavaer/ddal/ddr/shard/rule/SpelShardRouteRule.java#L255-L274
104,413
hellojavaer/ddal
ddal-example/ddal-example-example0/src/main/java/org/hellojavaer/ddal/example/example0/init/InitDatabaseSqlBuilder.java
InitDatabaseSqlBuilder.main
public static void main(String[] args) { ShardRouter shardRouter = buildShardRouter(); String createDatabaseSql = "CREATE DATABASE IF NOT EXISTS `%s` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"; String createTableSql = "CREATE TABLE `%s`(`id` bigint(20) NOT NULL, `name` varchar(32) NOT NU...
java
public static void main(String[] args) { ShardRouter shardRouter = buildShardRouter(); String createDatabaseSql = "CREATE DATABASE IF NOT EXISTS `%s` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"; String createTableSql = "CREATE TABLE `%s`(`id` bigint(20) NOT NULL, `name` varchar(32) NOT NU...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "ShardRouter", "shardRouter", "=", "buildShardRouter", "(", ")", ";", "String", "createDatabaseSql", "=", "\"CREATE DATABASE IF NOT EXISTS `%s` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\"...
run this method
[ "run", "this", "method" ]
876dc32ece8bb983df64e94bdcc9045f0ee5cc3b
https://github.com/hellojavaer/ddal/blob/876dc32ece8bb983df64e94bdcc9045f0ee5cc3b/ddal-example/ddal-example-example0/src/main/java/org/hellojavaer/ddal/example/example0/init/InitDatabaseSqlBuilder.java#L45-L50
104,414
hellojavaer/ddal
ddal-jsqlparser/src/main/java/org/hellojavaer/ddal/jsqlparser/JSQLParserAdapter.java
JSQLParserAdapter.visit
@Override public void visit(Delete delete) { if (enableLimitCheck && delete.getLimit() == null) { throw new IllegalStateException("no limit in sql: " + sql); } this.getStack().push(new FrameContext(StatementType.DELETE)); visit0(delete); afterVisitBaseStatement();...
java
@Override public void visit(Delete delete) { if (enableLimitCheck && delete.getLimit() == null) { throw new IllegalStateException("no limit in sql: " + sql); } this.getStack().push(new FrameContext(StatementType.DELETE)); visit0(delete); afterVisitBaseStatement();...
[ "@", "Override", "public", "void", "visit", "(", "Delete", "delete", ")", "{", "if", "(", "enableLimitCheck", "&&", "delete", ".", "getLimit", "(", ")", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"no limit in sql: \"", "+", "sql"...
mysql 'delete' doesn't support alais
[ "mysql", "delete", "doesn", "t", "support", "alais" ]
876dc32ece8bb983df64e94bdcc9045f0ee5cc3b
https://github.com/hellojavaer/ddal/blob/876dc32ece8bb983df64e94bdcc9045f0ee5cc3b/ddal-jsqlparser/src/main/java/org/hellojavaer/ddal/jsqlparser/JSQLParserAdapter.java#L472-L480
104,415
lithiumtech/mineraloil-selenium
src/main/java/com/lithium/mineraloil/selenium/elements/TextElement.java
TextElement.type
public void type(final String text) { autoHover(); if (text == null) return; waitUntilEnabled(); runWithRetries(() -> { elementImpl.locateElement().clear(); elementImpl.locateElement().sendKeys(text); }); }
java
public void type(final String text) { autoHover(); if (text == null) return; waitUntilEnabled(); runWithRetries(() -> { elementImpl.locateElement().clear(); elementImpl.locateElement().sendKeys(text); }); }
[ "public", "void", "type", "(", "final", "String", "text", ")", "{", "autoHover", "(", ")", ";", "if", "(", "text", "==", "null", ")", "return", ";", "waitUntilEnabled", "(", ")", ";", "runWithRetries", "(", "(", ")", "->", "{", "elementImpl", ".", "l...
Clears out the value of the input field first then types specified text. @param text the text to put into the text area
[ "Clears", "out", "the", "value", "of", "the", "input", "field", "first", "then", "types", "specified", "text", "." ]
3710cf2df0b04c7cbf8790d98f3464207fb8175d
https://github.com/lithiumtech/mineraloil-selenium/blob/3710cf2df0b04c7cbf8790d98f3464207fb8175d/src/main/java/com/lithium/mineraloil/selenium/elements/TextElement.java#L55-L63
104,416
lithiumtech/mineraloil-selenium
src/main/java/com/lithium/mineraloil/selenium/elements/ElementImpl.java
ElementImpl.getListWebElements
private List<WebElement> getListWebElements(Callable<List<WebElement>> callable) { int retries = 0; long expireTime = Instant.now().toEpochMilli() + SECONDS.toMillis(INTERACT_WAIT_S); while (Instant.now().toEpochMilli() < expireTime && retries < LOCATE_RETRIES) { try { ...
java
private List<WebElement> getListWebElements(Callable<List<WebElement>> callable) { int retries = 0; long expireTime = Instant.now().toEpochMilli() + SECONDS.toMillis(INTERACT_WAIT_S); while (Instant.now().toEpochMilli() < expireTime && retries < LOCATE_RETRIES) { try { ...
[ "private", "List", "<", "WebElement", ">", "getListWebElements", "(", "Callable", "<", "List", "<", "WebElement", ">", ">", "callable", ")", "{", "int", "retries", "=", "0", ";", "long", "expireTime", "=", "Instant", ".", "now", "(", ")", ".", "toEpochMi...
If nothing found by the timeout, return an empty list
[ "If", "nothing", "found", "by", "the", "timeout", "return", "an", "empty", "list" ]
3710cf2df0b04c7cbf8790d98f3464207fb8175d
https://github.com/lithiumtech/mineraloil-selenium/blob/3710cf2df0b04c7cbf8790d98f3464207fb8175d/src/main/java/com/lithium/mineraloil/selenium/elements/ElementImpl.java#L154-L171
104,417
lithiumtech/mineraloil-selenium
src/main/java/com/lithium/mineraloil/selenium/elements/Driver.java
Driver.switchWindow
public void switchWindow() { List<String> windowHandles = new ArrayList<>(getWindowHandles()); getDriver().switchTo().window(windowHandles.get(windowHandles.size() - 1)); }
java
public void switchWindow() { List<String> windowHandles = new ArrayList<>(getWindowHandles()); getDriver().switchTo().window(windowHandles.get(windowHandles.size() - 1)); }
[ "public", "void", "switchWindow", "(", ")", "{", "List", "<", "String", ">", "windowHandles", "=", "new", "ArrayList", "<>", "(", "getWindowHandles", "(", ")", ")", ";", "getDriver", "(", ")", ".", "switchTo", "(", ")", ".", "window", "(", "windowHandles...
switches to the last opened window
[ "switches", "to", "the", "last", "opened", "window" ]
3710cf2df0b04c7cbf8790d98f3464207fb8175d
https://github.com/lithiumtech/mineraloil-selenium/blob/3710cf2df0b04c7cbf8790d98f3464207fb8175d/src/main/java/com/lithium/mineraloil/selenium/elements/Driver.java#L84-L87
104,418
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java
ResourceManager.putCachedResource
private static void putCachedResource( String baseName, Resources resources ) { synchronized( ResourceManager.class ) { WeakReference<Resources> ref = new WeakReference<Resources>( resources ); RESOURCES.put( baseName, ref ); } }
java
private static void putCachedResource( String baseName, Resources resources ) { synchronized( ResourceManager.class ) { WeakReference<Resources> ref = new WeakReference<Resources>( resources ); RESOURCES.put( baseName, ref ); } }
[ "private", "static", "void", "putCachedResource", "(", "String", "baseName", ",", "Resources", "resources", ")", "{", "synchronized", "(", "ResourceManager", ".", "class", ")", "{", "WeakReference", "<", "Resources", ">", "ref", "=", "new", "WeakReference", "<",...
Cache specified resource in weak reference. @param baseName the resource key @param resources the resources object
[ "Cache", "specified", "resource", "in", "weak", "reference", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java#L138-L145
104,419
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java
ResourceManager.getCachedResource
private static Resources getCachedResource( String baseName ) { synchronized( ResourceManager.class ) { WeakReference weakReference = RESOURCES.get( baseName ); if( null == weakReference ) { return null; } else {...
java
private static Resources getCachedResource( String baseName ) { synchronized( ResourceManager.class ) { WeakReference weakReference = RESOURCES.get( baseName ); if( null == weakReference ) { return null; } else {...
[ "private", "static", "Resources", "getCachedResource", "(", "String", "baseName", ")", "{", "synchronized", "(", "ResourceManager", ".", "class", ")", "{", "WeakReference", "weakReference", "=", "RESOURCES", ".", "get", "(", "baseName", ")", ";", "if", "(", "n...
Retrieve cached resource. @param baseName the resource key @return resources the resources object
[ "Retrieve", "cached", "resource", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java#L154-L168
104,420
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java
ResourceManager.getPackageResources
public static Resources getPackageResources( Class clazz, Locale locale ) { return getBaseResources( getPackageResourcesBaseName( clazz ), locale, clazz.getClassLoader() ); }
java
public static Resources getPackageResources( Class clazz, Locale locale ) { return getBaseResources( getPackageResourcesBaseName( clazz ), locale, clazz.getClassLoader() ); }
[ "public", "static", "Resources", "getPackageResources", "(", "Class", "clazz", ",", "Locale", "locale", ")", "{", "return", "getBaseResources", "(", "getPackageResourcesBaseName", "(", "clazz", ")", ",", "locale", ",", "clazz", ".", "getClassLoader", "(", ")", "...
Retrieve resource for specified Classes package. The basename is determined by name of classes package postfixed with ".Resources". @param clazz the Class @param locale the locale of the package resources requested. @return the Resources
[ "Retrieve", "resource", "for", "specified", "Classes", "package", ".", "The", "basename", "is", "determined", "by", "name", "of", "classes", "package", "postfixed", "with", ".", "Resources", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java#L207-L210
104,421
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java
ResourceManager.getClassResources
public static Resources getClassResources( Class clazz, Locale locale ) { return getBaseResources( getClassResourcesBaseName( clazz ), locale, clazz.getClassLoader() ); }
java
public static Resources getClassResources( Class clazz, Locale locale ) { return getBaseResources( getClassResourcesBaseName( clazz ), locale, clazz.getClassLoader() ); }
[ "public", "static", "Resources", "getClassResources", "(", "Class", "clazz", ",", "Locale", "locale", ")", "{", "return", "getBaseResources", "(", "getClassResourcesBaseName", "(", "clazz", ")", ",", "locale", ",", "clazz", ".", "getClassLoader", "(", ")", ")", ...
Retrieve resource for specified Class. The basename is determined by name of Class postfixed with "Resources". @param clazz the Class @param locale the requested Locale. @return the Resources
[ "Retrieve", "resource", "for", "specified", "Class", ".", "The", "basename", "is", "determined", "by", "name", "of", "Class", "postfixed", "with", "Resources", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java#L236-L239
104,422
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java
ResourceManager.getPackageResourcesBaseName
public static String getPackageResourcesBaseName( Class clazz ) { final Package pkg = clazz.getPackage(); String baseName; if( null == pkg ) { String name = clazz.getName(); if( -1 == name.lastIndexOf( "." ) ) { baseName = "Resourc...
java
public static String getPackageResourcesBaseName( Class clazz ) { final Package pkg = clazz.getPackage(); String baseName; if( null == pkg ) { String name = clazz.getName(); if( -1 == name.lastIndexOf( "." ) ) { baseName = "Resourc...
[ "public", "static", "String", "getPackageResourcesBaseName", "(", "Class", "clazz", ")", "{", "final", "Package", "pkg", "=", "clazz", ".", "getPackage", "(", ")", ";", "String", "baseName", ";", "if", "(", "null", "==", "pkg", ")", "{", "String", "name", ...
Retrieve resource basename for specified Classes package. The basename is determined by name of classes package postfixed with ".Resources". @param clazz the Class @return the resource basename
[ "Retrieve", "resource", "basename", "for", "specified", "Classes", "package", ".", "The", "basename", "is", "determined", "by", "name", "of", "classes", "package", "postfixed", "with", ".", "Resources", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/ResourceManager.java#L250-L273
104,423
ops4j/org.ops4j.base
ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java
ServiceProviderFinder.findServiceProviders
public static <T> List<T> findServiceProviders( Class<T> klass ) { ServiceLoader<T> loader = ServiceLoader.load( klass ); List<T> providers = new ArrayList<T>(); Iterator<T> it = loader.iterator(); while ( it.hasNext() ) { providers.add( it.next() ); } ...
java
public static <T> List<T> findServiceProviders( Class<T> klass ) { ServiceLoader<T> loader = ServiceLoader.load( klass ); List<T> providers = new ArrayList<T>(); Iterator<T> it = loader.iterator(); while ( it.hasNext() ) { providers.add( it.next() ); } ...
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "findServiceProviders", "(", "Class", "<", "T", ">", "klass", ")", "{", "ServiceLoader", "<", "T", ">", "loader", "=", "ServiceLoader", ".", "load", "(", "klass", ")", ";", "List", "<", "T", ...
Finds all providers for a given service. @param klass service interface or class @return list of all providers (not null)
[ "Finds", "all", "providers", "for", "a", "given", "service", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java#L39-L49
104,424
ops4j/org.ops4j.base
ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java
ServiceProviderFinder.findAnyServiceProvider
public static <T> T findAnyServiceProvider( Class<T> klass ) { ServiceLoader<T> loader = ServiceLoader.load( klass ); Iterator<T> it = loader.iterator(); return it.hasNext() ? it.next() : null; }
java
public static <T> T findAnyServiceProvider( Class<T> klass ) { ServiceLoader<T> loader = ServiceLoader.load( klass ); Iterator<T> it = loader.iterator(); return it.hasNext() ? it.next() : null; }
[ "public", "static", "<", "T", ">", "T", "findAnyServiceProvider", "(", "Class", "<", "T", ">", "klass", ")", "{", "ServiceLoader", "<", "T", ">", "loader", "=", "ServiceLoader", ".", "load", "(", "klass", ")", ";", "Iterator", "<", "T", ">", "it", "=...
Finds any provider for a given service. @param klass service interface or class @return the first provider found, or null
[ "Finds", "any", "provider", "for", "a", "given", "service", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java#L57-L62
104,425
ops4j/org.ops4j.base
ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java
ServiceProviderFinder.loadAnyServiceProvider
public static <T> T loadAnyServiceProvider( Class<T> klass ) { T provider = findAnyServiceProvider( klass ); if (provider == null) { throw new NoServiceProviderException( klass.getName() + ": no service provider found in META-INF/services on classpath" ); ...
java
public static <T> T loadAnyServiceProvider( Class<T> klass ) { T provider = findAnyServiceProvider( klass ); if (provider == null) { throw new NoServiceProviderException( klass.getName() + ": no service provider found in META-INF/services on classpath" ); ...
[ "public", "static", "<", "T", ">", "T", "loadAnyServiceProvider", "(", "Class", "<", "T", ">", "klass", ")", "{", "T", "provider", "=", "findAnyServiceProvider", "(", "klass", ")", ";", "if", "(", "provider", "==", "null", ")", "{", "throw", "new", "No...
Returns any provider for a given service and throws an exception when no provider is found on the classpath. @param klass service interface or class @return the first provider found @throws NoServiceProviderException
[ "Returns", "any", "provider", "for", "a", "given", "service", "and", "throws", "an", "exception", "when", "no", "provider", "is", "found", "on", "the", "classpath", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java#L72-L80
104,426
ops4j/org.ops4j.base
ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java
ServiceProviderFinder.loadUniqueServiceProvider
public static <T> T loadUniqueServiceProvider( Class<T> klass ) { List<T> providers = findServiceProviders( klass ); if( providers.isEmpty() ) { throw new NoServiceProviderException( klass.getName() + ": no service provider found in META-INF/services on classp...
java
public static <T> T loadUniqueServiceProvider( Class<T> klass ) { List<T> providers = findServiceProviders( klass ); if( providers.isEmpty() ) { throw new NoServiceProviderException( klass.getName() + ": no service provider found in META-INF/services on classp...
[ "public", "static", "<", "T", ">", "T", "loadUniqueServiceProvider", "(", "Class", "<", "T", ">", "klass", ")", "{", "List", "<", "T", ">", "providers", "=", "findServiceProviders", "(", "klass", ")", ";", "if", "(", "providers", ".", "isEmpty", "(", "...
Returns the unique service provider for a given service and throws an exception if there is no unique provider @param klass service interface or class @return the first provider found @throws NoServiceProviderException @throws NonUniqueServiceProviderException
[ "Returns", "the", "unique", "service", "provider", "for", "a", "given", "service", "and", "throws", "an", "exception", "if", "there", "is", "no", "unique", "provider" ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-spi/src/main/java/org/ops4j/spi/ServiceProviderFinder.java#L91-L105
104,427
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/Pipe.java
Pipe.start
public synchronized Pipe start( final String name ) { if( null == m_pump && null != m_in && null != m_out ) { // might re-use a pump m_pump = startPump( m_in ); m_pump.setName( name ); m_pump.connect( m_out ); } return this; }
java
public synchronized Pipe start( final String name ) { if( null == m_pump && null != m_in && null != m_out ) { // might re-use a pump m_pump = startPump( m_in ); m_pump.setName( name ); m_pump.connect( m_out ); } return this; }
[ "public", "synchronized", "Pipe", "start", "(", "final", "String", "name", ")", "{", "if", "(", "null", "==", "m_pump", "&&", "null", "!=", "m_in", "&&", "null", "!=", "m_out", ")", "{", "// might re-use a pump", "m_pump", "=", "startPump", "(", "m_in", ...
Start piping data from input to output. @param name pipe name @return pipe instance
[ "Start", "piping", "data", "from", "input", "to", "output", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/Pipe.java#L84-L94
104,428
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/Pipe.java
Pipe.stop
public synchronized void stop() { if( null != m_pump ) { // disconnect pump m_pump.connect( null ); m_pump.setName( m_pump.getName() + " (disconnected)" ); m_pump = null; } }
java
public synchronized void stop() { if( null != m_pump ) { // disconnect pump m_pump.connect( null ); m_pump.setName( m_pump.getName() + " (disconnected)" ); m_pump = null; } }
[ "public", "synchronized", "void", "stop", "(", ")", "{", "if", "(", "null", "!=", "m_pump", ")", "{", "// disconnect pump", "m_pump", ".", "connect", "(", "null", ")", ";", "m_pump", ".", "setName", "(", "m_pump", ".", "getName", "(", ")", "+", "\" (di...
Stop piping data from input to output.
[ "Stop", "piping", "data", "from", "input", "to", "output", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/Pipe.java#L99-L108
104,429
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/FileUtils.java
FileUtils.getFileFromClasspath
public static File getFileFromClasspath(final String filePath) throws FileNotFoundException { try { URL fileURL = FileUtils.class.getClassLoader().getResource(filePath); if (fileURL == null) { throw new FileNotFoundException("File [" + filePath + "] could not be found in ...
java
public static File getFileFromClasspath(final String filePath) throws FileNotFoundException { try { URL fileURL = FileUtils.class.getClassLoader().getResource(filePath); if (fileURL == null) { throw new FileNotFoundException("File [" + filePath + "] could not be found in ...
[ "public", "static", "File", "getFileFromClasspath", "(", "final", "String", "filePath", ")", "throws", "FileNotFoundException", "{", "try", "{", "URL", "fileURL", "=", "FileUtils", ".", "class", ".", "getClassLoader", "(", ")", ".", "getResource", "(", "filePath...
Searches the classpath for the file denoted by the file path and returns the corresponding file. @param filePath path to the file @return a file corresponding to the path @throws FileNotFoundException if the file cannot be found
[ "Searches", "the", "classpath", "for", "the", "file", "denoted", "by", "the", "file", "path", "and", "returns", "the", "corresponding", "file", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/FileUtils.java#L105-L115
104,430
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/FileUtils.java
FileUtils.delete
public static boolean delete(final File file) { boolean delete = false; if (file != null && file.exists()) { // even if is a directory try to delete. maybe is empty or maybe is a *nix symbolic link delete = file.delete(); if (!delete && file.isDirectory()) { ...
java
public static boolean delete(final File file) { boolean delete = false; if (file != null && file.exists()) { // even if is a directory try to delete. maybe is empty or maybe is a *nix symbolic link delete = file.delete(); if (!delete && file.isDirectory()) { ...
[ "public", "static", "boolean", "delete", "(", "final", "File", "file", ")", "{", "boolean", "delete", "=", "false", ";", "if", "(", "file", "!=", "null", "&&", "file", ".", "exists", "(", ")", ")", "{", "// even if is a directory try to delete. maybe is empty ...
Deletes the file or recursively deletes a directory depending on the file passed. @param file file or directory to be deleted. @return true if the file was deleted.
[ "Deletes", "the", "file", "or", "recursively", "deletes", "a", "directory", "depending", "on", "the", "file", "passed", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/FileUtils.java#L125-L142
104,431
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/ListerUtils.java
ListerUtils.parseFilter
public static Pattern parseFilter( final String spec ) { StringBuffer sb = new StringBuffer(); for( int j = 0; j < spec.length(); j++ ) { char c = spec.charAt( j ); switch( c ) { case '.': sb.append( "\\." ); ...
java
public static Pattern parseFilter( final String spec ) { StringBuffer sb = new StringBuffer(); for( int j = 0; j < spec.length(); j++ ) { char c = spec.charAt( j ); switch( c ) { case '.': sb.append( "\\." ); ...
[ "public", "static", "Pattern", "parseFilter", "(", "final", "String", "spec", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "spec", ".", "length", "(", ")", ";", "j", "++...
Parses a usual filter into a regex pattern. @param spec the filter to be parsed @return a regexp pattern corresponding to the filter @throws IllegalArgumentException - If the filter could not be compiled to a pattern
[ "Parses", "a", "usual", "filter", "into", "a", "regex", "pattern", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ListerUtils.java#L45-L83
104,432
ops4j/org.ops4j.base
ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java
ElementHelper.getRootElement
public static Element getRootElement( InputStream input ) throws ParserConfigurationException, IOException, SAXException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating( false ); factory.setNamespaceAware( false ); try { ...
java
public static Element getRootElement( InputStream input ) throws ParserConfigurationException, IOException, SAXException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating( false ); factory.setNamespaceAware( false ); try { ...
[ "public", "static", "Element", "getRootElement", "(", "InputStream", "input", ")", "throws", "ParserConfigurationException", ",", "IOException", ",", "SAXException", "{", "DocumentBuilderFactory", "factory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", "...
Return the root element of the supplied input stream. @param input the input stream containing a XML definition @return the root element @throws IOException If an underlying I/O problem occurred. @throws ParserConfigurationException if there is a severe problem in the XML parsing subsystem. @throws ...
[ "Return", "the", "root", "element", "of", "the", "supplied", "input", "stream", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java#L65-L105
104,433
ops4j/org.ops4j.base
ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java
ElementHelper.getChild
public static Element getChild( Element root, String name ) { if( null == root ) { return null; } NodeList list = root.getElementsByTagName( name ); int n = list.getLength(); if( n < 1 ) { return null; } return (Element)...
java
public static Element getChild( Element root, String name ) { if( null == root ) { return null; } NodeList list = root.getElementsByTagName( name ); int n = list.getLength(); if( n < 1 ) { return null; } return (Element)...
[ "public", "static", "Element", "getChild", "(", "Element", "root", ",", "String", "name", ")", "{", "if", "(", "null", "==", "root", ")", "{", "return", "null", ";", "}", "NodeList", "list", "=", "root", ".", "getElementsByTagName", "(", "name", ")", "...
Return a named child relative to a supplied element. @param root the parent DOM element @param name the name of a child element @return the child element of null if the child does not exist
[ "Return", "a", "named", "child", "relative", "to", "a", "supplied", "element", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java#L115-L128
104,434
ops4j/org.ops4j.base
ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java
ElementHelper.getChildren
public static Element[] getChildren( Element root, String name ) { if( null == root ) { return new Element[0]; } NodeList list = root.getElementsByTagName( name ); int n = list.getLength(); ArrayList<Element> result = new ArrayList<Element>(); for(...
java
public static Element[] getChildren( Element root, String name ) { if( null == root ) { return new Element[0]; } NodeList list = root.getElementsByTagName( name ); int n = list.getLength(); ArrayList<Element> result = new ArrayList<Element>(); for(...
[ "public", "static", "Element", "[", "]", "getChildren", "(", "Element", "root", ",", "String", "name", ")", "{", "if", "(", "null", "==", "root", ")", "{", "return", "new", "Element", "[", "0", "]", ";", "}", "NodeList", "list", "=", "root", ".", "...
Return all children matching the supplied element name. @param root the parent DOM element @param name the name against which child element will be matched @return the array of child elements with a matching name
[ "Return", "all", "children", "matching", "the", "supplied", "element", "name", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java#L138-L158
104,435
ops4j/org.ops4j.base
ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java
ElementHelper.getValue
public static String getValue( Element node ) { if( null == node ) { return null; } String value; if( node.getChildNodes().getLength() > 0 ) { value = node.getFirstChild().getNodeValue(); } else { value = nod...
java
public static String getValue( Element node ) { if( null == node ) { return null; } String value; if( node.getChildNodes().getLength() > 0 ) { value = node.getFirstChild().getNodeValue(); } else { value = nod...
[ "public", "static", "String", "getValue", "(", "Element", "node", ")", "{", "if", "(", "null", "==", "node", ")", "{", "return", "null", ";", "}", "String", "value", ";", "if", "(", "node", ".", "getChildNodes", "(", ")", ".", "getLength", "(", ")", ...
Return the value of an element. @param node the DOM node @return the node value
[ "Return", "the", "value", "of", "an", "element", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java#L201-L217
104,436
ops4j/org.ops4j.base
ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java
ElementHelper.normalize
private static String normalize( String value, Properties props ) { return PropertyResolver.resolve( props, value ); }
java
private static String normalize( String value, Properties props ) { return PropertyResolver.resolve( props, value ); }
[ "private", "static", "String", "normalize", "(", "String", "value", ",", "Properties", "props", ")", "{", "return", "PropertyResolver", ".", "resolve", "(", "props", ",", "value", ")", ";", "}" ]
Parse the value for any property tokens relative to the supplied properties. @param value the value to parse @param props the reference properties @return the normalized string
[ "Parse", "the", "value", "for", "any", "property", "tokens", "relative", "to", "the", "supplied", "properties", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-xml/src/main/java/org/ops4j/util/xml/ElementHelper.java#L279-L282
104,437
ops4j/org.ops4j.base
ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java
ConnectionCache.get
public URLConnection get( Object key ) { synchronized( this ) // ensure no ConcurrentModificationException can occur. { Entry entry = m_hardStore.get( key ); if( entry == null ) { return null; } return entry.m_connection; ...
java
public URLConnection get( Object key ) { synchronized( this ) // ensure no ConcurrentModificationException can occur. { Entry entry = m_hardStore.get( key ); if( entry == null ) { return null; } return entry.m_connection; ...
[ "public", "URLConnection", "get", "(", "Object", "key", ")", "{", "synchronized", "(", "this", ")", "// ensure no ConcurrentModificationException can occur.", "{", "Entry", "entry", "=", "m_hardStore", ".", "get", "(", "key", ")", ";", "if", "(", "entry", "==", ...
Returns the URLConnection associated with the given key. @param key The key that is associated to the URL. @return the URLConnection associated with the given key.
[ "Returns", "the", "URLConnection", "associated", "with", "the", "given", "key", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java#L87-L98
104,438
ops4j/org.ops4j.base
ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java
ConnectionCache.put
public void put( Object key, URLConnection conn ) { synchronized( this ) // ensure no ConcurrentModificationException can occur. { Entry entry = new Entry( conn ); m_hardStore.put( key, entry ); if( m_thread == null ) { m_thread = new T...
java
public void put( Object key, URLConnection conn ) { synchronized( this ) // ensure no ConcurrentModificationException can occur. { Entry entry = new Entry( conn ); m_hardStore.put( key, entry ); if( m_thread == null ) { m_thread = new T...
[ "public", "void", "put", "(", "Object", "key", ",", "URLConnection", "conn", ")", "{", "synchronized", "(", "this", ")", "// ensure no ConcurrentModificationException can occur.", "{", "Entry", "entry", "=", "new", "Entry", "(", "conn", ")", ";", "m_hardStore", ...
Stores a URLConnection in association with a key. @param key The key that is associated to the URLConnection. @param conn The URLConnection that should be stored in association with the key.
[ "Stores", "a", "URLConnection", "in", "association", "with", "a", "key", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java#L106-L119
104,439
ops4j/org.ops4j.base
ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java
ConnectionCache.mainLoop
private boolean mainLoop() throws InterruptedException { long now = System.currentTimeMillis(); Iterator list = m_hardStore.values().iterator(); while( list.hasNext() ) { Entry entry = (Entry) list.next(); if( entry.m_collectTime < now ) { ...
java
private boolean mainLoop() throws InterruptedException { long now = System.currentTimeMillis(); Iterator list = m_hardStore.values().iterator(); while( list.hasNext() ) { Entry entry = (Entry) list.next(); if( entry.m_collectTime < now ) { ...
[ "private", "boolean", "mainLoop", "(", ")", "throws", "InterruptedException", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Iterator", "list", "=", "m_hardStore", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "whil...
The main loop of the cache, which checks for expirations. @return true if the thread should be stopped. @throws InterruptedException if the thread was interrupted while blocking.
[ "The", "main", "loop", "of", "the", "cache", "which", "checks", "for", "expirations", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java#L170-L191
104,440
ops4j/org.ops4j.base
ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java
ConnectionCache.unregisterExceptionMonitor
public void unregisterExceptionMonitor( ExceptionMonitor monitor ) { synchronized( this ) { if( monitor == null || !monitor.equals( m_exceptionMonitor ) ) { return; } m_exceptionMonitor = null; } }
java
public void unregisterExceptionMonitor( ExceptionMonitor monitor ) { synchronized( this ) { if( monitor == null || !monitor.equals( m_exceptionMonitor ) ) { return; } m_exceptionMonitor = null; } }
[ "public", "void", "unregisterExceptionMonitor", "(", "ExceptionMonitor", "monitor", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "monitor", "==", "null", "||", "!", "monitor", ".", "equals", "(", "m_exceptionMonitor", ")", ")", "{", "return", ...
Unregister a ExceptionMonitor with the source. @param monitor The ExceptionMonitor to be unregistered. @requires HansaPermission "api.exceptionmonitor", "remove"
[ "Unregister", "a", "ExceptionMonitor", "with", "the", "source", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java#L221-L231
104,441
ops4j/org.ops4j.base
ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java
ConnectionCache.getExceptionMonitors
public List<ExceptionMonitor> getExceptionMonitors() { synchronized( this ) { ArrayList<ExceptionMonitor> result = new ArrayList<ExceptionMonitor>(); result.add( m_exceptionMonitor ); return result; } }
java
public List<ExceptionMonitor> getExceptionMonitors() { synchronized( this ) { ArrayList<ExceptionMonitor> result = new ArrayList<ExceptionMonitor>(); result.add( m_exceptionMonitor ); return result; } }
[ "public", "List", "<", "ExceptionMonitor", ">", "getExceptionMonitors", "(", ")", "{", "synchronized", "(", "this", ")", "{", "ArrayList", "<", "ExceptionMonitor", ">", "result", "=", "new", "ArrayList", "<", "ExceptionMonitor", ">", "(", ")", ";", "result", ...
Returns all ExceptionMonitors that are registered. @return all ExceptionMonitors that are registered. @requires HansaPermission "api.exceptionmonitor", "get"
[ "Returns", "all", "ExceptionMonitors", "that", "are", "registered", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-net/src/main/java/org/ops4j/net/ConnectionCache.java#L240-L248
104,442
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java
PropertiesUtils.readProps
public static Properties readProps( URL propsUrl, Properties mappings ) throws IOException { InputStream stream = propsUrl.openStream(); return readProperties( stream, mappings, true ); }
java
public static Properties readProps( URL propsUrl, Properties mappings ) throws IOException { InputStream stream = propsUrl.openStream(); return readProperties( stream, mappings, true ); }
[ "public", "static", "Properties", "readProps", "(", "URL", "propsUrl", ",", "Properties", "mappings", ")", "throws", "IOException", "{", "InputStream", "stream", "=", "propsUrl", ".", "openStream", "(", ")", ";", "return", "readProperties", "(", "stream", ",", ...
Read a set of properties from a property file specificed by a url. @param propsUrl the url of the property file to read @param mappings Properties that will be available for translations initially. @return the resolved properties @throws IOException if an io error occurs @see #readProperties(java.io.InputStream,java...
[ "Read", "a", "set", "of", "properties", "from", "a", "property", "file", "specificed", "by", "a", "url", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java#L54-L59
104,443
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java
PropertiesUtils.resolveProperty
public static String resolveProperty( Properties props, String value ) { return PropertyResolver.resolve( props, value ); }
java
public static String resolveProperty( Properties props, String value ) { return PropertyResolver.resolve( props, value ); }
[ "public", "static", "String", "resolveProperty", "(", "Properties", "props", ",", "String", "value", ")", "{", "return", "PropertyResolver", ".", "resolve", "(", "props", ",", "value", ")", ";", "}" ]
Resolve symbols in a supplied value against supplied known properties. @param props a set of know properties @param value the string to parse for tokens @return the resolved string
[ "Resolve", "symbols", "in", "a", "supplied", "value", "against", "supplied", "known", "properties", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java#L139-L142
104,444
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java
PropertiesUtils.getProperty
public static String getProperty( Properties props, String key, String def ) { String value = props.getProperty( key, def ); if( value == null ) { return null; } if( "".equals( value ) ) { return value; } value = PropertyResolve...
java
public static String getProperty( Properties props, String key, String def ) { String value = props.getProperty( key, def ); if( value == null ) { return null; } if( "".equals( value ) ) { return value; } value = PropertyResolve...
[ "public", "static", "String", "getProperty", "(", "Properties", "props", ",", "String", "key", ",", "String", "def", ")", "{", "String", "value", "=", "props", ".", "getProperty", "(", "key", ",", "def", ")", ";", "if", "(", "value", "==", "null", ")",...
Return the value of a property. @param props the property file @param key the property key to lookup @param def the default value @return the resolve value
[ "Return", "the", "value", "of", "a", "property", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java#L153-L166
104,445
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java
PropertiesUtils.readListFile
public static String[] readListFile( URL listFile ) throws IOException { ArrayList<String> list = new ArrayList<String>(); InputStream stream = listFile.openStream(); try { InputStreamReader isr = new InputStreamReader( stream, "UTF-8" ); BufferedReade...
java
public static String[] readListFile( URL listFile ) throws IOException { ArrayList<String> list = new ArrayList<String>(); InputStream stream = listFile.openStream(); try { InputStreamReader isr = new InputStreamReader( stream, "UTF-8" ); BufferedReade...
[ "public", "static", "String", "[", "]", "readListFile", "(", "URL", "listFile", ")", "throws", "IOException", "{", "ArrayList", "<", "String", ">", "list", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "InputStream", "stream", "=", "listFile"...
Read a file and return the list of lines in an array of strings. @param listFile the url to read from @return the lines @throws IOException if a read error occurs
[ "Read", "a", "file", "and", "return", "the", "list", "of", "lines", "in", "an", "array", "of", "strings", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesUtils.java#L177-L200
104,446
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.toFirstCap
private static String toFirstCap( String applicationname ) { char first = applicationname.charAt( 0 ); first = Character.toUpperCase( first ); String name = first + applicationname.substring( 1 ); return name; }
java
private static String toFirstCap( String applicationname ) { char first = applicationname.charAt( 0 ); first = Character.toUpperCase( first ); String name = first + applicationname.substring( 1 ); return name; }
[ "private", "static", "String", "toFirstCap", "(", "String", "applicationname", ")", "{", "char", "first", "=", "applicationname", ".", "charAt", "(", "0", ")", ";", "first", "=", "Character", ".", "toUpperCase", "(", "first", ")", ";", "String", "name", "=...
Capitalizes the first character. @param applicationname The application name to be capitalized in the first character. @return A capitalized first character of the provided application name.
[ "Capitalizes", "the", "first", "character", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L190-L196
104,447
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.getEnvVariable
public static String getEnvVariable( String name ) throws EnvironmentException { if( isUnix() ) { Properties properties = getUnixShellVariables(); return properties.getProperty( name ); } else if( isWindows() ) { Properties properti...
java
public static String getEnvVariable( String name ) throws EnvironmentException { if( isUnix() ) { Properties properties = getUnixShellVariables(); return properties.getProperty( name ); } else if( isWindows() ) { Properties properti...
[ "public", "static", "String", "getEnvVariable", "(", "String", "name", ")", "throws", "EnvironmentException", "{", "if", "(", "isUnix", "(", ")", ")", "{", "Properties", "properties", "=", "getUnixShellVariables", "(", ")", ";", "return", "properties", ".", "g...
Gets the value of a shell environment variable. @param name the name of variable @return the String representation of an environment variable value @throws EnvironmentException if there is a problem accessing the environment
[ "Gets", "the", "value", "of", "a", "shell", "environment", "variable", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L207-L223
104,448
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.getEnvVariables
public static Properties getEnvVariables() throws EnvironmentException { if( isUnix() ) { return getUnixShellVariables(); } if( isWindows() ) { return getWindowsShellVariables(); } String message = "Environment operations not s...
java
public static Properties getEnvVariables() throws EnvironmentException { if( isUnix() ) { return getUnixShellVariables(); } if( isWindows() ) { return getWindowsShellVariables(); } String message = "Environment operations not s...
[ "public", "static", "Properties", "getEnvVariables", "(", ")", "throws", "EnvironmentException", "{", "if", "(", "isUnix", "(", ")", ")", "{", "return", "getUnixShellVariables", "(", ")", ";", "}", "if", "(", "isWindows", "(", ")", ")", "{", "return", "get...
Gets all environment variables within a Properties instance where the key is the environment variable name and value is the value of the property. @return the environment variables and values as Properties @throws EnvironmentException if os is not recognized
[ "Gets", "all", "environment", "variables", "within", "a", "Properties", "instance", "where", "the", "key", "is", "the", "environment", "variable", "name", "and", "value", "is", "the", "value", "of", "the", "property", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L288-L303
104,449
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.getUserShell
public static String getUserShell() throws EnvironmentException { if( isMacOsX() ) { return getMacUserShell(); } if( isWindows() ) { return getWindowsUserShell(); } if( isUnix() ) { return getUnixUserShell(...
java
public static String getUserShell() throws EnvironmentException { if( isMacOsX() ) { return getMacUserShell(); } if( isWindows() ) { return getWindowsUserShell(); } if( isUnix() ) { return getUnixUserShell(...
[ "public", "static", "String", "getUserShell", "(", ")", "throws", "EnvironmentException", "{", "if", "(", "isMacOsX", "(", ")", ")", "{", "return", "getMacUserShell", "(", ")", ";", "}", "if", "(", "isWindows", "(", ")", ")", "{", "return", "getWindowsUser...
Gets the user's shell executable. @return the shell executable for the user @throws EnvironmentException the there is a problem accessing shell information
[ "Gets", "the", "user", "s", "shell", "executable", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L313-L334
104,450
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.getWindowsUserShell
private static String getWindowsUserShell() { if( null != m_SHELL ) { return m_SHELL; } if( -1 != OSNAME.indexOf( "98" ) || -1 != OSNAME.indexOf( "95" ) || -1 != OSNAME.indexOf( "Me" ) ) { m_SHELL = "command.com"; r...
java
private static String getWindowsUserShell() { if( null != m_SHELL ) { return m_SHELL; } if( -1 != OSNAME.indexOf( "98" ) || -1 != OSNAME.indexOf( "95" ) || -1 != OSNAME.indexOf( "Me" ) ) { m_SHELL = "command.com"; r...
[ "private", "static", "String", "getWindowsUserShell", "(", ")", "{", "if", "(", "null", "!=", "m_SHELL", ")", "{", "return", "m_SHELL", ";", "}", "if", "(", "-", "1", "!=", "OSNAME", ".", "indexOf", "(", "\"98\"", ")", "||", "-", "1", "!=", "OSNAME",...
Gets the shell used by the Windows user. @return the shell: cmd.exe or command.com.
[ "Gets", "the", "shell", "used", "by", "the", "Windows", "user", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L345-L362
104,451
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.getMacUserShell
private static String getMacUserShell() throws EnvironmentException { if( null != m_SHELL ) { return m_SHELL; } String[] args = { "nidump", "passwd", "/" }; return readShellFromPasswdFile( args ); }
java
private static String getMacUserShell() throws EnvironmentException { if( null != m_SHELL ) { return m_SHELL; } String[] args = { "nidump", "passwd", "/" }; return readShellFromPasswdFile( args ); }
[ "private", "static", "String", "getMacUserShell", "(", ")", "throws", "EnvironmentException", "{", "if", "(", "null", "!=", "m_SHELL", ")", "{", "return", "m_SHELL", ";", "}", "String", "[", "]", "args", "=", "{", "\"nidump\"", ",", "\"passwd\"", ",", "\"/...
Gets the default login shell used by a mac user. @return the Mac user's default shell as referenced by cmd: 'nidump passwd /' @throws EnvironmentException if os information is not resolvable
[ "Gets", "the", "default", "login", "shell", "used", "by", "a", "mac", "user", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L372-L381
104,452
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.getUnixUserShell
private static String getUnixUserShell() throws EnvironmentException { if( null != m_SHELL ) { return m_SHELL; } String[] args = { "cat", "/etc/passwd" }; return readShellFromPasswdFile( args ); }
java
private static String getUnixUserShell() throws EnvironmentException { if( null != m_SHELL ) { return m_SHELL; } String[] args = { "cat", "/etc/passwd" }; return readShellFromPasswdFile( args ); }
[ "private", "static", "String", "getUnixUserShell", "(", ")", "throws", "EnvironmentException", "{", "if", "(", "null", "!=", "m_SHELL", ")", "{", "return", "m_SHELL", ";", "}", "String", "[", "]", "args", "=", "{", "\"cat\"", ",", "\"/etc/passwd\"", "}", "...
Gets the default login shell used by a unix user. @return the Mac user's default shell as referenced by cmd: 'nidump passwd /' @throws EnvironmentException if os information is not resolvable
[ "Gets", "the", "default", "login", "shell", "used", "by", "a", "unix", "user", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L391-L400
104,453
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.processPasswdFile
private static void processPasswdFile( BufferedReader reader ) throws IOException { String entry = reader.readLine(); while( null != entry ) { // Skip entries other than the one for this username if( entry.startsWith( USERNAME ) ) { ...
java
private static void processPasswdFile( BufferedReader reader ) throws IOException { String entry = reader.readLine(); while( null != entry ) { // Skip entries other than the one for this username if( entry.startsWith( USERNAME ) ) { ...
[ "private", "static", "void", "processPasswdFile", "(", "BufferedReader", "reader", ")", "throws", "IOException", "{", "String", "entry", "=", "reader", ".", "readLine", "(", ")", ";", "while", "(", "null", "!=", "entry", ")", "{", "// Skip entries other than the...
Process a password file. @param reader The Reader connected to the password file. @throws IOException if an underlying I/O problem occurs.
[ "Process", "a", "password", "file", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L450-L473
104,454
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.getUnixEnv
private static String getUnixEnv() throws EnvironmentException { File env = new File( "/bin/env" ); if( env.exists() && env.canRead() && env.isFile() ) { return env.getAbsolutePath(); } env = new File( "/usr/bin/env" ); if( env.exists() && env.ca...
java
private static String getUnixEnv() throws EnvironmentException { File env = new File( "/bin/env" ); if( env.exists() && env.canRead() && env.isFile() ) { return env.getAbsolutePath(); } env = new File( "/usr/bin/env" ); if( env.exists() && env.ca...
[ "private", "static", "String", "getUnixEnv", "(", ")", "throws", "EnvironmentException", "{", "File", "env", "=", "new", "File", "(", "\"/bin/env\"", ")", ";", "if", "(", "env", ".", "exists", "(", ")", "&&", "env", ".", "canRead", "(", ")", "&&", "env...
Gets the UNIX env executable path. @return the absolute path to the env program @throws EnvironmentException if it cannot be found
[ "Gets", "the", "UNIX", "env", "executable", "path", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L506-L523
104,455
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.processLinesOfEnvironmentVariables
private static void processLinesOfEnvironmentVariables( BufferedReader reader, Properties properties ) throws IOException { String line = reader.readLine(); while( null != line ) { int index = line.indexOf( '=' ); if( -1 == index && line.length() != 0 ) ...
java
private static void processLinesOfEnvironmentVariables( BufferedReader reader, Properties properties ) throws IOException { String line = reader.readLine(); while( null != line ) { int index = line.indexOf( '=' ); if( -1 == index && line.length() != 0 ) ...
[ "private", "static", "void", "processLinesOfEnvironmentVariables", "(", "BufferedReader", "reader", ",", "Properties", "properties", ")", "throws", "IOException", "{", "String", "line", "=", "reader", ".", "readLine", "(", ")", ";", "while", "(", "null", "!=", "...
Process the lines of the environment variables returned. @param reader The Reader that containes the lines to be parsed. @param properties The Properties objects to be populated with the environment variable names and values. @throws IOException if an underlying I/O problem occurs.
[ "Process", "the", "lines", "of", "the", "environment", "variables", "returned", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L559-L580
104,456
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.startProcess
private static Process startProcess( String[] exec ) throws IOException { Process process = Runtime.getRuntime().exec( exec ); return process; }
java
private static Process startProcess( String[] exec ) throws IOException { Process process = Runtime.getRuntime().exec( exec ); return process; }
[ "private", "static", "Process", "startProcess", "(", "String", "[", "]", "exec", ")", "throws", "IOException", "{", "Process", "process", "=", "Runtime", ".", "getRuntime", "(", ")", ".", "exec", "(", "exec", ")", ";", "return", "process", ";", "}" ]
Starts a OS level process. @param exec The commandline arguments, including the process to be started. @return The Process instance. @throws IOException if an underlying I/O exception occurs.
[ "Starts", "a", "OS", "level", "process", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L591-L596
104,457
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.createReader
private static BufferedReader createReader( Process process ) { InputStream inputStream = process.getInputStream(); InputStreamReader in = new InputStreamReader( inputStream ); BufferedReader reader = new BufferedReader( in ); return reader; }
java
private static BufferedReader createReader( Process process ) { InputStream inputStream = process.getInputStream(); InputStreamReader in = new InputStreamReader( inputStream ); BufferedReader reader = new BufferedReader( in ); return reader; }
[ "private", "static", "BufferedReader", "createReader", "(", "Process", "process", ")", "{", "InputStream", "inputStream", "=", "process", ".", "getInputStream", "(", ")", ";", "InputStreamReader", "in", "=", "new", "InputStreamReader", "(", "inputStream", ")", ";"...
Creates a Reader instance for the process output. @param process The process to attach the reader to. @return A Reader attached to the process.
[ "Creates", "a", "Reader", "instance", "for", "the", "process", "output", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L605-L611
104,458
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java
Environment.readEnvironment
private static int readEnvironment( String cmdExec, Properties properties ) { // fire up the shell and get echo'd results on stdout BufferedReader reader = null; Process process = null; int exitValue = 99; try { String[] args = new String[]{ cmdExec }; ...
java
private static int readEnvironment( String cmdExec, Properties properties ) { // fire up the shell and get echo'd results on stdout BufferedReader reader = null; Process process = null; int exitValue = 99; try { String[] args = new String[]{ cmdExec }; ...
[ "private", "static", "int", "readEnvironment", "(", "String", "cmdExec", ",", "Properties", "properties", ")", "{", "// fire up the shell and get echo'd results on stdout", "BufferedReader", "reader", "=", "null", ";", "Process", "process", "=", "null", ";", "int", "e...
Reads the environment variables and stores them in a Properties object. @param cmdExec The command to execute to get hold of the environment variables. @param properties The Properties object to be populated with the environment variables. @return The exit value of the OS level process upon its termination.
[ "Reads", "the", "environment", "variables", "and", "stores", "them", "in", "a", "Properties", "object", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/Environment.java#L621-L654
104,459
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesWriter.java
PropertiesWriter.append
public PropertiesWriter append( final String key, final String value ) { NullArgumentException.validateNotEmpty( key, "Key" ); String valueToAdd = value; if( value == null ) { valueToAdd = ""; } Integer position = m_positions.get( key ); List<Strin...
java
public PropertiesWriter append( final String key, final String value ) { NullArgumentException.validateNotEmpty( key, "Key" ); String valueToAdd = value; if( value == null ) { valueToAdd = ""; } Integer position = m_positions.get( key ); List<Strin...
[ "public", "PropertiesWriter", "append", "(", "final", "String", "key", ",", "final", "String", "value", ")", "{", "NullArgumentException", ".", "validateNotEmpty", "(", "key", ",", "\"Key\"", ")", ";", "String", "valueToAdd", "=", "value", ";", "if", "(", "v...
Appends a property to be written. @param key key of property @param value value of property @return self for a fluent api @throws NullArgumentException if key is null or empty
[ "Appends", "a", "property", "to", "be", "written", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesWriter.java#L103-L148
104,460
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesWriter.java
PropertiesWriter.append
public PropertiesWriter append( final String comment ) { String commentToAdd = "#" + comment; if( comment == null ) { commentToAdd = "#"; } m_content.add( commentToAdd ); return this; }
java
public PropertiesWriter append( final String comment ) { String commentToAdd = "#" + comment; if( comment == null ) { commentToAdd = "#"; } m_content.add( commentToAdd ); return this; }
[ "public", "PropertiesWriter", "append", "(", "final", "String", "comment", ")", "{", "String", "commentToAdd", "=", "\"#\"", "+", "comment", ";", "if", "(", "comment", "==", "null", ")", "{", "commentToAdd", "=", "\"#\"", ";", "}", "m_content", ".", "add",...
Appends a comment to be written. @param comment The comment to add to the Properties file. @return self for a fluent api
[ "Appends", "a", "comment", "to", "be", "written", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesWriter.java#L157-L166
104,461
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesWriter.java
PropertiesWriter.write
public void write() throws IOException { BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( m_outputStream ) ); for( String line : m_content ) { writer.write( line ); writer.newLine(); } writer.flush(); writer.close(); ...
java
public void write() throws IOException { BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( m_outputStream ) ); for( String line : m_content ) { writer.write( line ); writer.newLine(); } writer.flush(); writer.close(); ...
[ "public", "void", "write", "(", ")", "throws", "IOException", "{", "BufferedWriter", "writer", "=", "new", "BufferedWriter", "(", "new", "OutputStreamWriter", "(", "m_outputStream", ")", ")", ";", "for", "(", "String", "line", ":", "m_content", ")", "{", "wr...
Write properties to output stream. @throws java.io.IOException re-thrown from output stream
[ "Write", "properties", "to", "output", "stream", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertiesWriter.java#L200-L211
104,462
ops4j/org.ops4j.base
ops4j-base-monitors/src/main/java/org/ops4j/monitors/exception/ExceptionMonitorRouter.java
ExceptionMonitorRouter.exception
public void exception( ExceptionSource source, Throwable exception ) { synchronized( m_monitors ) { for( ExceptionMonitor monitor : m_monitors ) { monitor.exception( source, exception ); } } }
java
public void exception( ExceptionSource source, Throwable exception ) { synchronized( m_monitors ) { for( ExceptionMonitor monitor : m_monitors ) { monitor.exception( source, exception ); } } }
[ "public", "void", "exception", "(", "ExceptionSource", "source", ",", "Throwable", "exception", ")", "{", "synchronized", "(", "m_monitors", ")", "{", "for", "(", "ExceptionMonitor", "monitor", ":", "m_monitors", ")", "{", "monitor", ".", "exception", "(", "so...
This method is called when an Exception or Throwable occurs. @param source The source of the Exception. @param exception The Exception being thrown.
[ "This", "method", "is", "called", "when", "an", "Exception", "or", "Throwable", "occurs", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-monitors/src/main/java/org/ops4j/monitors/exception/ExceptionMonitorRouter.java#L58-L67
104,463
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/DirectoryLister.java
DirectoryLister.matchesIncludes
private boolean matchesIncludes( final String fileName ) { if( m_includes.length == 0 ) { return true; } for( Pattern include : m_includes ) { if( include.matcher( fileName ).matches() ) { return true; } ...
java
private boolean matchesIncludes( final String fileName ) { if( m_includes.length == 0 ) { return true; } for( Pattern include : m_includes ) { if( include.matcher( fileName ).matches() ) { return true; } ...
[ "private", "boolean", "matchesIncludes", "(", "final", "String", "fileName", ")", "{", "if", "(", "m_includes", ".", "length", "==", "0", ")", "{", "return", "true", ";", "}", "for", "(", "Pattern", "include", ":", "m_includes", ")", "{", "if", "(", "i...
Checks if the file name matches inclusion patterns. @param fileName file name to be matched @return true if matches, false otherwise
[ "Checks", "if", "the", "file", "name", "matches", "inclusion", "patterns", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/DirectoryLister.java#L118-L132
104,464
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/DirectoryLister.java
DirectoryLister.matchesExcludes
private boolean matchesExcludes( final String fileName ) { for( Pattern include : m_excludes ) { if( include.matcher( fileName ).matches() ) { return true; } } return false; }
java
private boolean matchesExcludes( final String fileName ) { for( Pattern include : m_excludes ) { if( include.matcher( fileName ).matches() ) { return true; } } return false; }
[ "private", "boolean", "matchesExcludes", "(", "final", "String", "fileName", ")", "{", "for", "(", "Pattern", "include", ":", "m_excludes", ")", "{", "if", "(", "include", ".", "matcher", "(", "fileName", ")", ".", "matches", "(", ")", ")", "{", "return"...
Checks if the file name matches exclusion patterns. @param fileName file name to be matched @return true if matches, false otherwise
[ "Checks", "if", "the", "file", "name", "matches", "exclusion", "patterns", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/DirectoryLister.java#L141-L151
104,465
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/DirectoryLister.java
DirectoryLister.listFiles
private List<String> listFiles( final File dir, final String parentName ) { final List<String> fileNames = new ArrayList<String>(); File[] files = null; if( dir.canRead() ) { files = dir.listFiles(); } if( files != null ) { for( File fi...
java
private List<String> listFiles( final File dir, final String parentName ) { final List<String> fileNames = new ArrayList<String>(); File[] files = null; if( dir.canRead() ) { files = dir.listFiles(); } if( files != null ) { for( File fi...
[ "private", "List", "<", "String", ">", "listFiles", "(", "final", "File", "dir", ",", "final", "String", "parentName", ")", "{", "final", "List", "<", "String", ">", "fileNames", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "File", "[", ...
Lists recursively files form a directory @param dir the directory to list @param parentName name of the parent; to be used in construction the relative path of the returned files @return a list foi files from the dir and any sub-folders
[ "Lists", "recursively", "files", "form", "a", "directory" ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/DirectoryLister.java#L161-L184
104,466
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java
Resources.getString
public String getString( String key ) throws MissingResourceException { ResourceBundle bundle = getBundle(); return bundle.getString( key ); }
java
public String getString( String key ) throws MissingResourceException { ResourceBundle bundle = getBundle(); return bundle.getString( key ); }
[ "public", "String", "getString", "(", "String", "key", ")", "throws", "MissingResourceException", "{", "ResourceBundle", "bundle", "=", "getBundle", "(", ")", ";", "return", "bundle", ".", "getString", "(", "key", ")", ";", "}" ]
Retrieve a raw string from bundle. @param key the key of resource @return the resource string @throws MissingResourceException if the requested key is unknown
[ "Retrieve", "a", "raw", "string", "from", "bundle", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L682-L687
104,467
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java
Resources.getBundle
public ResourceBundle getBundle() throws MissingResourceException { if( null == m_bundle ) { // bundle wasn't cached, so load it, cache it, and return it. ClassLoader classLoader = m_classLoader; if( null == classLoader ) { clas...
java
public ResourceBundle getBundle() throws MissingResourceException { if( null == m_bundle ) { // bundle wasn't cached, so load it, cache it, and return it. ClassLoader classLoader = m_classLoader; if( null == classLoader ) { clas...
[ "public", "ResourceBundle", "getBundle", "(", ")", "throws", "MissingResourceException", "{", "if", "(", "null", "==", "m_bundle", ")", "{", "// bundle wasn't cached, so load it, cache it, and return it.", "ClassLoader", "classLoader", "=", "m_classLoader", ";", "if", "("...
Retrieve underlying ResourceBundle. If bundle has not been loaded it will be loaded by this method. Access is given in case other resources need to be extracted that this Manager does not provide simplified access to. @return the ResourceBundle @throws MissingResourceException if an error occurs
[ "Retrieve", "underlying", "ResourceBundle", ".", "If", "bundle", "has", "not", "been", "loaded", "it", "will", "be", "loaded", "by", "this", "method", ".", "Access", "is", "given", "in", "case", "other", "resources", "need", "to", "be", "extracted", "that", ...
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L893-L914
104,468
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java
Resources.getPatternString
private String getPatternString( String key ) throws MissingResourceException { ResourceBundle bundle = getBundle(); Object object = bundle.getObject( key ); // is the resource a single string if( object instanceof String ) { return (String) object; ...
java
private String getPatternString( String key ) throws MissingResourceException { ResourceBundle bundle = getBundle(); Object object = bundle.getObject( key ); // is the resource a single string if( object instanceof String ) { return (String) object; ...
[ "private", "String", "getPatternString", "(", "String", "key", ")", "throws", "MissingResourceException", "{", "ResourceBundle", "bundle", "=", "getBundle", "(", ")", ";", "Object", "object", "=", "bundle", ".", "getObject", "(", "key", ")", ";", "// is the reso...
Utility method to retrieve a string from ResourceBundle. If the key is a single string then that will be returned. If key refers to string array then a random string will be chosen. Other types cause an exception. @param key the key to resource @return the string resource @throws MissingResourceException if an error...
[ "Utility", "method", "to", "retrieve", "a", "string", "from", "ResourceBundle", ".", "If", "the", "key", "is", "a", "single", "string", "then", "that", "will", "be", "returned", ".", "If", "key", "refers", "to", "string", "array", "then", "a", "random", ...
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L928-L952
104,469
ops4j/org.ops4j.base
ops4j-base-store/src/main/java/org/ops4j/store/StoreFactory.java
StoreFactory.anonymousStore
public static Store<InputStream> anonymousStore() throws IOException { File temp = File.createTempFile( "ops4j-store-anonymous-", "" ); temp.delete(); temp.mkdir(); return new TemporaryStore( temp, true ); }
java
public static Store<InputStream> anonymousStore() throws IOException { File temp = File.createTempFile( "ops4j-store-anonymous-", "" ); temp.delete(); temp.mkdir(); return new TemporaryStore( temp, true ); }
[ "public", "static", "Store", "<", "InputStream", ">", "anonymousStore", "(", ")", "throws", "IOException", "{", "File", "temp", "=", "File", ".", "createTempFile", "(", "\"ops4j-store-anonymous-\"", ",", "\"\"", ")", ";", "temp", ".", "delete", "(", ")", ";"...
If the store must be unique, here is it. @return unique storage @throws java.io.IOException in case no temp folder has been found.
[ "If", "the", "store", "must", "be", "unique", "here", "is", "it", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-store/src/main/java/org/ops4j/store/StoreFactory.java#L97-L104
104,470
ops4j/org.ops4j.base
ops4j-base-spi/src/main/java/org/ops4j/spi/SafeServiceLoader.java
SafeServiceLoader.loadClassIfVisible
@SuppressWarnings( "unchecked" ) private <T> Class<T> loadClassIfVisible( String className, ClassLoader classLoader ) { try { Class<T> klass = (Class<T>) classLoader.loadClass( className ); return klass; } catch ( ClassNotFoundException e ) { ...
java
@SuppressWarnings( "unchecked" ) private <T> Class<T> loadClassIfVisible( String className, ClassLoader classLoader ) { try { Class<T> klass = (Class<T>) classLoader.loadClass( className ); return klass; } catch ( ClassNotFoundException e ) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "T", ">", "Class", "<", "T", ">", "loadClassIfVisible", "(", "String", "className", ",", "ClassLoader", "classLoader", ")", "{", "try", "{", "Class", "<", "T", ">", "klass", "=", "(", "C...
Loads a class with the given name from the given class loader. @param className fully qualified class name @param classLoader class loader @return class with given name, or null
[ "Loads", "a", "class", "with", "the", "given", "name", "from", "the", "given", "class", "loader", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-spi/src/main/java/org/ops4j/spi/SafeServiceLoader.java#L106-L118
104,471
ops4j/org.ops4j.base
ops4j-base-net/src/main/java/org/ops4j/net/URLUtils.java
URLUtils.prepareInputStream
public static InputStream prepareInputStream( final URL url, final boolean acceptAnyCertificate ) throws IOException { final URLConnection conn = url.openConnection(); prepareForAuthentication( conn ); prepareHttpHeaders( conn ); if( acceptAnyCertificate ) { ...
java
public static InputStream prepareInputStream( final URL url, final boolean acceptAnyCertificate ) throws IOException { final URLConnection conn = url.openConnection(); prepareForAuthentication( conn ); prepareHttpHeaders( conn ); if( acceptAnyCertificate ) { ...
[ "public", "static", "InputStream", "prepareInputStream", "(", "final", "URL", "url", ",", "final", "boolean", "acceptAnyCertificate", ")", "throws", "IOException", "{", "final", "URLConnection", "conn", "=", "url", ".", "openConnection", "(", ")", ";", "prepareFor...
Prepare url for authentication and ssl if necessary and returns the input stream from the url. @param url url to prepare @param acceptAnyCertificate true if the certicate check should be skipped @return input stream from url @throws IOException re-thrown
[ "Prepare", "url", "for", "authentication", "and", "ssl", "if", "necessary", "and", "returns", "the", "input", "stream", "from", "the", "url", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-net/src/main/java/org/ops4j/net/URLUtils.java#L170-L181
104,472
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java
NullArgumentException.validateNotEmpty
public static void validateNotEmpty( String stringToCheck, String argumentName ) throws NullArgumentException { validateNotEmpty( stringToCheck, false, argumentName ); }
java
public static void validateNotEmpty( String stringToCheck, String argumentName ) throws NullArgumentException { validateNotEmpty( stringToCheck, false, argumentName ); }
[ "public", "static", "void", "validateNotEmpty", "(", "String", "stringToCheck", ",", "String", "argumentName", ")", "throws", "NullArgumentException", "{", "validateNotEmpty", "(", "stringToCheck", ",", "false", ",", "argumentName", ")", ";", "}" ]
Validates that the string is not null and not an empty string without trimming the string. @param stringToCheck The object to be tested. @param argumentName The name of the object, which is used to construct the exception message. @throws NullArgumentException if the stringToCheck is either null or zero characters l...
[ "Validates", "that", "the", "string", "is", "not", "null", "and", "not", "an", "empty", "string", "without", "trimming", "the", "string", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java#L87-L91
104,473
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java
NullArgumentException.validateNotEmpty
public static void validateNotEmpty( String stringToCheck, boolean trim, String argumentName ) throws NullArgumentException { validateNotNull( stringToCheck, argumentName ); if( stringToCheck.length() == 0 || ( trim && stringToCheck.trim().length() == 0 ) ) { ...
java
public static void validateNotEmpty( String stringToCheck, boolean trim, String argumentName ) throws NullArgumentException { validateNotNull( stringToCheck, argumentName ); if( stringToCheck.length() == 0 || ( trim && stringToCheck.trim().length() == 0 ) ) { ...
[ "public", "static", "void", "validateNotEmpty", "(", "String", "stringToCheck", ",", "boolean", "trim", ",", "String", "argumentName", ")", "throws", "NullArgumentException", "{", "validateNotNull", "(", "stringToCheck", ",", "argumentName", ")", ";", "if", "(", "...
Validates that the string is not null and not an empty string. @param stringToCheck The object to be tested. @param trim If the elements should be trimmed before checking if empty @param argumentName The name of the object, which is used to construct the exception message. @throws NullArgumentException if t...
[ "Validates", "that", "the", "string", "is", "not", "null", "and", "not", "an", "empty", "string", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java#L102-L111
104,474
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java
NullArgumentException.validateNotEmpty
public static void validateNotEmpty( Properties propertiesToCheck, String argumentName ) throws NullArgumentException { validateNotNull( propertiesToCheck, argumentName ); if( propertiesToCheck.isEmpty() ) { throw new NullArgumentException( argumentName + IS_EMPTY ); ...
java
public static void validateNotEmpty( Properties propertiesToCheck, String argumentName ) throws NullArgumentException { validateNotNull( propertiesToCheck, argumentName ); if( propertiesToCheck.isEmpty() ) { throw new NullArgumentException( argumentName + IS_EMPTY ); ...
[ "public", "static", "void", "validateNotEmpty", "(", "Properties", "propertiesToCheck", ",", "String", "argumentName", ")", "throws", "NullArgumentException", "{", "validateNotNull", "(", "propertiesToCheck", ",", "argumentName", ")", ";", "if", "(", "propertiesToCheck"...
Validates that the Properties instance is not null and that it has entries. @param propertiesToCheck The object to be tested. @param argumentName The name of the object, which is used to construct the exception message. @throws NullArgumentException if the Properties instance is null or does not have any entries...
[ "Validates", "that", "the", "Properties", "instance", "is", "not", "null", "and", "that", "it", "has", "entries", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java#L121-L129
104,475
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java
NullArgumentException.validateNotEmpty
public static void validateNotEmpty( Object[] arrayToCheck, String argumentName ) throws NullArgumentException { validateNotNull( arrayToCheck, argumentName ); if( arrayToCheck.length == 0 ) { throw new NullArgumentException( argumentName + IS_EMPTY ); } }
java
public static void validateNotEmpty( Object[] arrayToCheck, String argumentName ) throws NullArgumentException { validateNotNull( arrayToCheck, argumentName ); if( arrayToCheck.length == 0 ) { throw new NullArgumentException( argumentName + IS_EMPTY ); } }
[ "public", "static", "void", "validateNotEmpty", "(", "Object", "[", "]", "arrayToCheck", ",", "String", "argumentName", ")", "throws", "NullArgumentException", "{", "validateNotNull", "(", "arrayToCheck", ",", "argumentName", ")", ";", "if", "(", "arrayToCheck", "...
Validates that the array instance is not null and that it has entries. @param arrayToCheck The object to be tested. @param argumentName The name of the object, which is used to construct the exception message. @throws NullArgumentException if the array instance is null or does not have any entries. @since 0.5.0, Janu...
[ "Validates", "that", "the", "array", "instance", "is", "not", "null", "and", "that", "it", "has", "entries", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java#L140-L148
104,476
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java
NullArgumentException.validateNotEmptyContent
public static void validateNotEmptyContent( String[] arrayToCheck, String argumentName ) throws NullArgumentException { validateNotEmptyContent( arrayToCheck, false, argumentName ); }
java
public static void validateNotEmptyContent( String[] arrayToCheck, String argumentName ) throws NullArgumentException { validateNotEmptyContent( arrayToCheck, false, argumentName ); }
[ "public", "static", "void", "validateNotEmptyContent", "(", "String", "[", "]", "arrayToCheck", ",", "String", "argumentName", ")", "throws", "NullArgumentException", "{", "validateNotEmptyContent", "(", "arrayToCheck", ",", "false", ",", "argumentName", ")", ";", "...
Validates that the string array instance is not null and that it has entries that are not null or empty eithout trimming the string. @param arrayToCheck The object to be tested. @param argumentName The name of the object, which is used to construct the exception message. @throws NullArgumentException if the array ins...
[ "Validates", "that", "the", "string", "array", "instance", "is", "not", "null", "and", "that", "it", "has", "entries", "that", "are", "not", "null", "or", "empty", "eithout", "trimming", "the", "string", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java#L160-L164
104,477
ops4j/org.ops4j.base
ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java
NullArgumentException.validateNotEmptyContent
public static void validateNotEmptyContent( String[] arrayToCheck, boolean trim, String argumentName ) throws NullArgumentException { validateNotEmpty( arrayToCheck, argumentName ); for( int i = 0; i < arrayToCheck.length; i++ ) { validateNotEmpty( arrayToCheck[ i ], arra...
java
public static void validateNotEmptyContent( String[] arrayToCheck, boolean trim, String argumentName ) throws NullArgumentException { validateNotEmpty( arrayToCheck, argumentName ); for( int i = 0; i < arrayToCheck.length; i++ ) { validateNotEmpty( arrayToCheck[ i ], arra...
[ "public", "static", "void", "validateNotEmptyContent", "(", "String", "[", "]", "arrayToCheck", ",", "boolean", "trim", ",", "String", "argumentName", ")", "throws", "NullArgumentException", "{", "validateNotEmpty", "(", "arrayToCheck", ",", "argumentName", ")", ";"...
Validates that the string array instance is not null and that it has entries that are not null or empty. @param arrayToCheck The object to be tested. @param trim If the elements should be trimmed before checking if empty @param argumentName The name of the object, which is used to construct the exception messa...
[ "Validates", "that", "the", "string", "array", "instance", "is", "not", "null", "and", "that", "it", "has", "entries", "that", "are", "not", "null", "or", "empty", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/NullArgumentException.java#L176-L188
104,478
ops4j/org.ops4j.base
ops4j-base-util-property/src/main/java/org/ops4j/util/property/PropertyStore.java
PropertyStore.get
@SuppressWarnings( "unchecked" ) public <T> T get( final String propertyName ) { return (T) m_properties.get( propertyName ); }
java
@SuppressWarnings( "unchecked" ) public <T> T get( final String propertyName ) { return (T) m_properties.get( propertyName ); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "get", "(", "final", "String", "propertyName", ")", "{", "return", "(", "T", ")", "m_properties", ".", "get", "(", "propertyName", ")", ";", "}" ]
Returns the property by name. @param propertyName name of the property @return property value
[ "Returns", "the", "property", "by", "name", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-property/src/main/java/org/ops4j/util/property/PropertyStore.java#L78-L82
104,479
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java
ZipExploder.getEntries
protected Map<String, ZipEntry> getEntries(ZipFile zf) { Enumeration<?> e = zf.entries(); Map<String, ZipEntry> m = new HashMap<String, ZipEntry>(); while (e.hasMoreElements()) { ZipEntry ze = (ZipEntry) e.nextElement(); m.put(ze.getName(), ze); } return m...
java
protected Map<String, ZipEntry> getEntries(ZipFile zf) { Enumeration<?> e = zf.entries(); Map<String, ZipEntry> m = new HashMap<String, ZipEntry>(); while (e.hasMoreElements()) { ZipEntry ze = (ZipEntry) e.nextElement(); m.put(ze.getName(), ze); } return m...
[ "protected", "Map", "<", "String", ",", "ZipEntry", ">", "getEntries", "(", "ZipFile", "zf", ")", "{", "Enumeration", "<", "?", ">", "e", "=", "zf", ".", "entries", "(", ")", ";", "Map", "<", "String", ",", "ZipEntry", ">", "m", "=", "new", "HashMa...
Get all the entries in a ZIP file.
[ "Get", "all", "the", "entries", "in", "a", "ZIP", "file", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L270-L278
104,480
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java
ZipExploder.printHelp
protected static void printHelp() { System.out.println(); System.out.println("Usage: java " + ZipExploder.class.getName() + " (-jar jarFilename... | -zip zipFilename...)... -dir destDir {-verbose}"); System.out.println("Where:"); System.out.println(" jarFilename path to source jar, may ...
java
protected static void printHelp() { System.out.println(); System.out.println("Usage: java " + ZipExploder.class.getName() + " (-jar jarFilename... | -zip zipFilename...)... -dir destDir {-verbose}"); System.out.println("Where:"); System.out.println(" jarFilename path to source jar, may ...
[ "protected", "static", "void", "printHelp", "(", ")", "{", "System", ".", "out", ".", "println", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"Usage: java \"", "+", "ZipExploder", ".", "class", ".", "getName", "(", ")", "+", "\" (-jar jarF...
Print command help text.
[ "Print", "command", "help", "text", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L338-L346
104,481
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java
ZipExploder.main
public static void main(final String[] args) { if (args.length == 0) { printHelp(); System.exit(0); } List<String> zipNames = new ArrayList<String>(); List<String> jarNames = new ArrayList<String>(); String destDir = null; boolean jarActive = false...
java
public static void main(final String[] args) { if (args.length == 0) { printHelp(); System.exit(0); } List<String> zipNames = new ArrayList<String>(); List<String> jarNames = new ArrayList<String>(); String destDir = null; boolean jarActive = false...
[ "public", "static", "void", "main", "(", "final", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "==", "0", ")", "{", "printHelp", "(", ")", ";", "System", ".", "exit", "(", "0", ")", ";", "}", "List", "<", "String", ">...
Main command line entry point. @param args
[ "Main", "command", "line", "entry", "point", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L359-L421
104,482
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/environment/EnvironmentException.java
EnvironmentException.getMessage
public String getMessage() { String base = super.getMessage(); if( null == base ) { return "Failed to access " + m_variable + " environment variable"; } return "Failed to access " + m_variable + " environment variable - " + base; }
java
public String getMessage() { String base = super.getMessage(); if( null == base ) { return "Failed to access " + m_variable + " environment variable"; } return "Failed to access " + m_variable + " environment variable - " + base; }
[ "public", "String", "getMessage", "(", ")", "{", "String", "base", "=", "super", ".", "getMessage", "(", ")", ";", "if", "(", "null", "==", "base", ")", "{", "return", "\"Failed to access \"", "+", "m_variable", "+", "\" environment variable\"", ";", "}", ...
Prepends variable name to the base message. @return the message of the Exception. @see java.lang.Throwable#getMessage()
[ "Prepends", "variable", "name", "to", "the", "base", "message", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/environment/EnvironmentException.java#L130-L140
104,483
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java
PrintStreamMonitor.notifyUpdate
public void notifyUpdate( URL resource, int expected, int count ) { if( m_first ) { m_expected = expected; m_start = System.currentTimeMillis(); m_first = false; } int completed = ( count * 100 ) / expected; m_out.print( resource.toExternal...
java
public void notifyUpdate( URL resource, int expected, int count ) { if( m_first ) { m_expected = expected; m_start = System.currentTimeMillis(); m_first = false; } int completed = ( count * 100 ) / expected; m_out.print( resource.toExternal...
[ "public", "void", "notifyUpdate", "(", "URL", "resource", ",", "int", "expected", ",", "int", "count", ")", "{", "if", "(", "m_first", ")", "{", "m_expected", "=", "expected", ";", "m_start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "m_fir...
Notify the monitor of the update in the download status. @param resource the name of the remote resource being downloaded. @param expected the expected number of bytes to be downloaded. @param count the number of bytes downloaded.
[ "Notify", "the", "monitor", "of", "the", "update", "in", "the", "download", "status", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java#L60-L70
104,484
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java
PrintStreamMonitor.notifyCompletion
public void notifyCompletion( URL resource ) { long now = System.currentTimeMillis(); long time = now - m_start; int kBps = (int) ( m_expected / time ); m_out.println( resource.toExternalForm() + " : " + kBps + " kBps. " ); }
java
public void notifyCompletion( URL resource ) { long now = System.currentTimeMillis(); long time = now - m_start; int kBps = (int) ( m_expected / time ); m_out.println( resource.toExternalForm() + " : " + kBps + " kBps. " ); }
[ "public", "void", "notifyCompletion", "(", "URL", "resource", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "time", "=", "now", "-", "m_start", ";", "int", "kBps", "=", "(", "int", ")", "(", "m_expected", "/",...
Notify the monitor of the successful completion of a download process. @param resource the name of the remote resource.
[ "Notify", "the", "monitor", "of", "the", "successful", "completion", "of", "a", "download", "process", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java#L78-L84
104,485
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java
PropertyResolver.processToken
private static void processToken( String token, Stack<String> stack, Properties props ) { if( "}".equals( token ) ) { String name = stack.pop(); String open = stack.pop(); if( "${".equals( open ) ) { startProperty( name, props, stack );...
java
private static void processToken( String token, Stack<String> stack, Properties props ) { if( "}".equals( token ) ) { String name = stack.pop(); String open = stack.pop(); if( "${".equals( open ) ) { startProperty( name, props, stack );...
[ "private", "static", "void", "processToken", "(", "String", "token", ",", "Stack", "<", "String", ">", "stack", ",", "Properties", "props", ")", "{", "if", "(", "\"}\"", ".", "equals", "(", "token", ")", ")", "{", "String", "name", "=", "stack", ".", ...
Process one token. @param token The token to process. @param stack The parser Stack. @param props The Properties to replace.
[ "Process", "one", "token", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java#L92-L118
104,486
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java
PropertyResolver.startProperty
private static void startProperty( String name, Properties props, Stack<String> stack ) { String propValue = System.getProperty( name ); if( propValue == null ) { propValue = props.getProperty( name ); } if( propValue == null ) { push( stack, "...
java
private static void startProperty( String name, Properties props, Stack<String> stack ) { String propValue = System.getProperty( name ); if( propValue == null ) { propValue = props.getProperty( name ); } if( propValue == null ) { push( stack, "...
[ "private", "static", "void", "startProperty", "(", "String", "name", ",", "Properties", "props", ",", "Stack", "<", "String", ">", "stack", ")", "{", "String", "propValue", "=", "System", ".", "getProperty", "(", "name", ")", ";", "if", "(", "propValue", ...
Starts a new property. @param name The name of the property. @param props The Properties we are exchanging with. @param stack The parsing stack.
[ "Starts", "a", "new", "property", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java#L127-L142
104,487
ops4j/org.ops4j.base
ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java
PropertyResolver.push
private static void push( Stack<String> stack, String value ) { if( stack.size() > 0 ) { String data = stack.pop(); if( "${".equals( data ) ) { stack.push( data ); stack.push( value ); } else { ...
java
private static void push( Stack<String> stack, String value ) { if( stack.size() > 0 ) { String data = stack.pop(); if( "${".equals( data ) ) { stack.push( data ); stack.push( value ); } else { ...
[ "private", "static", "void", "push", "(", "Stack", "<", "String", ">", "stack", ",", "String", "value", ")", "{", "if", "(", "stack", ".", "size", "(", ")", ">", "0", ")", "{", "String", "data", "=", "stack", ".", "pop", "(", ")", ";", "if", "(...
Pushes a value on a stack @param stack the stack @param value the value
[ "Pushes", "a", "value", "on", "a", "stack" ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java#L150-L169
104,488
ops4j/org.ops4j.base
ops4j-base-monitors/src/main/java/org/ops4j/monitors/stream/StreamMonitorRouter.java
StreamMonitorRouter.notifyUpdate
public void notifyUpdate( URL resource, int expected, int count ) { synchronized( m_Monitors ) { for( StreamMonitor monitor : m_Monitors ) { monitor.notifyUpdate( resource, expected, count ); } } }
java
public void notifyUpdate( URL resource, int expected, int count ) { synchronized( m_Monitors ) { for( StreamMonitor monitor : m_Monitors ) { monitor.notifyUpdate( resource, expected, count ); } } }
[ "public", "void", "notifyUpdate", "(", "URL", "resource", ",", "int", "expected", ",", "int", "count", ")", "{", "synchronized", "(", "m_Monitors", ")", "{", "for", "(", "StreamMonitor", "monitor", ":", "m_Monitors", ")", "{", "monitor", ".", "notifyUpdate",...
Notify all subscribing monitors of a updated event. @param resource the url of the updated resource @param expected the size in bytes of the download @param count the progress in bytes
[ "Notify", "all", "subscribing", "monitors", "of", "a", "updated", "event", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-monitors/src/main/java/org/ops4j/monitors/stream/StreamMonitorRouter.java#L54-L63
104,489
ops4j/org.ops4j.base
ops4j-base-monitors/src/main/java/org/ops4j/monitors/stream/StreamMonitorRouter.java
StreamMonitorRouter.notifyCompletion
public void notifyCompletion( URL resource ) { synchronized( m_Monitors ) { for( StreamMonitor monitor : m_Monitors ) { monitor.notifyCompletion( resource ); } } }
java
public void notifyCompletion( URL resource ) { synchronized( m_Monitors ) { for( StreamMonitor monitor : m_Monitors ) { monitor.notifyCompletion( resource ); } } }
[ "public", "void", "notifyCompletion", "(", "URL", "resource", ")", "{", "synchronized", "(", "m_Monitors", ")", "{", "for", "(", "StreamMonitor", "monitor", ":", "m_Monitors", ")", "{", "monitor", ".", "notifyCompletion", "(", "resource", ")", ";", "}", "}",...
Notify all subscribing monitors of a download completion event. @param resource the url of the downloaded resource
[ "Notify", "all", "subscribing", "monitors", "of", "a", "download", "completion", "event", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-monitors/src/main/java/org/ops4j/monitors/stream/StreamMonitorRouter.java#L70-L79
104,490
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java
StreamUtils.closeStreams
private static void closeStreams( InputStream src, OutputStream dest ) { try { src.close(); } catch( IOException e ) { e.printStackTrace(); } try { dest.close(); } catch( IOException e ) { ...
java
private static void closeStreams( InputStream src, OutputStream dest ) { try { src.close(); } catch( IOException e ) { e.printStackTrace(); } try { dest.close(); } catch( IOException e ) { ...
[ "private", "static", "void", "closeStreams", "(", "InputStream", "src", ",", "OutputStream", "dest", ")", "{", "try", "{", "src", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", ...
Closes the streams and reports Exceptions to System.err @param src The InputStream to close. @param dest The OutputStream to close.
[ "Closes", "the", "streams", "and", "reports", "Exceptions", "to", "System", ".", "err" ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L145-L164
104,491
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java
StreamUtils.compareStreams
public static boolean compareStreams( InputStream in1, InputStream in2 ) throws IOException { boolean moreOnIn1; do { int v1 = in1.read(); int v2 = in2.read(); if( v1 != v2 ) { return false; } mor...
java
public static boolean compareStreams( InputStream in1, InputStream in2 ) throws IOException { boolean moreOnIn1; do { int v1 = in1.read(); int v2 = in2.read(); if( v1 != v2 ) { return false; } mor...
[ "public", "static", "boolean", "compareStreams", "(", "InputStream", "in1", ",", "InputStream", "in2", ")", "throws", "IOException", "{", "boolean", "moreOnIn1", ";", "do", "{", "int", "v1", "=", "in1", ".", "read", "(", ")", ";", "int", "v2", "=", "in2"...
Compares if two streams are identical in their contents. @param in1 The first stream. @param in2 The second stream. @return true if both streams contains the same byte data, including having the same number of characters in them. @throws IOException If an underlying I/O problem occured.
[ "Compares", "if", "two", "streams", "are", "identical", "in", "their", "contents", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L176-L193
104,492
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java
StreamUtils.copyReaderToWriter
public static void copyReaderToWriter( Reader input, Writer output, boolean close ) throws IOException { try { BufferedReader in = bufferInput( input ); BufferedWriter out = bufferOutput( output ); int ch = in.read(); while( ch != -1 ) ...
java
public static void copyReaderToWriter( Reader input, Writer output, boolean close ) throws IOException { try { BufferedReader in = bufferInput( input ); BufferedWriter out = bufferOutput( output ); int ch = in.read(); while( ch != -1 ) ...
[ "public", "static", "void", "copyReaderToWriter", "(", "Reader", "input", ",", "Writer", "output", ",", "boolean", "close", ")", "throws", "IOException", "{", "try", "{", "BufferedReader", "in", "=", "bufferInput", "(", "input", ")", ";", "BufferedWriter", "ou...
Copies the Reader to the Writer. @param input The input characters. @param output The destination of the characters. @param close true if the reader and writer should be closed after the operation is completed. @throws IOException If an underlying I/O problem occured.
[ "Copies", "the", "Reader", "to", "the", "Writer", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L204-L228
104,493
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java
StreamUtils.bufferOutput
private static BufferedWriter bufferOutput( Writer writer ) { BufferedWriter out; if( writer instanceof BufferedWriter ) { out = (BufferedWriter) writer; } else { out = new BufferedWriter( writer ); } return out; }
java
private static BufferedWriter bufferOutput( Writer writer ) { BufferedWriter out; if( writer instanceof BufferedWriter ) { out = (BufferedWriter) writer; } else { out = new BufferedWriter( writer ); } return out; }
[ "private", "static", "BufferedWriter", "bufferOutput", "(", "Writer", "writer", ")", "{", "BufferedWriter", "out", ";", "if", "(", "writer", "instanceof", "BufferedWriter", ")", "{", "out", "=", "(", "BufferedWriter", ")", "writer", ";", "}", "else", "{", "o...
Wraps the Writer in a BufferedWriter, unless it already is a BufferedWriter. @param writer The Writer to check and possibly wrap. @return A BufferedWriter.
[ "Wraps", "the", "Writer", "in", "a", "BufferedWriter", "unless", "it", "already", "is", "a", "BufferedWriter", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L237-L249
104,494
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java
StreamUtils.bufferInput
private static BufferedReader bufferInput( Reader reader ) { BufferedReader in; if( reader instanceof BufferedReader ) { in = (BufferedReader) reader; } else { in = new BufferedReader( reader ); } return in; }
java
private static BufferedReader bufferInput( Reader reader ) { BufferedReader in; if( reader instanceof BufferedReader ) { in = (BufferedReader) reader; } else { in = new BufferedReader( reader ); } return in; }
[ "private", "static", "BufferedReader", "bufferInput", "(", "Reader", "reader", ")", "{", "BufferedReader", "in", ";", "if", "(", "reader", "instanceof", "BufferedReader", ")", "{", "in", "=", "(", "BufferedReader", ")", "reader", ";", "}", "else", "{", "in",...
Wraps the Reader in a BufferedReaderm unless it already is a BufferedReader. @param reader The Reader to check and possibly wrap. @return A BufferedReader.
[ "Wraps", "the", "Reader", "in", "a", "BufferedReaderm", "unless", "it", "already", "is", "a", "BufferedReader", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L258-L270
104,495
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java
StreamUtils.copyStreamToWriter
public static void copyStreamToWriter( InputStream in, Writer out, String encoding, boolean close ) throws IOException { InputStreamReader reader = new InputStreamReader( in, encoding ); copyReaderToWriter( reader, out, close ); }
java
public static void copyStreamToWriter( InputStream in, Writer out, String encoding, boolean close ) throws IOException { InputStreamReader reader = new InputStreamReader( in, encoding ); copyReaderToWriter( reader, out, close ); }
[ "public", "static", "void", "copyStreamToWriter", "(", "InputStream", "in", ",", "Writer", "out", ",", "String", "encoding", ",", "boolean", "close", ")", "throws", "IOException", "{", "InputStreamReader", "reader", "=", "new", "InputStreamReader", "(", "in", ",...
Copies an InputStream to a Writer. @param in The input byte stream of data. @param out The Writer to receive the streamed data as characters. @param encoding The encoding used in the byte stream. @param close true if the Reader and OutputStream should be closed after the completion. @throws IOException ...
[ "Copies", "an", "InputStream", "to", "a", "Writer", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L282-L287
104,496
ops4j/org.ops4j.base
ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java
StreamUtils.copyReaderToStream
public static void copyReaderToStream( Reader in, OutputStream out, String encoding, boolean close ) throws IOException { OutputStreamWriter writer = new OutputStreamWriter( out, encoding ); copyReaderToWriter( in, writer, close ); }
java
public static void copyReaderToStream( Reader in, OutputStream out, String encoding, boolean close ) throws IOException { OutputStreamWriter writer = new OutputStreamWriter( out, encoding ); copyReaderToWriter( in, writer, close ); }
[ "public", "static", "void", "copyReaderToStream", "(", "Reader", "in", ",", "OutputStream", "out", ",", "String", "encoding", ",", "boolean", "close", ")", "throws", "IOException", "{", "OutputStreamWriter", "writer", "=", "new", "OutputStreamWriter", "(", "out", ...
Copies the content of the Reader to the provided OutputStream using the provided encoding. @param in The character data to convert. @param out The OutputStream to send the data to. @param encoding The character encoding that should be used for the byte stream. @param close true if the Reader and OutputSt...
[ "Copies", "the", "content", "of", "the", "Reader", "to", "the", "provided", "OutputStream", "using", "the", "provided", "encoding", "." ]
b0e742c0d9511f6b19ca64da2ebaf30b7a47256a
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L299-L304
104,497
drallgood/jpasskit
jpasskit/src/main/java/de/brendamour/jpasskit/signing/PKSigningInformationUtil.java
PKSigningInformationUtil.loadSigningInformationFromPKCS12AndIntermediateCertificate
public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(InputStream keyStoreInputStream, String keyStorePassword, InputStream appleWWDRCAFileInputStream) throws IOException, CertificateException { KeyStore pkcs12KeyStore = loadPKCS12File(keyStoreInputStream, keyStoreP...
java
public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(InputStream keyStoreInputStream, String keyStorePassword, InputStream appleWWDRCAFileInputStream) throws IOException, CertificateException { KeyStore pkcs12KeyStore = loadPKCS12File(keyStoreInputStream, keyStoreP...
[ "public", "PKSigningInformation", "loadSigningInformationFromPKCS12AndIntermediateCertificate", "(", "InputStream", "keyStoreInputStream", ",", "String", "keyStorePassword", ",", "InputStream", "appleWWDRCAFileInputStream", ")", "throws", "IOException", ",", "CertificateException", ...
Load all signing information necessary for pass generation using two input streams for the key store and the Apple WWDRCA certificate. The caller is responsible for closing the stream after this method returns successfully or fails. @param keyStoreInputStream <code>InputStream</code> of the key store @param keyStoreP...
[ "Load", "all", "signing", "information", "necessary", "for", "pass", "generation", "using", "two", "input", "streams", "for", "the", "key", "store", "and", "the", "Apple", "WWDRCA", "certificate", "." ]
63bfa8abbdb85c2d7596c60eed41ed8e374cbd01
https://github.com/drallgood/jpasskit/blob/63bfa8abbdb85c2d7596c60eed41ed8e374cbd01/jpasskit/src/main/java/de/brendamour/jpasskit/signing/PKSigningInformationUtil.java#L97-L104
104,498
drallgood/jpasskit
jpasskit/src/main/java/de/brendamour/jpasskit/signing/PKSigningInformationUtil.java
PKSigningInformationUtil.loadPKCS12File
@Deprecated public KeyStore loadPKCS12File(InputStream inputStreamOfP12, String password) throws CertificateException, IOException { try { return CertUtils.toKeyStore(inputStreamOfP12, password.toCharArray()); } catch (IllegalStateException ex) { throw new IOException("Key fr...
java
@Deprecated public KeyStore loadPKCS12File(InputStream inputStreamOfP12, String password) throws CertificateException, IOException { try { return CertUtils.toKeyStore(inputStreamOfP12, password.toCharArray()); } catch (IllegalStateException ex) { throw new IOException("Key fr...
[ "@", "Deprecated", "public", "KeyStore", "loadPKCS12File", "(", "InputStream", "inputStreamOfP12", ",", "String", "password", ")", "throws", "CertificateException", ",", "IOException", "{", "try", "{", "return", "CertUtils", ".", "toKeyStore", "(", "inputStreamOfP12",...
Load the keystore from an already opened input stream. The caller is responsible for closing the stream after this method returns successfully or fails. @param inputStreamOfP12 <code>InputStream</code> containing the signing key store. @param password Password to access the key store @return Key store loaded from <co...
[ "Load", "the", "keystore", "from", "an", "already", "opened", "input", "stream", "." ]
63bfa8abbdb85c2d7596c60eed41ed8e374cbd01
https://github.com/drallgood/jpasskit/blob/63bfa8abbdb85c2d7596c60eed41ed8e374cbd01/jpasskit/src/main/java/de/brendamour/jpasskit/signing/PKSigningInformationUtil.java#L147-L154
104,499
drallgood/jpasskit
jpasskit/src/main/java/de/brendamour/jpasskit/signing/PKSigningInformationUtil.java
PKSigningInformationUtil.loadDERCertificate
@Deprecated public X509Certificate loadDERCertificate(String filePath) throws IOException, CertificateException { try (InputStream certificateInputStream = CertUtils.toInputStream(filePath)) { return loadDERCertificate(certificateInputStream); } }
java
@Deprecated public X509Certificate loadDERCertificate(String filePath) throws IOException, CertificateException { try (InputStream certificateInputStream = CertUtils.toInputStream(filePath)) { return loadDERCertificate(certificateInputStream); } }
[ "@", "Deprecated", "public", "X509Certificate", "loadDERCertificate", "(", "String", "filePath", ")", "throws", "IOException", ",", "CertificateException", "{", "try", "(", "InputStream", "certificateInputStream", "=", "CertUtils", ".", "toInputStream", "(", "filePath",...
Load certificate file in DER format from the filesystem or the classpath @param filePath Path to the file, containing the certificate. @return Loaded certificate. @throws IOException @throws CertificateException @deprecated
[ "Load", "certificate", "file", "in", "DER", "format", "from", "the", "filesystem", "or", "the", "classpath" ]
63bfa8abbdb85c2d7596c60eed41ed8e374cbd01
https://github.com/drallgood/jpasskit/blob/63bfa8abbdb85c2d7596c60eed41ed8e374cbd01/jpasskit/src/main/java/de/brendamour/jpasskit/signing/PKSigningInformationUtil.java#L166-L171