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
107,100
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryFieldUtil.java
BigQueryFieldUtil.validateNestedParameterizedType
public static void validateNestedParameterizedType(Type parameterType) { if (isParameterized(parameterType) || GenericArrayType.class.isAssignableFrom(parameterType.getClass())) { throw new IllegalArgumentException( "Invalid field. Cannot marshal fields of type Collection<GenericType> or Gen...
java
public static void validateNestedParameterizedType(Type parameterType) { if (isParameterized(parameterType) || GenericArrayType.class.isAssignableFrom(parameterType.getClass())) { throw new IllegalArgumentException( "Invalid field. Cannot marshal fields of type Collection<GenericType> or Gen...
[ "public", "static", "void", "validateNestedParameterizedType", "(", "Type", "parameterType", ")", "{", "if", "(", "isParameterized", "(", "parameterType", ")", "||", "GenericArrayType", ".", "class", ".", "isAssignableFrom", "(", "parameterType", ".", "getClass", "(...
Parameterized types nested more than one level cannot be determined at runtime. So cannot be marshalled.
[ "Parameterized", "types", "nested", "more", "than", "one", "level", "cannot", "be", "determined", "at", "runtime", ".", "So", "cannot", "be", "marshalled", "." ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryFieldUtil.java#L206-L212
107,101
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryFieldUtil.java
BigQueryFieldUtil.getParameterTypeOfRepeatedField
public static Class<?> getParameterTypeOfRepeatedField(Field field) { Class<?> componentType = null; if (isCollection(field.getType())) { validateCollection(field); Type parameterType = getParameterType((ParameterizedType) field.getGenericType()); validateNestedParameterizedType(parameterType)...
java
public static Class<?> getParameterTypeOfRepeatedField(Field field) { Class<?> componentType = null; if (isCollection(field.getType())) { validateCollection(field); Type parameterType = getParameterType((ParameterizedType) field.getGenericType()); validateNestedParameterizedType(parameterType)...
[ "public", "static", "Class", "<", "?", ">", "getParameterTypeOfRepeatedField", "(", "Field", "field", ")", "{", "Class", "<", "?", ">", "componentType", "=", "null", ";", "if", "(", "isCollection", "(", "field", ".", "getType", "(", ")", ")", ")", "{", ...
Returns type of the parameter or component type for the repeated field depending on whether it is a collection or an array.
[ "Returns", "type", "of", "the", "parameter", "or", "component", "type", "for", "the", "repeated", "field", "depending", "on", "whether", "it", "is", "a", "collection", "or", "an", "array", "." ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryFieldUtil.java#L218-L234
107,102
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryFieldUtil.java
BigQueryFieldUtil.isFieldRequired
static boolean isFieldRequired(Field field) { BigQueryDataField bqAnnotation = field.getAnnotation(BigQueryDataField.class); return (bqAnnotation != null && bqAnnotation.mode().equals(BigQueryFieldMode.REQUIRED)) || field.getType().isPrimitive(); }
java
static boolean isFieldRequired(Field field) { BigQueryDataField bqAnnotation = field.getAnnotation(BigQueryDataField.class); return (bqAnnotation != null && bqAnnotation.mode().equals(BigQueryFieldMode.REQUIRED)) || field.getType().isPrimitive(); }
[ "static", "boolean", "isFieldRequired", "(", "Field", "field", ")", "{", "BigQueryDataField", "bqAnnotation", "=", "field", ".", "getAnnotation", "(", "BigQueryDataField", ".", "class", ")", ";", "return", "(", "bqAnnotation", "!=", "null", "&&", "bqAnnotation", ...
Returns true if the field is annotated as a required bigquery field.
[ "Returns", "true", "if", "the", "field", "is", "annotated", "as", "a", "required", "bigquery", "field", "." ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/BigQueryFieldUtil.java#L248-L253
107,103
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/outputs/LevelDbOutputWriter.java
LevelDbOutputWriter.padAndWriteBlock
void padAndWriteBlock(boolean writeEmptyBlockIfFull) throws IOException { int remaining = writeBuffer.remaining(); if (writeEmptyBlockIfFull || remaining < blockSize) { writeBlanksToBuffer(remaining); writeBuffer.flip(); delegate.write(writeBuffer); writeBuffer.clear(); numBlocksWr...
java
void padAndWriteBlock(boolean writeEmptyBlockIfFull) throws IOException { int remaining = writeBuffer.remaining(); if (writeEmptyBlockIfFull || remaining < blockSize) { writeBlanksToBuffer(remaining); writeBuffer.flip(); delegate.write(writeBuffer); writeBuffer.clear(); numBlocksWr...
[ "void", "padAndWriteBlock", "(", "boolean", "writeEmptyBlockIfFull", ")", "throws", "IOException", "{", "int", "remaining", "=", "writeBuffer", ".", "remaining", "(", ")", ";", "if", "(", "writeEmptyBlockIfFull", "||", "remaining", "<", "blockSize", ")", "{", "w...
Adds padding to the stream until to the end of the block. @throws IOException
[ "Adds", "padding", "to", "the", "stream", "until", "to", "the", "end", "of", "the", "block", "." ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/LevelDbOutputWriter.java#L227-L236
107,104
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/impl/pipeline/DeleteFilesJob.java
DeleteFilesJob.run
@Override public Value<Void> run(List<GcsFilename> files) throws Exception { for (GcsFilename file : files) { try { gcs.delete(file); } catch (RetriesExhaustedException | IOException e) { log.log(Level.WARNING, "Failed to cleanup file: " + file, e); } } return null; }
java
@Override public Value<Void> run(List<GcsFilename> files) throws Exception { for (GcsFilename file : files) { try { gcs.delete(file); } catch (RetriesExhaustedException | IOException e) { log.log(Level.WARNING, "Failed to cleanup file: " + file, e); } } return null; }
[ "@", "Override", "public", "Value", "<", "Void", ">", "run", "(", "List", "<", "GcsFilename", ">", "files", ")", "throws", "Exception", "{", "for", "(", "GcsFilename", "file", ":", "files", ")", "{", "try", "{", "gcs", ".", "delete", "(", "file", ")"...
Deletes the files in the provided GoogleCloudStorageFileSet
[ "Deletes", "the", "files", "in", "the", "provided", "GoogleCloudStorageFileSet" ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/pipeline/DeleteFilesJob.java#L29-L39
107,105
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/impl/util/Crc32c.java
Crc32c.update
@Override public void update(int b) { long newCrc = crc ^ LONG_MASK; newCrc = updateByte((byte) b, newCrc); crc = newCrc ^ LONG_MASK; }
java
@Override public void update(int b) { long newCrc = crc ^ LONG_MASK; newCrc = updateByte((byte) b, newCrc); crc = newCrc ^ LONG_MASK; }
[ "@", "Override", "public", "void", "update", "(", "int", "b", ")", "{", "long", "newCrc", "=", "crc", "^", "LONG_MASK", ";", "newCrc", "=", "updateByte", "(", "(", "byte", ")", "b", ",", "newCrc", ")", ";", "crc", "=", "newCrc", "^", "LONG_MASK", "...
Updates the checksum with a new byte. @param b the new byte.
[ "Updates", "the", "checksum", "with", "a", "new", "byte", "." ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/util/Crc32c.java#L92-L97
107,106
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/impl/util/Crc32c.java
Crc32c.update
@Override public void update(byte[] bArray, int off, int len) { long newCrc = crc ^ LONG_MASK; for (int i = off; i < off + len; i++) { newCrc = updateByte(bArray[i], newCrc); } crc = newCrc ^ LONG_MASK; }
java
@Override public void update(byte[] bArray, int off, int len) { long newCrc = crc ^ LONG_MASK; for (int i = off; i < off + len; i++) { newCrc = updateByte(bArray[i], newCrc); } crc = newCrc ^ LONG_MASK; }
[ "@", "Override", "public", "void", "update", "(", "byte", "[", "]", "bArray", ",", "int", "off", ",", "int", "len", ")", "{", "long", "newCrc", "=", "crc", "^", "LONG_MASK", ";", "for", "(", "int", "i", "=", "off", ";", "i", "<", "off", "+", "l...
Updates the checksum with an array of bytes. @param bArray the array of bytes. @param off the offset into the array where the update should begin. @param len the length of data to examine.
[ "Updates", "the", "checksum", "with", "an", "array", "of", "bytes", "." ]
2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/util/Crc32c.java#L105-L112
107,107
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/XMLUtils.java
XMLUtils.getFirstNode
public static Node getFirstNode(Document doc, String xPathExpression) { try { XPathFactory xPathfactory = XPathFactory.newInstance(); XPath xpath = xPathfactory.newXPath(); XPathExpression expr; expr = xpath.compile(xPathExpression); NodeList nl = (NodeList) expr.evaluate(doc, XPathConstants.NOD...
java
public static Node getFirstNode(Document doc, String xPathExpression) { try { XPathFactory xPathfactory = XPathFactory.newInstance(); XPath xpath = xPathfactory.newXPath(); XPathExpression expr; expr = xpath.compile(xPathExpression); NodeList nl = (NodeList) expr.evaluate(doc, XPathConstants.NOD...
[ "public", "static", "Node", "getFirstNode", "(", "Document", "doc", ",", "String", "xPathExpression", ")", "{", "try", "{", "XPathFactory", "xPathfactory", "=", "XPathFactory", ".", "newInstance", "(", ")", ";", "XPath", "xpath", "=", "xPathfactory", ".", "new...
Get first node on a Document doc, give a xpath Expression @param doc @param xPathExpression @return a Node or null if not found
[ "Get", "first", "node", "on", "a", "Document", "doc", "give", "a", "xpath", "Expression" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/XMLUtils.java#L29-L44
107,108
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
SoapParser.isSoapFault
private boolean isSoapFault(Document soapMessage) throws Exception { Element faultElement = DomUtils.getElementByTagNameNS(soapMessage, SOAP_12_NAMESPACE, "Fault"); if (faultElement != null) { return true; } else { faultElement = DomUtils.getElementByTagN...
java
private boolean isSoapFault(Document soapMessage) throws Exception { Element faultElement = DomUtils.getElementByTagNameNS(soapMessage, SOAP_12_NAMESPACE, "Fault"); if (faultElement != null) { return true; } else { faultElement = DomUtils.getElementByTagN...
[ "private", "boolean", "isSoapFault", "(", "Document", "soapMessage", ")", "throws", "Exception", "{", "Element", "faultElement", "=", "DomUtils", ".", "getElementByTagNameNS", "(", "soapMessage", ",", "SOAP_12_NAMESPACE", ",", "\"Fault\"", ")", ";", "if", "(", "fa...
A method to check if the message received is a SOAP fault. @param soapMessage the SOAP message to check. @author Simone Gianfranceschi
[ "A", "method", "to", "check", "if", "the", "message", "received", "is", "a", "SOAP", "fault", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java#L227-L241
107,109
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
SoapParser.parseSoapFault
private Document parseSoapFault(Document soapMessage, PrintWriter logger) throws Exception { String namespace = soapMessage.getDocumentElement().getNamespaceURI(); if (namespace.equals(SOAP_12_NAMESPACE)) { parseSoap12Fault(soapMessage, logger); } else /* if (namespace.e...
java
private Document parseSoapFault(Document soapMessage, PrintWriter logger) throws Exception { String namespace = soapMessage.getDocumentElement().getNamespaceURI(); if (namespace.equals(SOAP_12_NAMESPACE)) { parseSoap12Fault(soapMessage, logger); } else /* if (namespace.e...
[ "private", "Document", "parseSoapFault", "(", "Document", "soapMessage", ",", "PrintWriter", "logger", ")", "throws", "Exception", "{", "String", "namespace", "=", "soapMessage", ".", "getDocumentElement", "(", ")", ".", "getNamespaceURI", "(", ")", ";", "if", "...
A method to parse a SOAP fault. It checks the namespace and invoke the correct SOAP 1.1 or 1.2 Fault parser. @param soapMessage the SOAP fault message to parse @param logger the PrintWriter to log all results to @return the parsed document otherwise @author Simone Gianfranceschi
[ "A", "method", "to", "parse", "a", "SOAP", "fault", ".", "It", "checks", "the", "namespace", "and", "invoke", "the", "correct", "SOAP", "1", ".", "1", "or", "1", ".", "2", "Fault", "parser", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java#L257-L267
107,110
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
SoapParser.parseSoap11Fault
private void parseSoap11Fault(Document soapMessage, PrintWriter logger) throws Exception { Element envelope = soapMessage.getDocumentElement(); Element element = DomUtils.getElementByTagName(envelope, "faultcode"); if (element == null) { element = DomUtils.getElementByTag...
java
private void parseSoap11Fault(Document soapMessage, PrintWriter logger) throws Exception { Element envelope = soapMessage.getDocumentElement(); Element element = DomUtils.getElementByTagName(envelope, "faultcode"); if (element == null) { element = DomUtils.getElementByTag...
[ "private", "void", "parseSoap11Fault", "(", "Document", "soapMessage", ",", "PrintWriter", "logger", ")", "throws", "Exception", "{", "Element", "envelope", "=", "soapMessage", ".", "getDocumentElement", "(", ")", ";", "Element", "element", "=", "DomUtils", ".", ...
A method to parse a SOAP 1.1 fault message. @param soapMessage the SOAP 1.1 fault message to parse @param logger the PrintWriter to log all results to @return void @author Simone Gianfranceschi
[ "A", "method", "to", "parse", "a", "SOAP", "1", ".", "1", "fault", "message", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java#L282-L303
107,111
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java
SoapParser.parseSoap12Fault
private void parseSoap12Fault(Document soapMessage, PrintWriter logger) throws Exception { Element envelope = soapMessage.getDocumentElement(); Element code = DomUtils.getElementByTagNameNS(envelope, SOAP_12_NAMESPACE, "Code"); String value = DomUtils.getElementByTagN...
java
private void parseSoap12Fault(Document soapMessage, PrintWriter logger) throws Exception { Element envelope = soapMessage.getDocumentElement(); Element code = DomUtils.getElementByTagNameNS(envelope, SOAP_12_NAMESPACE, "Code"); String value = DomUtils.getElementByTagN...
[ "private", "void", "parseSoap12Fault", "(", "Document", "soapMessage", ",", "PrintWriter", "logger", ")", "throws", "Exception", "{", "Element", "envelope", "=", "soapMessage", ".", "getDocumentElement", "(", ")", ";", "Element", "code", "=", "DomUtils", ".", "g...
A method to parse a SOAP 1.2 fault message. @param soapMessage the SOAP 1.2 fault message to parse @param logger the PrintWriter to log all results to @return void @author Simone Gianfranceschi
[ "A", "method", "to", "parse", "a", "SOAP", "1", ".", "2", "fault", "message", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SoapParser.java#L318-L343
107,112
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/Generator.java
Generator.createEncodedName
public static String createEncodedName(File source) { String fileURI = source.toURI().toString(); String userDirURI = new File(System.getProperty("user.dir")).toURI() .toString(); fileURI = fileURI.replace(userDirURI, ""); String encodedName = fileURI.substring(fileU...
java
public static String createEncodedName(File source) { String fileURI = source.toURI().toString(); String userDirURI = new File(System.getProperty("user.dir")).toURI() .toString(); fileURI = fileURI.replace(userDirURI, ""); String encodedName = fileURI.substring(fileU...
[ "public", "static", "String", "createEncodedName", "(", "File", "source", ")", "{", "String", "fileURI", "=", "source", ".", "toURI", "(", ")", ".", "toString", "(", ")", ";", "String", "userDirURI", "=", "new", "File", "(", "System", ".", "getProperty", ...
Creates a directory name from a file path. @param source A File reference. @return A String representing a legal directory name.
[ "Creates", "a", "directory", "name", "from", "a", "file", "path", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/Generator.java#L248-L256
107,113
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java
SoapUtils.getSOAPMessage
public static Document getSOAPMessage(InputStream in) throws Exception { /* * ByteArrayOutputStream out = new ByteArrayOutputStream(); int b; while * ((b = in.read()) != -1) { out.write(b); } * * System.out.println("OUT:" + out.toString()); */ Documen...
java
public static Document getSOAPMessage(InputStream in) throws Exception { /* * ByteArrayOutputStream out = new ByteArrayOutputStream(); int b; while * ((b = in.read()) != -1) { out.write(b); } * * System.out.println("OUT:" + out.toString()); */ Documen...
[ "public", "static", "Document", "getSOAPMessage", "(", "InputStream", "in", ")", "throws", "Exception", "{", "/*\r\n * ByteArrayOutputStream out = new ByteArrayOutputStream(); int b; while\r\n * ((b = in.read()) != -1) { out.write(b); }\r\n * \r\n * System.out.p...
A method to get the SOAP message from the input stream. @param in the input stream to be used to get the SOAP message. @return the SOAP message @author Simone Gianfranceschi
[ "A", "method", "to", "get", "the", "SOAP", "message", "from", "the", "input", "stream", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java#L55-L75
107,114
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java
SoapUtils.getSoapBody
public static Document getSoapBody(Document soapMessage) throws Exception { Element envelope = soapMessage.getDocumentElement(); Element body = DomUtils.getChildElement(DomUtils.getElementByTagName( envelope, envelope.getPrefix() + ":Body")); Document content = DomUtils.creat...
java
public static Document getSoapBody(Document soapMessage) throws Exception { Element envelope = soapMessage.getDocumentElement(); Element body = DomUtils.getChildElement(DomUtils.getElementByTagName( envelope, envelope.getPrefix() + ":Body")); Document content = DomUtils.creat...
[ "public", "static", "Document", "getSoapBody", "(", "Document", "soapMessage", ")", "throws", "Exception", "{", "Element", "envelope", "=", "soapMessage", ".", "getDocumentElement", "(", ")", ";", "Element", "body", "=", "DomUtils", ".", "getChildElement", "(", ...
A method to extract the content of the SOAP body. @param soapMessage the SOAP message. @return the content of the body of the input SOAP message. @author Simone Gianfranceschi
[ "A", "method", "to", "extract", "the", "content", "of", "the", "SOAP", "body", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java#L87-L97
107,115
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java
SoapUtils.addNSdeclarations
public static void addNSdeclarations(Element source, Element target) throws Exception { NamedNodeMap sourceAttributes = source.getAttributes(); Attr attribute; String attributeName; for (int i = 0; i <= sourceAttributes.getLength() - 1; i++) { attribute = (A...
java
public static void addNSdeclarations(Element source, Element target) throws Exception { NamedNodeMap sourceAttributes = source.getAttributes(); Attr attribute; String attributeName; for (int i = 0; i <= sourceAttributes.getLength() - 1; i++) { attribute = (A...
[ "public", "static", "void", "addNSdeclarations", "(", "Element", "source", ",", "Element", "target", ")", "throws", "Exception", "{", "NamedNodeMap", "sourceAttributes", "=", "source", ".", "getAttributes", "(", ")", ";", "Attr", "attribute", ";", "String", "att...
A method to copy namespaces declarations. @param source the source message containing the namespaces to be copied on the target message. @param target the target message. @author Simone Gianfranceschi
[ "A", "method", "to", "copy", "namespaces", "declarations", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java#L110-L125
107,116
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java
SoapUtils.getSoapMessageAsByte
public static byte[] getSoapMessageAsByte(String version, List headerBlocks, Element body, String encoding) throws Exception { Document message = createSoapMessage(version, headerBlocks, body); ByteArrayOutputStream baos = new ByteArrayOutputStream(); TransformerFactory tf = Tr...
java
public static byte[] getSoapMessageAsByte(String version, List headerBlocks, Element body, String encoding) throws Exception { Document message = createSoapMessage(version, headerBlocks, body); ByteArrayOutputStream baos = new ByteArrayOutputStream(); TransformerFactory tf = Tr...
[ "public", "static", "byte", "[", "]", "getSoapMessageAsByte", "(", "String", "version", ",", "List", "headerBlocks", ",", "Element", "body", ",", "String", "encoding", ")", "throws", "Exception", "{", "Document", "message", "=", "createSoapMessage", "(", "versio...
A method to create a SOAP message and retrieve it as byte. @param version the SOAP version to be used (1.1 or 1.2). @param headerBlocks the list of Header Blocks to be included in the SOAP Header . @param body the XML message to be included in the SOAP BODY element. @param encoding the encoding to be used for the mess...
[ "A", "method", "to", "create", "a", "SOAP", "message", "and", "retrieve", "it", "as", "byte", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java#L143-L159
107,117
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java
SoapUtils.createSoapMessage
public static Document createSoapMessage(String version, List headerBlocks, Element body) throws Exception { Document message = null; NodeList children = body.getChildNodes(); // Loop in order to remove dummy nodes (spaces, CR) for (int i = 0; i < children.getLength(); i...
java
public static Document createSoapMessage(String version, List headerBlocks, Element body) throws Exception { Document message = null; NodeList children = body.getChildNodes(); // Loop in order to remove dummy nodes (spaces, CR) for (int i = 0; i < children.getLength(); i...
[ "public", "static", "Document", "createSoapMessage", "(", "String", "version", ",", "List", "headerBlocks", ",", "Element", "body", ")", "throws", "Exception", "{", "Document", "message", "=", "null", ";", "NodeList", "children", "=", "body", ".", "getChildNodes...
A method to create a SOAP message. The SOAP message, including the Header is created and returned as DOM Document. @param version the SOAP version to be used (1.1 or 1.2). @param headerBlocks the list of Header Blocks to be included in the SOAP Header . @param body the XML message to be included in the SOAP BODY eleme...
[ "A", "method", "to", "create", "a", "SOAP", "message", ".", "The", "SOAP", "message", "including", "the", "Header", "is", "created", "and", "returned", "as", "DOM", "Document", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/SoapUtils.java#L176-L198
107,118
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/StringUtils.java
StringUtils.getFilenameFromString
public static String getFilenameFromString(String filePath) { String newPath = filePath; int forwardInd = filePath.lastIndexOf("/"); int backInd = filePath.lastIndexOf("\\"); if (forwardInd > backInd) { newPath = filePath.substring(forwardInd + 1); } else { ...
java
public static String getFilenameFromString(String filePath) { String newPath = filePath; int forwardInd = filePath.lastIndexOf("/"); int backInd = filePath.lastIndexOf("\\"); if (forwardInd > backInd) { newPath = filePath.substring(forwardInd + 1); } else { ...
[ "public", "static", "String", "getFilenameFromString", "(", "String", "filePath", ")", "{", "String", "newPath", "=", "filePath", ";", "int", "forwardInd", "=", "filePath", ".", "lastIndexOf", "(", "\"/\"", ")", ";", "int", "backInd", "=", "filePath", ".", "...
Extracts the filename from a path. @param filePath the string to parse @return the path containing only the filename itself
[ "Extracts", "the", "filename", "from", "a", "path", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/StringUtils.java#L43-L57
107,119
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/StringUtils.java
StringUtils.replaceAll
public static String replaceAll(String str, String match, String replacement) { String newStr = str; int i = newStr.indexOf(match); while (i >= 0) { newStr = newStr.substring(0, i) + replacement + newStr.substring(i + match.length()); i = newStr....
java
public static String replaceAll(String str, String match, String replacement) { String newStr = str; int i = newStr.indexOf(match); while (i >= 0) { newStr = newStr.substring(0, i) + replacement + newStr.substring(i + match.length()); i = newStr....
[ "public", "static", "String", "replaceAll", "(", "String", "str", ",", "String", "match", ",", "String", "replacement", ")", "{", "String", "newStr", "=", "str", ";", "int", "i", "=", "newStr", ".", "indexOf", "(", "match", ")", ";", "while", "(", "i",...
Replaces all occurences of match in str with replacement
[ "Replaces", "all", "occurences", "of", "match", "in", "str", "with", "replacement" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/StringUtils.java#L60-L69
107,120
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/ZipParser.java
ZipParser.getMediaType
public static String getMediaType(String ext) { String mediaType = ""; // Find the media type value in the lookup table for (int i = 0; i < ApplicationMediaTypeMappings.length; i++) { if (ApplicationMediaTypeMappings[i][0].equals(ext.toLowerCase())) { mediaType...
java
public static String getMediaType(String ext) { String mediaType = ""; // Find the media type value in the lookup table for (int i = 0; i < ApplicationMediaTypeMappings.length; i++) { if (ApplicationMediaTypeMappings[i][0].equals(ext.toLowerCase())) { mediaType...
[ "public", "static", "String", "getMediaType", "(", "String", "ext", ")", "{", "String", "mediaType", "=", "\"\"", ";", "// Find the media type value in the lookup table\r", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ApplicationMediaTypeMappings", ".", "leng...
Returns the mime media type value for the given extension @param ext the filename extension to lookup @return String the mime type for the given extension
[ "Returns", "the", "mime", "media", "type", "value", "for", "the", "given", "extension" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/ZipParser.java#L71-L87
107,121
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java
MonitorServlet.createMonitor
static public String createMonitor(String monitorUrl, TECore core) { return createMonitor(monitorUrl, null, "", core); }
java
static public String createMonitor(String monitorUrl, TECore core) { return createMonitor(monitorUrl, null, "", core); }
[ "static", "public", "String", "createMonitor", "(", "String", "monitorUrl", ",", "TECore", "core", ")", "{", "return", "createMonitor", "(", "monitorUrl", ",", "null", ",", "\"\"", ",", "core", ")", ";", "}" ]
Monitor without parser that doesn't trigger a test
[ "Monitor", "without", "parser", "that", "doesn", "t", "trigger", "a", "test" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java#L85-L87
107,122
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java
MonitorServlet.createMonitor
static public String createMonitor(String monitorUrl, Node parserInstruction, String modifiesResponse, TECore core) { MonitorCall mc = monitors.get(monitorUrl); mc.setCore(core); if (parserInstruction != null) { mc.setParserInstruction(DomUtils.getElement(parserInstr...
java
static public String createMonitor(String monitorUrl, Node parserInstruction, String modifiesResponse, TECore core) { MonitorCall mc = monitors.get(monitorUrl); mc.setCore(core); if (parserInstruction != null) { mc.setParserInstruction(DomUtils.getElement(parserInstr...
[ "static", "public", "String", "createMonitor", "(", "String", "monitorUrl", ",", "Node", "parserInstruction", ",", "String", "modifiesResponse", ",", "TECore", "core", ")", "{", "MonitorCall", "mc", "=", "monitors", ".", "get", "(", "monitorUrl", ")", ";", "mc...
Monitor that doesn't trigger a test
[ "Monitor", "that", "doesn", "t", "trigger", "a", "test" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java#L90-L100
107,123
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java
MonitorServlet.createMonitor
static public String createMonitor(XPathContext context, String url, String localName, String namespaceURI, NodeInfo params, String callId, TECore core) throws Exception { return createMonitor(context, url, localName, namespaceURI, params, null, "", callId, core); ...
java
static public String createMonitor(XPathContext context, String url, String localName, String namespaceURI, NodeInfo params, String callId, TECore core) throws Exception { return createMonitor(context, url, localName, namespaceURI, params, null, "", callId, core); ...
[ "static", "public", "String", "createMonitor", "(", "XPathContext", "context", ",", "String", "url", ",", "String", "localName", ",", "String", "namespaceURI", ",", "NodeInfo", "params", ",", "String", "callId", ",", "TECore", "core", ")", "throws", "Exception",...
Monitor without parser that triggers a test
[ "Monitor", "without", "parser", "that", "triggers", "a", "test" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java#L103-L108
107,124
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java
MonitorServlet.createMonitor
static public String createMonitor(XPathContext context, String monitorUrl, String localName, String namespaceURI, NodeInfo params, NodeInfo parserInstruction, String modifiesResponse, String callId, TECore core) throws Exception { MonitorCall mc = monitors.get(monitorUrl...
java
static public String createMonitor(XPathContext context, String monitorUrl, String localName, String namespaceURI, NodeInfo params, NodeInfo parserInstruction, String modifiesResponse, String callId, TECore core) throws Exception { MonitorCall mc = monitors.get(monitorUrl...
[ "static", "public", "String", "createMonitor", "(", "XPathContext", "context", ",", "String", "monitorUrl", ",", "String", "localName", ",", "String", "namespaceURI", ",", "NodeInfo", "params", ",", "NodeInfo", "parserInstruction", ",", "String", "modifiesResponse", ...
Monitor that triggers a test
[ "Monitor", "that", "triggers", "a", "test" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/MonitorServlet.java#L111-L140
107,125
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/html/EarlToHtmlTransformation.java
EarlToHtmlTransformation.earlHtmlReport
public void earlHtmlReport( String outputDir ) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath(); String earlXsl = cl.getResource( "com/occamlab/te/earl_html_report.xsl" ).toString(); File htmlOu...
java
public void earlHtmlReport( String outputDir ) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath(); String earlXsl = cl.getResource( "com/occamlab/te/earl_html_report.xsl" ).toString(); File htmlOu...
[ "public", "void", "earlHtmlReport", "(", "String", "outputDir", ")", "{", "ClassLoader", "cl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "String", "resourceDir", "=", "cl", ".", "getResource", "(", "\"com/occam...
Transform EARL result into HTML report using XSLT. @param outputDir
[ "Transform", "EARL", "result", "into", "HTML", "report", "using", "XSLT", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/html/EarlToHtmlTransformation.java#L29-L57
107,126
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/SetupOptions.java
SetupOptions.recordingInfo
public static boolean recordingInfo(String testName) throws ParserConfigurationException, SAXException, IOException { TECore.rootTestName.clear(); String path = getBaseConfigDirectory() + "/config.xml"; if (new File(path).exists()) { // Fortify Mod: prevent external entity injection Doc...
java
public static boolean recordingInfo(String testName) throws ParserConfigurationException, SAXException, IOException { TECore.rootTestName.clear(); String path = getBaseConfigDirectory() + "/config.xml"; if (new File(path).exists()) { // Fortify Mod: prevent external entity injection Doc...
[ "public", "static", "boolean", "recordingInfo", "(", "String", "testName", ")", "throws", "ParserConfigurationException", ",", "SAXException", ",", "IOException", "{", "TECore", ".", "rootTestName", ".", "clear", "(", ")", ";", "String", "path", "=", "getBaseConfi...
Determine the test recording is on or off. @param testName @return @throws javax.xml.parsers.ParserConfigurationException @throws org.xml.sax.SAXException @throws java.io.IOException
[ "Determine", "the", "test", "recording", "is", "on", "or", "off", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/SetupOptions.java#L105-L138
107,127
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java
IOUtils.DocumentToInputStream
public static InputStream DocumentToInputStream(Document edoc) throws IOException { // Create the input and output for use in the transformation final org.w3c.dom.Document doc = edoc; final PipedOutputStream pos = new PipedOutputStream(); PipedInputStream pis = new Pip...
java
public static InputStream DocumentToInputStream(Document edoc) throws IOException { // Create the input and output for use in the transformation final org.w3c.dom.Document doc = edoc; final PipedOutputStream pos = new PipedOutputStream(); PipedInputStream pis = new Pip...
[ "public", "static", "InputStream", "DocumentToInputStream", "(", "Document", "edoc", ")", "throws", "IOException", "{", "// Create the input and output for use in the transformation\r", "final", "org", ".", "w3c", ".", "dom", ".", "Document", "doc", "=", "edoc", ";", ...
Converts an org.w3c.dom.Document element to an java.io.InputStream. @param edoc the org.w3c.dom.Document to be converted @return InputStream the InputStream value of the passed doument
[ "Converts", "an", "org", ".", "w3c", ".", "dom", ".", "Document", "element", "to", "an", "java", ".", "io", ".", "InputStream", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java#L51-L89
107,128
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java
IOUtils.inputStreamToString
public static String inputStreamToString(InputStream in) { StringBuffer buffer = new StringBuffer(); try { BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8"), 1024); String line; while ((line = br.readLine()) != null) {...
java
public static String inputStreamToString(InputStream in) { StringBuffer buffer = new StringBuffer(); try { BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8"), 1024); String line; while ((line = br.readLine()) != null) {...
[ "public", "static", "String", "inputStreamToString", "(", "InputStream", "in", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "try", "{", "BufferedReader", "br", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", ...
Reads the content of an input stream into a String value using the UTF-8 charset. @param in The InputStream from which the content is read. @return A String representing the content of the input stream; an empty string is returned if an error occurs.
[ "Reads", "the", "content", "of", "an", "input", "stream", "into", "a", "String", "value", "using", "the", "UTF", "-", "8", "charset", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java#L100-L113
107,129
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java
IOUtils.writeObjectToFile
public static boolean writeObjectToFile(Object obj, File f) { try { FileOutputStream fout = new FileOutputStream(f); ObjectOutputStream oos = new ObjectOutputStream(fout); oos.writeObject(obj); oos.close(); } catch (Exception e) { System...
java
public static boolean writeObjectToFile(Object obj, File f) { try { FileOutputStream fout = new FileOutputStream(f); ObjectOutputStream oos = new ObjectOutputStream(fout); oos.writeObject(obj); oos.close(); } catch (Exception e) { System...
[ "public", "static", "boolean", "writeObjectToFile", "(", "Object", "obj", ",", "File", "f", ")", "{", "try", "{", "FileOutputStream", "fout", "=", "new", "FileOutputStream", "(", "f", ")", ";", "ObjectOutputStream", "oos", "=", "new", "ObjectOutputStream", "("...
Writes a generic object to a file
[ "Writes", "a", "generic", "object", "to", "a", "file" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java#L137-L149
107,130
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java
IOUtils.readObjectFromFile
public static Object readObjectFromFile(File f) { Object obj = null; try { FileInputStream fin = new FileInputStream(f); ObjectInputStream ois = new ObjectInputStream(fin); obj = ois.readObject(); ois.close(); } catch (Exception e) { ...
java
public static Object readObjectFromFile(File f) { Object obj = null; try { FileInputStream fin = new FileInputStream(f); ObjectInputStream ois = new ObjectInputStream(fin); obj = ois.readObject(); ois.close(); } catch (Exception e) { ...
[ "public", "static", "Object", "readObjectFromFile", "(", "File", "f", ")", "{", "Object", "obj", "=", "null", ";", "try", "{", "FileInputStream", "fin", "=", "new", "FileInputStream", "(", "f", ")", ";", "ObjectInputStream", "ois", "=", "new", "ObjectInputSt...
Reads in a file that contains only an object
[ "Reads", "in", "a", "file", "that", "contains", "only", "an", "object" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java#L170-L183
107,131
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/Engine.java
Engine.preload
public void preload(Index index, String sourcesName) throws Exception { for (String key : index.getTestKeys()) { TestEntry te = index.getTest(key); loadExecutable(te, sourcesName); } for (String key : index.getFunctionKeys()) { List<FunctionEntry> functi...
java
public void preload(Index index, String sourcesName) throws Exception { for (String key : index.getTestKeys()) { TestEntry te = index.getTest(key); loadExecutable(te, sourcesName); } for (String key : index.getFunctionKeys()) { List<FunctionEntry> functi...
[ "public", "void", "preload", "(", "Index", "index", ",", "String", "sourcesName", ")", "throws", "Exception", "{", "for", "(", "String", "key", ":", "index", ".", "getTestKeys", "(", ")", ")", "{", "TestEntry", "te", "=", "index", ".", "getTest", "(", ...
Loads all of the XSL executables. This is a time consuming operation. @param index @param sourcesName A stylesheet reference. @throws Exception If the stylesheet fail to compile.
[ "Loads", "all", "of", "the", "XSL", "executables", ".", "This", "is", "a", "time", "consuming", "operation", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/Engine.java#L136-L149
107,132
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/DocumentationHelper.java
DocumentationHelper.prettyprint
private void prettyprint(String xmlLogsFile, FileOutputStream htmlReportFile) throws Exception { TransformerFactory tFactory = TransformerFactory.newInstance(); // Fortify Mod: prevent external entity injection tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); ...
java
private void prettyprint(String xmlLogsFile, FileOutputStream htmlReportFile) throws Exception { TransformerFactory tFactory = TransformerFactory.newInstance(); // Fortify Mod: prevent external entity injection tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); ...
[ "private", "void", "prettyprint", "(", "String", "xmlLogsFile", ",", "FileOutputStream", "htmlReportFile", ")", "throws", "Exception", "{", "TransformerFactory", "tFactory", "=", "TransformerFactory", ".", "newInstance", "(", ")", ";", "// Fortify Mod: prevent external en...
Apply xslt stylesheet to xml logs file and crate an HTML report file. @param xmlLogsFile @param htmlReportFile
[ "Apply", "xslt", "stylesheet", "to", "xml", "logs", "file", "and", "crate", "an", "HTML", "report", "file", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DocumentationHelper.java#L92-L108
107,133
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/DocumentationHelper.java
DocumentationHelper.generateDocumentation
public void generateDocumentation(String sourcecodePath, String suiteName, FileOutputStream htmlFileOutput) throws Exception { TransformerFactory tFactory = TransformerFactory.newInstance(); // Fortify Mod: prevent external entity injection tFactory.setFeature(XMLConstants.FEATURE_SE...
java
public void generateDocumentation(String sourcecodePath, String suiteName, FileOutputStream htmlFileOutput) throws Exception { TransformerFactory tFactory = TransformerFactory.newInstance(); // Fortify Mod: prevent external entity injection tFactory.setFeature(XMLConstants.FEATURE_SE...
[ "public", "void", "generateDocumentation", "(", "String", "sourcecodePath", ",", "String", "suiteName", ",", "FileOutputStream", "htmlFileOutput", ")", "throws", "Exception", "{", "TransformerFactory", "tFactory", "=", "TransformerFactory", ".", "newInstance", "(", ")",...
Generate pseudocode documentation for CTL test scripts. Apply the stylesheet to documentate the sources of tests. @param sourcecodePath main file of test source @param suiteName name of the suite to be documented (TBD) @param htmlFileOutput path of generated file @throws Exception
[ "Generate", "pseudocode", "documentation", "for", "CTL", "test", "scripts", ".", "Apply", "the", "stylesheet", "to", "documentate", "the", "sources", "of", "tests", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DocumentationHelper.java#L122-L139
107,134
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/Misc.java
Misc.deleteDirContents
public static void deleteDirContents(File dir) { if (!dir.isDirectory() || !dir.exists()) { throw new IllegalArgumentException(dir.getAbsolutePath() + " is not a directory or does not exist."); } String[] children = dir.list(); for (int i = 0; i < ch...
java
public static void deleteDirContents(File dir) { if (!dir.isDirectory() || !dir.exists()) { throw new IllegalArgumentException(dir.getAbsolutePath() + " is not a directory or does not exist."); } String[] children = dir.list(); for (int i = 0; i < ch...
[ "public", "static", "void", "deleteDirContents", "(", "File", "dir", ")", "{", "if", "(", "!", "dir", ".", "isDirectory", "(", ")", "||", "!", "dir", ".", "exists", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "dir", ".", "getAb...
Deletes the contents of a directory, including subdirectories. @param dir The directory to be emptied.
[ "Deletes", "the", "contents", "of", "a", "directory", "including", "subdirectories", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Misc.java#L48-L61
107,135
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/Misc.java
Misc.deleteSubDirs
public static void deleteSubDirs(File dir) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { File f = new File(dir, children[i]); if (f.isDirectory()) { deleteDir(f); } } }
java
public static void deleteSubDirs(File dir) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { File f = new File(dir, children[i]); if (f.isDirectory()) { deleteDir(f); } } }
[ "public", "static", "void", "deleteSubDirs", "(", "File", "dir", ")", "{", "String", "[", "]", "children", "=", "dir", ".", "list", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", ...
Deletes just the sub directories for a certain directory
[ "Deletes", "just", "the", "sub", "directories", "for", "a", "certain", "directory" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Misc.java#L64-L72
107,136
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/Misc.java
Misc.getResourceAsFile
public static File getResourceAsFile(String resource) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { return new File(URLDecoder.decode(cl.getResource(resource) .getFile(), "UTF-8")); } catch (UnsupportedEncodingException uee) { ...
java
public static File getResourceAsFile(String resource) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { return new File(URLDecoder.decode(cl.getResource(resource) .getFile(), "UTF-8")); } catch (UnsupportedEncodingException uee) { ...
[ "public", "static", "File", "getResourceAsFile", "(", "String", "resource", ")", "{", "ClassLoader", "cl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "try", "{", "return", "new", "File", "(", "URLDecoder", "."...
Loads a file into memory from the classpath
[ "Loads", "a", "file", "into", "memory", "from", "the", "classpath" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Misc.java#L75-L83
107,137
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/Misc.java
Misc.getResourceAsDoc
Document getResourceAsDoc(String resource) throws Exception { ClassLoader cl = Thread.currentThread().getContextClassLoader(); InputStream is = cl.getResourceAsStream(resource); if (is != null) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf....
java
Document getResourceAsDoc(String resource) throws Exception { ClassLoader cl = Thread.currentThread().getContextClassLoader(); InputStream is = cl.getResourceAsStream(resource); if (is != null) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf....
[ "Document", "getResourceAsDoc", "(", "String", "resource", ")", "throws", "Exception", "{", "ClassLoader", "cl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "InputStream", "is", "=", "cl", ".", "getResourceAsStream...
Loads a DOM Document from the classpath
[ "Loads", "a", "DOM", "Document", "from", "the", "classpath" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Misc.java#L86-L109
107,138
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/Misc.java
Misc.getResourceURL
public static String getResourceURL(String resource) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); return cl.getResource(resource).toString(); }
java
public static String getResourceURL(String resource) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); return cl.getResource(resource).toString(); }
[ "public", "static", "String", "getResourceURL", "(", "String", "resource", ")", "{", "ClassLoader", "cl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "return", "cl", ".", "getResource", "(", "resource", ")", "....
Returns the URL for file on the classpath as a String
[ "Returns", "the", "URL", "for", "file", "on", "the", "classpath", "as", "a", "String" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Misc.java#L112-L115
107,139
opengeospatial/teamengine
teamengine-realm/src/main/java/com/occamlab/te/realm/PBKDF2Realm.java
PBKDF2Realm.authenticate
@Override public Principal authenticate(String username, String credentials) { GenericPrincipal principal = (GenericPrincipal) getPrincipal(username); if (null != principal) { try { if (!PasswordStorage.verifyPassword(credentials, principal.getPassword())) { ...
java
@Override public Principal authenticate(String username, String credentials) { GenericPrincipal principal = (GenericPrincipal) getPrincipal(username); if (null != principal) { try { if (!PasswordStorage.verifyPassword(credentials, principal.getPassword())) { ...
[ "@", "Override", "public", "Principal", "authenticate", "(", "String", "username", ",", "String", "credentials", ")", "{", "GenericPrincipal", "principal", "=", "(", "GenericPrincipal", ")", "getPrincipal", "(", "username", ")", ";", "if", "(", "null", "!=", "...
Return the Principal associated with the specified username and credentials, if one exists in the user data store; otherwise return null.
[ "Return", "the", "Principal", "associated", "with", "the", "specified", "username", "and", "credentials", "if", "one", "exists", "in", "the", "user", "data", "store", ";", "otherwise", "return", "null", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-realm/src/main/java/com/occamlab/te/realm/PBKDF2Realm.java#L75-L89
107,140
opengeospatial/teamengine
teamengine-realm/src/main/java/com/occamlab/te/realm/PBKDF2Realm.java
PBKDF2Realm.createGenericPrincipal
@SuppressWarnings({ "rawtypes", "unchecked" }) GenericPrincipal createGenericPrincipal(String username, String password, List<String> roles) { Class klass = null; try { klass = Class.forName("org.apache.catalina.realm.GenericPrincipal"); } catch (ClassNotFoundException ex) { ...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) GenericPrincipal createGenericPrincipal(String username, String password, List<String> roles) { Class klass = null; try { klass = Class.forName("org.apache.catalina.realm.GenericPrincipal"); } catch (ClassNotFoundException ex) { ...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "GenericPrincipal", "createGenericPrincipal", "(", "String", "username", ",", "String", "password", ",", "List", "<", "String", ">", "roles", ")", "{", "Class", "klass", "=", "n...
Creates a new GenericPrincipal representing the specified user. @param username The username for this user. @param password The authentication credentials for this user. @param roles The set of roles (specified using String values) associated with this user. @return A GenericPrincipal for use by this Realm implementat...
[ "Creates", "a", "new", "GenericPrincipal", "representing", "the", "specified", "user", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-realm/src/main/java/com/occamlab/te/realm/PBKDF2Realm.java#L196-L225
107,141
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/form/ImageHandler.java
ImageHandler.saveImages
public void saveImages( Element form ) throws IOException { List<Element> images = DomUtils.getElementsByTagName( form, "img" ); int imageCount = 1; for ( Element image : images ) { if ( image.hasAttribute( "src" ) ) { String src = image.ge...
java
public void saveImages( Element form ) throws IOException { List<Element> images = DomUtils.getElementsByTagName( form, "img" ); int imageCount = 1; for ( Element image : images ) { if ( image.hasAttribute( "src" ) ) { String src = image.ge...
[ "public", "void", "saveImages", "(", "Element", "form", ")", "throws", "IOException", "{", "List", "<", "Element", ">", "images", "=", "DomUtils", ".", "getElementsByTagName", "(", "form", ",", "\"img\"", ")", ";", "int", "imageCount", "=", "1", ";", "for"...
Save images into session if the ets is interactive and it contains the images. @param form the form element with the images, never <code>null</code> @throws IOException if the images could not be read/write
[ "Save", "images", "into", "session", "if", "the", "ets", "is", "interactive", "and", "it", "contains", "the", "images", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/form/ImageHandler.java#L46-L66
107,142
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/HTTPParser.java
HTTPParser.select_parser
static Node select_parser(int partnum, String mime, Element instruction) { if (null == instruction) return null; NodeList instructions = instruction.getElementsByTagNameNS(PARSERS_NS, "parse"); Node parserNode = null; instructionsLoop: for (int i = 0; i ...
java
static Node select_parser(int partnum, String mime, Element instruction) { if (null == instruction) return null; NodeList instructions = instruction.getElementsByTagNameNS(PARSERS_NS, "parse"); Node parserNode = null; instructionsLoop: for (int i = 0; i ...
[ "static", "Node", "select_parser", "(", "int", "partnum", ",", "String", "mime", ",", "Element", "instruction", ")", "{", "if", "(", "null", "==", "instruction", ")", "return", "null", ";", "NodeList", "instructions", "=", "instruction", ".", "getElementsByTag...
Selects a parser for a message part based on the part number and MIME format type, if supplied in instructions. @param partnum An integer indicating the message part number. @param mime A MIME media type. @param instruction An Element representing parser instructions. @return A Node containing parser info, or {@code n...
[ "Selects", "a", "parser", "for", "a", "message", "part", "based", "on", "the", "part", "number", "and", "MIME", "format", "type", "if", "supplied", "in", "instructions", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/HTTPParser.java#L97-L142
107,143
opengeospatial/teamengine
teamengine-spi/src/main/java/com/occamlab/te/spi/executors/FixtureManager.java
FixtureManager.getFixture
public TestRunFixture getFixture(String runId) { if (runId.isEmpty() && this.fixtures.size() == 1) { runId = this.fixtures.keySet().iterator().next(); } return fixtures.get(runId); }
java
public TestRunFixture getFixture(String runId) { if (runId.isEmpty() && this.fixtures.size() == 1) { runId = this.fixtures.keySet().iterator().next(); } return fixtures.get(runId); }
[ "public", "TestRunFixture", "getFixture", "(", "String", "runId", ")", "{", "if", "(", "runId", ".", "isEmpty", "(", ")", "&&", "this", ".", "fixtures", ".", "size", "(", ")", "==", "1", ")", "{", "runId", "=", "this", ".", "fixtures", ".", "keySet",...
Gets the fixture for the specified test run. If runId is an empty String and only one fixture exists this is returned. @param runId The test run identifier (may be an empty String). @return A TestRunFixture, or {@code null } if a matching one cannot be found.
[ "Gets", "the", "fixture", "for", "the", "specified", "test", "run", ".", "If", "runId", "is", "an", "empty", "String", "and", "only", "one", "fixture", "exists", "this", "is", "returned", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-spi/src/main/java/com/occamlab/te/spi/executors/FixtureManager.java#L55-L60
107,144
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/XmlErrorHandler.java
XmlErrorHandler.printError
void printError(String type, SAXParseException e) { PrintWriter logger = new PrintWriter(System.out); logger.print(type); if (e.getLineNumber() >= 0) { logger.print(" at line " + e.getLineNumber()); if (e.getColumnNumber() >= 0) { logger.print(", col...
java
void printError(String type, SAXParseException e) { PrintWriter logger = new PrintWriter(System.out); logger.print(type); if (e.getLineNumber() >= 0) { logger.print(" at line " + e.getLineNumber()); if (e.getColumnNumber() >= 0) { logger.print(", col...
[ "void", "printError", "(", "String", "type", ",", "SAXParseException", "e", ")", "{", "PrintWriter", "logger", "=", "new", "PrintWriter", "(", "System", ".", "out", ")", ";", "logger", ".", "print", "(", "type", ")", ";", "if", "(", "e", ".", "getLineN...
Prints the error to STDOUT, used to be consistent with TEAM Engine error handler.
[ "Prints", "the", "error", "to", "STDOUT", "used", "to", "be", "consistent", "with", "TEAM", "Engine", "error", "handler", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/XmlErrorHandler.java#L83-L102
107,145
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/XmlErrorHandler.java
XmlErrorHandler.toList
public List<String> toList() { List<String> errorStrings = new ArrayList<String>(); ErrorIterator errIterator = iterator(); while (errIterator.hasNext()) { ValidationError err = errIterator.next(); errorStrings.add(err.getMessage()); } return erro...
java
public List<String> toList() { List<String> errorStrings = new ArrayList<String>(); ErrorIterator errIterator = iterator(); while (errIterator.hasNext()) { ValidationError err = errIterator.next(); errorStrings.add(err.getMessage()); } return erro...
[ "public", "List", "<", "String", ">", "toList", "(", ")", "{", "List", "<", "String", ">", "errorStrings", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "ErrorIterator", "errIterator", "=", "iterator", "(", ")", ";", "while", "(", "errIte...
Returns a list of errors as strings. @return a list of error strings.
[ "Returns", "a", "list", "of", "errors", "as", "strings", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/XmlErrorHandler.java#L160-L169
107,146
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java
XMLValidatingParser.parse
public Document parse(URLConnection uc, Element instruction, PrintWriter logger) throws SSLProtocolException { if (null == uc) { throw new NullPointerException( "Unable to parse resource: URLConnection is null."); } jlogger.fine("Received URLConnection object for " + uc.getURL()); Document doc...
java
public Document parse(URLConnection uc, Element instruction, PrintWriter logger) throws SSLProtocolException { if (null == uc) { throw new NullPointerException( "Unable to parse resource: URLConnection is null."); } jlogger.fine("Received URLConnection object for " + uc.getURL()); Document doc...
[ "public", "Document", "parse", "(", "URLConnection", "uc", ",", "Element", "instruction", ",", "PrintWriter", "logger", ")", "throws", "SSLProtocolException", "{", "if", "(", "null", "==", "uc", ")", "{", "throw", "new", "NullPointerException", "(", "\"Unable to...
Attempts to parse a resource read using the given connection to a URL. @param uc A connection for reading from some URL. @param instruction An Element node (ctlp:XMLValidatingParser) containing instructions, usually schema references. @param logger A log writer. @return A Document, or null if the resource could not be...
[ "Attempts", "to", "parse", "a", "resource", "read", "using", "the", "given", "connection", "to", "a", "URL", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java#L213-L231
107,147
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java
XMLValidatingParser.parse
Document parse(Object input, Element parserConfig, PrintWriter logger) throws Exception { jlogger.finer("Received XML resource of type " + input.getClass().getName()); ArrayList<Object> schemas = new ArrayList<Object>(); ArrayList<Object> dtds = new ArrayList<Object>(); schemas.addAll(this.schemaLi...
java
Document parse(Object input, Element parserConfig, PrintWriter logger) throws Exception { jlogger.finer("Received XML resource of type " + input.getClass().getName()); ArrayList<Object> schemas = new ArrayList<Object>(); ArrayList<Object> dtds = new ArrayList<Object>(); schemas.addAll(this.schemaLi...
[ "Document", "parse", "(", "Object", "input", ",", "Element", "parserConfig", ",", "PrintWriter", "logger", ")", "throws", "Exception", "{", "jlogger", ".", "finer", "(", "\"Received XML resource of type \"", "+", "input", ".", "getClass", "(", ")", ".", "getName...
Parses and validates an XML resource using the given schema references. @param input The XML input to parse and validate. It must be either an InputStream or a Document object. @param parserConfig An Element ({http://www.occamlab.com/te/parsers}XMLValidatingParser) containing configuration info. If it is {@code null} ...
[ "Parses", "and", "validates", "an", "XML", "resource", "using", "the", "given", "schema", "references", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java#L251-L322
107,148
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java
XMLValidatingParser.checkXMLRules
public boolean checkXMLRules(Document doc, Document instruction) throws Exception { if (doc == null || doc.getDocumentElement() == null) return false; Element e = instruction.getDocumentElement(); PrintWriter logger = new PrintWriter(System.out); Document parsedDoc = parse(doc, e, logger); retu...
java
public boolean checkXMLRules(Document doc, Document instruction) throws Exception { if (doc == null || doc.getDocumentElement() == null) return false; Element e = instruction.getDocumentElement(); PrintWriter logger = new PrintWriter(System.out); Document parsedDoc = parse(doc, e, logger); retu...
[ "public", "boolean", "checkXMLRules", "(", "Document", "doc", ",", "Document", "instruction", ")", "throws", "Exception", "{", "if", "(", "doc", "==", "null", "||", "doc", ".", "getDocumentElement", "(", ")", "==", "null", ")", "return", "false", ";", "Ele...
A method to validate a pool of schemas outside of the request element. @param Document doc The file document to validate @param Document instruction The xml encapsulated schema information (file locations) @return false if there were errors, true if none.
[ "A", "method", "to", "validate", "a", "pool", "of", "schemas", "outside", "of", "the", "request", "element", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java#L335-L344
107,149
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java
XMLValidatingParser.validate
public NodeList validate(Document doc, Document instruction) throws Exception { return schemaValidation(doc, instruction).toNodeList(); }
java
public NodeList validate(Document doc, Document instruction) throws Exception { return schemaValidation(doc, instruction).toNodeList(); }
[ "public", "NodeList", "validate", "(", "Document", "doc", ",", "Document", "instruction", ")", "throws", "Exception", "{", "return", "schemaValidation", "(", "doc", ",", "instruction", ")", ".", "toNodeList", "(", ")", ";", "}" ]
Validates the given document against the schema references supplied in the accompanying instruction document. @param doc The document to be validated. @param instruction A document containing schema references; may be null, in which case embedded schema references will be used instead. @return A list of Element nodes ...
[ "Validates", "the", "given", "document", "against", "the", "schema", "references", "supplied", "in", "the", "accompanying", "instruction", "document", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java#L360-L363
107,150
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java
XMLValidatingParser.validateAgainstXMLSchemaList
void validateAgainstXMLSchemaList(Document doc, ArrayList<Object> xsdList, ErrorHandler errHandler) throws SAXException, IOException { jlogger.finer("Validating XML resource from " + doc.getDocumentURI()); Schema schema = SF.newSchema(); if (null != xsdList && !xsdList.isEmpty()) { Source[] schemaSourc...
java
void validateAgainstXMLSchemaList(Document doc, ArrayList<Object> xsdList, ErrorHandler errHandler) throws SAXException, IOException { jlogger.finer("Validating XML resource from " + doc.getDocumentURI()); Schema schema = SF.newSchema(); if (null != xsdList && !xsdList.isEmpty()) { Source[] schemaSourc...
[ "void", "validateAgainstXMLSchemaList", "(", "Document", "doc", ",", "ArrayList", "<", "Object", ">", "xsdList", ",", "ErrorHandler", "errHandler", ")", "throws", "SAXException", ",", "IOException", "{", "jlogger", ".", "finer", "(", "\"Validating XML resource from \"...
Validates an XML resource against a list of XML Schemas. Validation errors are reported to the given handler. @param doc The input Document node. @param xsdList A list of XML schema references. If the list is {@code null} or empty, validation will be performed by using location hints found in the input document. @para...
[ "Validates", "an", "XML", "resource", "against", "a", "list", "of", "XML", "Schemas", ".", "Validation", "errors", "are", "reported", "to", "the", "given", "handler", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/XMLValidatingParser.java#L406-L427
107,151
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java
DomUtils.addDomAttr
public static Node addDomAttr(Document doc, String tagName, String tagNamespaceURI, String attrName, String attrValue) { // Create a Document to work on Document newDoc = null; try { System.setProperty("javax.xml.parsers.DocumentBuilderFactory", ...
java
public static Node addDomAttr(Document doc, String tagName, String tagNamespaceURI, String attrName, String attrValue) { // Create a Document to work on Document newDoc = null; try { System.setProperty("javax.xml.parsers.DocumentBuilderFactory", ...
[ "public", "static", "Node", "addDomAttr", "(", "Document", "doc", ",", "String", "tagName", ",", "String", "tagNamespaceURI", ",", "String", "attrName", ",", "String", "attrValue", ")", "{", "// Create a Document to work on\r", "Document", "newDoc", "=", "null", "...
Adds the attribute to each node in the Document with the given name. @param doc the Document to add attributes to @param tagName the local name of the nodes to add the attribute to @param tagNamespaceURI the namespace uri of the nodes to add the attribute to @param attrName the name of the attribute to add @param attr...
[ "Adds", "the", "attribute", "to", "each", "node", "in", "the", "Document", "with", "the", "given", "name", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java#L67-L108
107,152
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java
DomUtils.checkCommentNodes
public static boolean checkCommentNodes(Node node, String str) { // Get nodes of node and go through them NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); NodeList childChildren = child.getChi...
java
public static boolean checkCommentNodes(Node node, String str) { // Get nodes of node and go through them NodeList children = node.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); NodeList childChildren = child.getChi...
[ "public", "static", "boolean", "checkCommentNodes", "(", "Node", "node", ",", "String", "str", ")", "{", "// Get nodes of node and go through them\r", "NodeList", "children", "=", "node", ".", "getChildNodes", "(", ")", ";", "for", "(", "int", "i", "=", "0", "...
Determines if there is a comment Node that contains the given string. @param node the Node to look in @param str the string value to match in the comment nodes CTL declaration, if we ever want to use it <!--Sample Usage: ctl:checkCommentNodes($xml.resp, 'complexContent')--> <ctl:function name="ctl:checkCommentNodes">...
[ "Determines", "if", "there", "is", "a", "comment", "Node", "that", "contains", "the", "given", "string", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java#L129-L153
107,153
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java
DomUtils.serializeNoNS
public static String serializeNoNS(Node node) { StringBuffer buf = new StringBuffer(); buf.append("<"); buf.append(node.getLocalName()); for (Entry<QName, String> entry : getAttributes(node).entrySet()) { QName name = entry.getKey(); if (name.getNamespaceURI...
java
public static String serializeNoNS(Node node) { StringBuffer buf = new StringBuffer(); buf.append("<"); buf.append(node.getLocalName()); for (Entry<QName, String> entry : getAttributes(node).entrySet()) { QName name = entry.getKey(); if (name.getNamespaceURI...
[ "public", "static", "String", "serializeNoNS", "(", "Node", "node", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "buf", ".", "append", "(", "\"<\"", ")", ";", "buf", ".", "append", "(", "node", ".", "getLocalName", "(", "...
Serializes a Node to a String
[ "Serializes", "a", "Node", "to", "a", "String" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java#L189-L248
107,154
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java
DomUtils.displayNode
static public void displayNode(Node node) { try { TransformerFactory TF = TransformerFactory.newInstance(); // Fortify Mod: disable external entity injection TF.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); Transformer identity = TF.newTransform...
java
static public void displayNode(Node node) { try { TransformerFactory TF = TransformerFactory.newInstance(); // Fortify Mod: disable external entity injection TF.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); Transformer identity = TF.newTransform...
[ "static", "public", "void", "displayNode", "(", "Node", "node", ")", "{", "try", "{", "TransformerFactory", "TF", "=", "TransformerFactory", ".", "newInstance", "(", ")", ";", "// Fortify Mod: disable external entity injection\r", "TF", ".", "setFeature", "(", "XMLC...
HELPER METHOD TO PRINT A DOM TO STDOUT
[ "HELPER", "METHOD", "TO", "PRINT", "A", "DOM", "TO", "STDOUT" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java#L251-L263
107,155
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java
DomUtils.convertToElementNode
public static Document convertToElementNode(String xmlString) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); // Fortify Mod: Disable entity expansion to foil External Entity Injections dbf.setExpandEntityRefere...
java
public static Document convertToElementNode(String xmlString) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); // Fortify Mod: Disable entity expansion to foil External Entity Injections dbf.setExpandEntityRefere...
[ "public", "static", "Document", "convertToElementNode", "(", "String", "xmlString", ")", "throws", "Exception", "{", "DocumentBuilderFactory", "dbf", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "dbf", ".", "setNamespaceAware", "(", "true", ")",...
Convert text node to element. @param xmlString @return Return the document object. @throws Exception
[ "Convert", "text", "node", "to", "element", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DomUtils.java#L416-L431
107,156
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/ConfigFileCreator.java
ConfigFileCreator.create
public void create(File tebase) throws TEException { try { create(tebase.toString() + File.separator); } catch (Exception e) { throw e; } }
java
public void create(File tebase) throws TEException { try { create(tebase.toString() + File.separator); } catch (Exception e) { throw e; } }
[ "public", "void", "create", "(", "File", "tebase", ")", "throws", "TEException", "{", "try", "{", "create", "(", "tebase", ".", "toString", "(", ")", "+", "File", ".", "separator", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "e"...
Creates the main config file. @param tebase
[ "Creates", "the", "main", "config", "file", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/ConfigFileCreator.java#L93-L99
107,157
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/ConfigFileCreator.java
ConfigFileCreator.getConfigFiles
private List<File> getConfigFiles(File dir) { String[] extensions = { "xml" }; List<File> configFiles = new ArrayList<File>(); Collection<File> files = FileUtils.listFiles(dir, extensions, true); for (Iterator<File> iterator = files.iterator(); iterator.hasNext();) { File file = (File) iterator.next(); i...
java
private List<File> getConfigFiles(File dir) { String[] extensions = { "xml" }; List<File> configFiles = new ArrayList<File>(); Collection<File> files = FileUtils.listFiles(dir, extensions, true); for (Iterator<File> iterator = files.iterator(); iterator.hasNext();) { File file = (File) iterator.next(); i...
[ "private", "List", "<", "File", ">", "getConfigFiles", "(", "File", "dir", ")", "{", "String", "[", "]", "extensions", "=", "{", "\"xml\"", "}", ";", "List", "<", "File", ">", "configFiles", "=", "new", "ArrayList", "<", "File", ">", "(", ")", ";", ...
Returns the all config file found under a directory @param dir @return A list of files found. Length = 0 if not found files.
[ "Returns", "the", "all", "config", "file", "found", "under", "a", "directory" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/ConfigFileCreator.java#L245-L258
107,158
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java
SchematronValidatingParser.checkSchematronRules
public boolean checkSchematronRules(Document doc, String schemaFile, String phase) throws Exception { boolean isValid = false; if (doc == null || doc.getDocumentElement() == null) return isValid; try { ClassLoader loader = this.getClass().getClassLoa...
java
public boolean checkSchematronRules(Document doc, String schemaFile, String phase) throws Exception { boolean isValid = false; if (doc == null || doc.getDocumentElement() == null) return isValid; try { ClassLoader loader = this.getClass().getClassLoa...
[ "public", "boolean", "checkSchematronRules", "(", "Document", "doc", ",", "String", "schemaFile", ",", "String", "phase", ")", "throws", "Exception", "{", "boolean", "isValid", "=", "false", ";", "if", "(", "doc", "==", "null", "||", "doc", ".", "getDocument...
Checks the given schematron phase for the XML file and returns the validation status. @param doc The XML file to validate (Document) @param schemaFile The string path to the schematron file to use @param phase The string phase name (contained in schematron file) @return Whether there were validation errors or not (boo...
[ "Checks", "the", "given", "schematron", "phase", "for", "the", "XML", "file", "and", "returns", "the", "validation", "status", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java#L162-L183
107,159
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java
SchematronValidatingParser.executeSchematronDriver
public boolean executeSchematronDriver(InputSource inputDoc, File schemaFile, String phase) { boolean isValid = false; ValidationDriver driver = createSchematronDriver(phase); assert null != driver : "Unable to create Schematron ValidationDriver"; InputSource is = null...
java
public boolean executeSchematronDriver(InputSource inputDoc, File schemaFile, String phase) { boolean isValid = false; ValidationDriver driver = createSchematronDriver(phase); assert null != driver : "Unable to create Schematron ValidationDriver"; InputSource is = null...
[ "public", "boolean", "executeSchematronDriver", "(", "InputSource", "inputDoc", ",", "File", "schemaFile", ",", "String", "phase", ")", "{", "boolean", "isValid", "=", "false", ";", "ValidationDriver", "driver", "=", "createSchematronDriver", "(", "phase", ")", ";...
Runs the schematron file against the input source.
[ "Runs", "the", "schematron", "file", "against", "the", "input", "source", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java#L217-L247
107,160
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java
SchematronValidatingParser.parse
Document parse(Document doc, Element instruction, PrintWriter logger) throws Exception { this.outputLogger = logger; if (instruction != null) { getFileType(instruction); if (type.equals("url")) { URL schemaURL = new URL(this.schemaLocation); ...
java
Document parse(Document doc, Element instruction, PrintWriter logger) throws Exception { this.outputLogger = logger; if (instruction != null) { getFileType(instruction); if (type.equals("url")) { URL schemaURL = new URL(this.schemaLocation); ...
[ "Document", "parse", "(", "Document", "doc", ",", "Element", "instruction", ",", "PrintWriter", "logger", ")", "throws", "Exception", "{", "this", ".", "outputLogger", "=", "logger", ";", "if", "(", "instruction", "!=", "null", ")", "{", "getFileType", "(", ...
Checks the given Document against a Schematron schema. A schema reference is conveyed by a DOM Element node as indicated below. <pre> {@code <tep:schemas xmlns:tep="http://www.occamlab.com/te/parsers"> <tep:schema type="resource" phase="#ALL">/class/path/schema1.sch</tep:schema> </tep:schemas> } </pre> @param doc The...
[ "Checks", "the", "given", "Document", "against", "a", "Schematron", "schema", ".", "A", "schema", "reference", "is", "conveyed", "by", "a", "DOM", "Element", "node", "as", "indicated", "below", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java#L348-L381
107,161
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java
SchematronValidatingParser.createDriver
ValidationDriver createDriver(PropertyMap configProps) { SchemaReaderLoader loader = new SchemaReaderLoader(); SchemaReader schReader = loader.createSchemaReader(SCHEMATRON_NS_URI); ValidationDriver validator = new ValidationDriver(configProps, schReader); return val...
java
ValidationDriver createDriver(PropertyMap configProps) { SchemaReaderLoader loader = new SchemaReaderLoader(); SchemaReader schReader = loader.createSchemaReader(SCHEMATRON_NS_URI); ValidationDriver validator = new ValidationDriver(configProps, schReader); return val...
[ "ValidationDriver", "createDriver", "(", "PropertyMap", "configProps", ")", "{", "SchemaReaderLoader", "loader", "=", "new", "SchemaReaderLoader", "(", ")", ";", "SchemaReader", "schReader", "=", "loader", ".", "createSchemaReader", "(", "SCHEMATRON_NS_URI", ")", ";",...
Creates and initializes a ValidationDriver to perform Schematron validation. A schema must be loaded before an instance can be validated. @param configProps A PropertyMap containing properties to configure schema construction and validation behavior; it typically includes {@code SchematronProperty} and {@code Validati...
[ "Creates", "and", "initializes", "a", "ValidationDriver", "to", "perform", "Schematron", "validation", ".", "A", "schema", "must", "be", "loaded", "before", "an", "instance", "can", "be", "validated", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/SchematronValidatingParser.java#L451-L457
107,162
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/parsers/ImageParser.java
ImageParser.getImageWidth
public static int getImageWidth(String imageLoc) { // Get the image as an InputStream InputStream is = null; try { URI imageUri = new URI(imageLoc); URL imageUrl = imageUri.toURL(); is = imageUrl.openStream(); } catch (Exception e) { jlogg...
java
public static int getImageWidth(String imageLoc) { // Get the image as an InputStream InputStream is = null; try { URI imageUri = new URI(imageLoc); URL imageUrl = imageUri.toURL(); is = imageUrl.openStream(); } catch (Exception e) { jlogg...
[ "public", "static", "int", "getImageWidth", "(", "String", "imageLoc", ")", "{", "// Get the image as an InputStream", "InputStream", "is", "=", "null", ";", "try", "{", "URI", "imageUri", "=", "new", "URI", "(", "imageLoc", ")", ";", "URL", "imageUrl", "=", ...
Determines the width of the first image in an image file in pixels. @param imageLoc the string location of the image (uri syntax expected) @return int the image width in pixels, or -1 if unable. @author Paul Daisey added 2011-05-13 to support WMTS ETS
[ "Determines", "the", "width", "of", "the", "first", "image", "in", "an", "image", "file", "in", "pixels", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/parsers/ImageParser.java#L393-L431
107,163
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java
LogUtils.createLog
public static PrintWriter createLog(File logDir, String callpath) throws Exception { if (logDir != null) { File dir = new File(logDir, callpath); String path=logDir.toString() + "/" + callpath.split("/")[0]; System.setProperty("PATH", path); dir....
java
public static PrintWriter createLog(File logDir, String callpath) throws Exception { if (logDir != null) { File dir = new File(logDir, callpath); String path=logDir.toString() + "/" + callpath.split("/")[0]; System.setProperty("PATH", path); dir....
[ "public", "static", "PrintWriter", "createLog", "(", "File", "logDir", ",", "String", "callpath", ")", "throws", "Exception", "{", "if", "(", "logDir", "!=", "null", ")", "{", "File", "dir", "=", "new", "File", "(", "logDir", ",", "callpath", ")", ";", ...
Creates a Writer used to write test results to the log.xml file. @param logDir The directory containing the test session results. @param callpath A test session identifier. @return A PrintWriter object, or {@code null} if one could not be created. @throws Exception
[ "Creates", "a", "Writer", "used", "to", "write", "test", "results", "to", "the", "log", ".", "xml", "file", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java#L70-L84
107,164
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java
LogUtils.readLog
public static Document readLog(File logDir, String callpath) throws Exception { File dir = new File(logDir, callpath); File f = new File(dir, "log.xml"); if (f.exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespac...
java
public static Document readLog(File logDir, String callpath) throws Exception { File dir = new File(logDir, callpath); File f = new File(dir, "log.xml"); if (f.exists()) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespac...
[ "public", "static", "Document", "readLog", "(", "File", "logDir", ",", "String", "callpath", ")", "throws", "Exception", "{", "File", "dir", "=", "new", "File", "(", "logDir", ",", "callpath", ")", ";", "File", "f", "=", "new", "File", "(", "dir", ",",...
Reads a log from disk
[ "Reads", "a", "log", "from", "disk" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java#L87-L130
107,165
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java
LogUtils.getContextFromLog
public static XdmNode getContextFromLog( net.sf.saxon.s9api.DocumentBuilder builder, Document log) throws Exception { Element starttest = (Element) log.getElementsByTagName("starttest") .item(0); NodeList nl = starttest.getElementsByTagName("context"); ...
java
public static XdmNode getContextFromLog( net.sf.saxon.s9api.DocumentBuilder builder, Document log) throws Exception { Element starttest = (Element) log.getElementsByTagName("starttest") .item(0); NodeList nl = starttest.getElementsByTagName("context"); ...
[ "public", "static", "XdmNode", "getContextFromLog", "(", "net", ".", "sf", ".", "saxon", ".", "s9api", ".", "DocumentBuilder", "builder", ",", "Document", "log", ")", "throws", "Exception", "{", "Element", "starttest", "=", "(", "Element", ")", "log", ".", ...
Returns the context node for a test from its log document
[ "Returns", "the", "context", "node", "for", "a", "test", "from", "its", "log", "document" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java#L181-L208
107,166
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java
LogUtils.createFullReportLog
public static void createFullReportLog(String sessionLogDir) throws Exception { File xml_logs_report_file = new File(sessionLogDir + File.separator + "report_logs.xml"); if (xml_logs_report_file.exists()) { xml_logs_report_file.delete(); xml_logs...
java
public static void createFullReportLog(String sessionLogDir) throws Exception { File xml_logs_report_file = new File(sessionLogDir + File.separator + "report_logs.xml"); if (xml_logs_report_file.exists()) { xml_logs_report_file.delete(); xml_logs...
[ "public", "static", "void", "createFullReportLog", "(", "String", "sessionLogDir", ")", "throws", "Exception", "{", "File", "xml_logs_report_file", "=", "new", "File", "(", "sessionLogDir", "+", "File", ".", "separator", "+", "\"report_logs.xml\"", ")", ";", "if",...
Generate a file in logDir refererring all logfiles. Create a file called "report_logs.xml" in the log folder that includes all logs listed inside the directory. @param sessionLogDir considered log directory @throws Exception @author F.Vitale vitale@imaa.cnr.it
[ "Generate", "a", "file", "in", "logDir", "refererring", "all", "logfiles", ".", "Create", "a", "file", "called", "report_logs", ".", "xml", "in", "the", "log", "folder", "that", "includes", "all", "logs", "listed", "inside", "the", "directory", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java#L441-L488
107,167
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java
LogUtils.getFileListing
private static List<File> getFileListing(File logDir) throws Exception { List<File> result = getFileListingLogs(logDir); return result; }
java
private static List<File> getFileListing(File logDir) throws Exception { List<File> result = getFileListingLogs(logDir); return result; }
[ "private", "static", "List", "<", "File", ">", "getFileListing", "(", "File", "logDir", ")", "throws", "Exception", "{", "List", "<", "File", ">", "result", "=", "getFileListingLogs", "(", "logDir", ")", ";", "return", "result", ";", "}" ]
Recursively walk a directory tree and return a List of all log files found. @param logDir die to walk @return @throws Exception
[ "Recursively", "walk", "a", "directory", "tree", "and", "return", "a", "List", "of", "all", "log", "files", "found", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java#L500-L503
107,168
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java
LogUtils.getFileListingLogs
static private List<File> getFileListingLogs(File aStartingDir) throws Exception { List<File> result = new ArrayList<File>(); File[] logfiles = aStartingDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pa...
java
static private List<File> getFileListingLogs(File aStartingDir) throws Exception { List<File> result = new ArrayList<File>(); File[] logfiles = aStartingDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return pa...
[ "static", "private", "List", "<", "File", ">", "getFileListingLogs", "(", "File", "aStartingDir", ")", "throws", "Exception", "{", "List", "<", "File", ">", "result", "=", "new", "ArrayList", "<", "File", ">", "(", ")", ";", "File", "[", "]", "logfiles",...
Get all log files and directories and make recursive call. @param aStartingDir @return @throws Exception
[ "Get", "all", "log", "files", "and", "directories", "and", "make", "recursive", "call", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/LogUtils.java#L512-L555
107,169
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/CoverageMonitor.java
CoverageMonitor.writeCoverageResults
public void writeCoverageResults() { File coverageFile = new File(this.testSessionDir, ICS_MAP.get(this.requestId)); if (coverageFile.exists()) { return; } OutputStream fos = null; try { fos = new FileOutputStream(coverageFile, fals...
java
public void writeCoverageResults() { File coverageFile = new File(this.testSessionDir, ICS_MAP.get(this.requestId)); if (coverageFile.exists()) { return; } OutputStream fos = null; try { fos = new FileOutputStream(coverageFile, fals...
[ "public", "void", "writeCoverageResults", "(", ")", "{", "File", "coverageFile", "=", "new", "File", "(", "this", ".", "testSessionDir", ",", "ICS_MAP", ".", "get", "(", "this", ".", "requestId", ")", ")", ";", "if", "(", "coverageFile", ".", "exists", "...
Writes the residual ICS document to a file in the test session directory.
[ "Writes", "the", "residual", "ICS", "document", "to", "a", "file", "in", "the", "test", "session", "directory", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/CoverageMonitor.java#L198-L226
107,170
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/CoverageMonitor.java
CoverageMonitor.writeDocument
void writeDocument(OutputStream outStream, Document doc) { DOMImplementationRegistry domRegistry = null; try { domRegistry = DOMImplementationRegistry.newInstance(); // Fortify Mod: Broaden try block to capture all potential exceptions // } catch (Exception e) { ...
java
void writeDocument(OutputStream outStream, Document doc) { DOMImplementationRegistry domRegistry = null; try { domRegistry = DOMImplementationRegistry.newInstance(); // Fortify Mod: Broaden try block to capture all potential exceptions // } catch (Exception e) { ...
[ "void", "writeDocument", "(", "OutputStream", "outStream", ",", "Document", "doc", ")", "{", "DOMImplementationRegistry", "domRegistry", "=", "null", ";", "try", "{", "domRegistry", "=", "DOMImplementationRegistry", ".", "newInstance", "(", ")", ";", "// Fortify Mod...
Writes a DOM Document to the given OutputStream using the "UTF-8" encoding. The XML declaration is omitted. @param outStream The destination OutputStream object. @param doc A Document node.
[ "Writes", "a", "DOM", "Document", "to", "the", "given", "OutputStream", "using", "the", "UTF", "-", "8", "encoding", ".", "The", "XML", "declaration", "is", "omitted", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/CoverageMonitor.java#L237-L257
107,171
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/XMLParserUtils.java
XMLParserUtils.createXIncludeAwareSAXParser
public static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup) { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setXIncludeAware(true); SAXParser parser = null; try { factory.setFeature(Constants.XERCES_FEATURE_PREFIX + Constant...
java
public static SAXParser createXIncludeAwareSAXParser(boolean doBaseURIFixup) { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setXIncludeAware(true); SAXParser parser = null; try { factory.setFeature(Constants.XERCES_FEATURE_PREFIX + Constant...
[ "public", "static", "SAXParser", "createXIncludeAwareSAXParser", "(", "boolean", "doBaseURIFixup", ")", "{", "SAXParserFactory", "factory", "=", "SAXParserFactory", ".", "newInstance", "(", ")", ";", "factory", ".", "setNamespaceAware", "(", "true", ")", ";", "facto...
Creates a SAXParser that is configured to resolve XInclude references but not perform schema validation. @param doBaseURIFixup A boolean value that specifies whether or not to add xml:base attributes when resolving xi:include elements; adding these attributes may render an instance document schema-invalid. @return An ...
[ "Creates", "a", "SAXParser", "that", "is", "configured", "to", "resolve", "XInclude", "references", "but", "not", "perform", "schema", "validation", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/XMLParserUtils.java#L27-L41
107,172
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/listeners/CleartextPasswordContextListener.java
CleartextPasswordContextListener.contextInitialized
@Override public void contextInitialized(ServletContextEvent evt) { File usersDir = new File(SetupOptions.getBaseConfigDirectory(), "users"); if (!usersDir.isDirectory()) { return; } DocumentBuilder domBuilder = null; try { domBuilder = DocumentBuilder...
java
@Override public void contextInitialized(ServletContextEvent evt) { File usersDir = new File(SetupOptions.getBaseConfigDirectory(), "users"); if (!usersDir.isDirectory()) { return; } DocumentBuilder domBuilder = null; try { domBuilder = DocumentBuilder...
[ "@", "Override", "public", "void", "contextInitialized", "(", "ServletContextEvent", "evt", ")", "{", "File", "usersDir", "=", "new", "File", "(", "SetupOptions", ".", "getBaseConfigDirectory", "(", ")", ",", "\"users\"", ")", ";", "if", "(", "!", "usersDir", ...
Checks that passwords in the user files are not in clear text. If a hash value is found for some user, it is assumed that all user passwords have previously been hashed and no further checks are done.
[ "Checks", "that", "passwords", "in", "the", "user", "files", "are", "not", "in", "clear", "text", ".", "If", "a", "hash", "value", "is", "found", "for", "some", "user", "it", "is", "assumed", "that", "all", "user", "passwords", "have", "previously", "bee...
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/listeners/CleartextPasswordContextListener.java#L57-L104
107,173
opengeospatial/teamengine
teamengine-web/src/main/java/com/occamlab/te/web/listeners/CleartextPasswordContextListener.java
CleartextPasswordContextListener.buildDOM3LoadAndSaveFactory
DOMImplementationLS buildDOM3LoadAndSaveFactory() { DOMImplementationLS factory = null; try { DOMImplementationRegistry domRegistry = DOMImplementationRegistry.newInstance(); factory = (DOMImplementationLS) domRegistry.getDOMImplementation("LS 3.0"); } catch (Exception e)...
java
DOMImplementationLS buildDOM3LoadAndSaveFactory() { DOMImplementationLS factory = null; try { DOMImplementationRegistry domRegistry = DOMImplementationRegistry.newInstance(); factory = (DOMImplementationLS) domRegistry.getDOMImplementation("LS 3.0"); } catch (Exception e)...
[ "DOMImplementationLS", "buildDOM3LoadAndSaveFactory", "(", ")", "{", "DOMImplementationLS", "factory", "=", "null", ";", "try", "{", "DOMImplementationRegistry", "domRegistry", "=", "DOMImplementationRegistry", ".", "newInstance", "(", ")", ";", "factory", "=", "(", "...
Builds a DOMImplementationLS factory that supports the "DOM Level 3 Load and Save" specification. It provides various factory methods for creating the objects required for loading and saving DOM nodes. @return A factory object, or <code>null</code> if one cannot be created (in which case a warning will be logged). @s...
[ "Builds", "a", "DOMImplementationLS", "factory", "that", "supports", "the", "DOM", "Level", "3", "Load", "and", "Save", "specification", ".", "It", "provides", "various", "factory", "methods", "for", "creating", "the", "objects", "required", "for", "loading", "a...
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-web/src/main/java/com/occamlab/te/web/listeners/CleartextPasswordContextListener.java#L118-L127
107,174
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/Utils.java
Utils.randomString
public static String randomString(int len, Random random) { if (len < 1) { return ""; } int start = ' '; int end = 'z' + 1; StringBuffer buffer = new StringBuffer(); int gap = end - start; while (len-- != 0) { char ch; ...
java
public static String randomString(int len, Random random) { if (len < 1) { return ""; } int start = ' '; int end = 'z' + 1; StringBuffer buffer = new StringBuffer(); int gap = end - start; while (len-- != 0) { char ch; ...
[ "public", "static", "String", "randomString", "(", "int", "len", ",", "Random", "random", ")", "{", "if", "(", "len", "<", "1", ")", "{", "return", "\"\"", ";", "}", "int", "start", "=", "'", "'", ";", "int", "end", "=", "'", "'", "+", "1", ";"...
Returns a random string of a certain length
[ "Returns", "a", "random", "string", "of", "a", "certain", "length" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Utils.java#L47-L68
107,175
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/util/Utils.java
Utils.generateMD5
public static String generateMD5(String text) { byte[] md5hash = null; try { MessageDigest md; md = MessageDigest.getInstance("MD5"); md5hash = new byte[8]; md.update(text.getBytes("iso-8859-1"), 0, text.length()); md5hash = md.digest();...
java
public static String generateMD5(String text) { byte[] md5hash = null; try { MessageDigest md; md = MessageDigest.getInstance("MD5"); md5hash = new byte[8]; md.update(text.getBytes("iso-8859-1"), 0, text.length()); md5hash = md.digest();...
[ "public", "static", "String", "generateMD5", "(", "String", "text", ")", "{", "byte", "[", "]", "md5hash", "=", "null", ";", "try", "{", "MessageDigest", "md", ";", "md", "=", "MessageDigest", ".", "getInstance", "(", "\"MD5\"", ")", ";", "md5hash", "=",...
Uses MD5 to create a hash value for the given String
[ "Uses", "MD5", "to", "create", "a", "hash", "value", "for", "the", "given", "String" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/Utils.java#L74-L90
107,176
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/TECore.java
TECore.build_soap_request
static public URLConnection build_soap_request(Node xml) throws Exception { String sUrl = null; String method = "POST"; String charset = ((Element) xml).getAttribute("charset").equals("") ? ((Element) xml) .getAttribute("charset") : "UTF-8"; String version = ((Element) xml).getAttribute...
java
static public URLConnection build_soap_request(Node xml) throws Exception { String sUrl = null; String method = "POST"; String charset = ((Element) xml).getAttribute("charset").equals("") ? ((Element) xml) .getAttribute("charset") : "UTF-8"; String version = ((Element) xml).getAttribute...
[ "static", "public", "URLConnection", "build_soap_request", "(", "Node", "xml", ")", "throws", "Exception", "{", "String", "sUrl", "=", "null", ";", "String", "method", "=", "\"POST\"", ";", "String", "charset", "=", "(", "(", "Element", ")", "xml", ")", "....
Create SOAP request, sends it and return an URL Connection ready to be parsed. @param xml the soap-request node (from CTL) @return The URL Connection @throws Exception the exception <soap-request version="1.1|1.2" charset="UTF-8"> <url>http://blah</url> <action>Some-URI</action> <headers> <header MutUnderstand="tru...
[ "Create", "SOAP", "request", "sends", "it", "and", "return", "an", "URL", "Connection", "ready", "to", "be", "parsed", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/TECore.java#L1538-L1617
107,177
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/TECore.java
TECore.parse
public Element parse(URLConnection uc, Node instruction) throws Throwable { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); // Fortify Mod: Disable entity expansion to foil External Entity Injections dbf.setExpandEntityReferences(false); DocumentBuil...
java
public Element parse(URLConnection uc, Node instruction) throws Throwable { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); // Fortify Mod: Disable entity expansion to foil External Entity Injections dbf.setExpandEntityReferences(false); DocumentBuil...
[ "public", "Element", "parse", "(", "URLConnection", "uc", ",", "Node", "instruction", ")", "throws", "Throwable", "{", "DocumentBuilderFactory", "dbf", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "dbf", ".", "setNamespaceAware", "(", "true", ...
Parses the content retrieved from some URI and builds a DOM Document containing information extracted from the response message. Subsidiary parsers are invoked in accord with the supplied parser instructions. @param uc A URLConnection object. @param instruction A Document or Element node containing parser instructions...
[ "Parses", "the", "content", "retrieved", "from", "some", "URI", "and", "builds", "a", "DOM", "Document", "containing", "information", "extracted", "from", "the", "response", "message", ".", "Subsidiary", "parsers", "are", "invoked", "in", "accord", "with", "the"...
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/TECore.java#L2070-L2078
107,178
opengeospatial/teamengine
teamengine-core/src/main/java/com/occamlab/te/TECore.java
TECore.findXMLResource
public Document findXMLResource(String name) { URL url = this.getClass().getResource(name); DocumentBuilderFactory docFactory = DocumentBuilderFactory .newInstance(); docFactory.setNamespaceAware(true); // Fortify Mod: Disable entity expansion to foil External Entity Injections docFactor...
java
public Document findXMLResource(String name) { URL url = this.getClass().getResource(name); DocumentBuilderFactory docFactory = DocumentBuilderFactory .newInstance(); docFactory.setNamespaceAware(true); // Fortify Mod: Disable entity expansion to foil External Entity Injections docFactor...
[ "public", "Document", "findXMLResource", "(", "String", "name", ")", "{", "URL", "url", "=", "this", ".", "getClass", "(", ")", ".", "getResource", "(", "name", ")", ";", "DocumentBuilderFactory", "docFactory", "=", "DocumentBuilderFactory", ".", "newInstance", ...
Builds a DOM Document representing a classpath resource. @param name The name of an XML resource. @return A Document node, or {@code null} if the resource cannot be parsed for any reason.
[ "Builds", "a", "DOM", "Document", "representing", "a", "classpath", "resource", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/TECore.java#L2550-L2566
107,179
opengeospatial/teamengine
teamengine-spi/src/main/java/com/occamlab/te/spi/util/HtmlReport.java
HtmlReport.earlHtmlReport
public static File earlHtmlReport( String outputDir ) throws FileNotFoundException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath(); String earlXsl = cl.getResource( "com/occam...
java
public static File earlHtmlReport( String outputDir ) throws FileNotFoundException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); String resourceDir = cl.getResource( "com/occamlab/te/earl/lib" ).getPath(); String earlXsl = cl.getResource( "com/occam...
[ "public", "static", "File", "earlHtmlReport", "(", "String", "outputDir", ")", "throws", "FileNotFoundException", "{", "ClassLoader", "cl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "String", "resourceDir", "=", ...
Convert EARL result into HTML report. @param outputDir Location of the test result. @return Return the output file. @throws FileNotFoundException Throws exception if file is not available.
[ "Convert", "EARL", "result", "into", "HTML", "report", "." ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-spi/src/main/java/com/occamlab/te/spi/util/HtmlReport.java#L77-L108
107,180
opengeospatial/teamengine
teamengine-spi/src/main/java/com/occamlab/te/spi/util/HtmlReport.java
HtmlReport.addDir
private static void addDir(File dirObj, ZipOutputStream out) throws IOException { File[] dirList = dirObj.listFiles(); byte[] tmpBuf = new byte[1024]; for (int i = 0; i < dirList.length; i++) { if (dirList[i].isDirectory()) { addDir(dirList[i], out...
java
private static void addDir(File dirObj, ZipOutputStream out) throws IOException { File[] dirList = dirObj.listFiles(); byte[] tmpBuf = new byte[1024]; for (int i = 0; i < dirList.length; i++) { if (dirList[i].isDirectory()) { addDir(dirList[i], out...
[ "private", "static", "void", "addDir", "(", "File", "dirObj", ",", "ZipOutputStream", "out", ")", "throws", "IOException", "{", "File", "[", "]", "dirList", "=", "dirObj", ".", "listFiles", "(", ")", ";", "byte", "[", "]", "tmpBuf", "=", "new", "byte", ...
Add directory to zip file @param dirObj @param out @throws IOException
[ "Add", "directory", "to", "zip", "file" ]
b6b890214b6784bbe19460bf753bdf28a9514bee
https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-spi/src/main/java/com/occamlab/te/spi/util/HtmlReport.java#L149-L176
107,181
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java
CarrierRefresher.buildRefreshFallbackSequence
private Observable<ProposedBucketConfigContext> buildRefreshFallbackSequence(List<NodeInfo> nodeInfos, String bucketName) { Observable<ProposedBucketConfigContext> failbackSequence = null; for (final NodeInfo nodeInfo : nodeInfos) { if (!isValidCarrierNode(environment.sslEnabled(), nodeInfo)...
java
private Observable<ProposedBucketConfigContext> buildRefreshFallbackSequence(List<NodeInfo> nodeInfos, String bucketName) { Observable<ProposedBucketConfigContext> failbackSequence = null; for (final NodeInfo nodeInfo : nodeInfos) { if (!isValidCarrierNode(environment.sslEnabled(), nodeInfo)...
[ "private", "Observable", "<", "ProposedBucketConfigContext", ">", "buildRefreshFallbackSequence", "(", "List", "<", "NodeInfo", ">", "nodeInfos", ",", "String", "bucketName", ")", "{", "Observable", "<", "ProposedBucketConfigContext", ">", "failbackSequence", "=", "null...
Helper method which builds the refresh fallback sequence based on the node list. @param nodeInfos the list of node infos. @param bucketName the name of the bucket. @return an observable containing flatMapped failback sequences.
[ "Helper", "method", "which", "builds", "the", "refresh", "fallback", "sequence", "based", "on", "the", "node", "list", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java#L267-L287
107,182
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java
CarrierRefresher.shiftNodeList
<T> void shiftNodeList(List<T> nodeList) { int shiftBy = (int) (nodeOffset++ % nodeList.size()); for(int i = 0; i < shiftBy; i++) { T element = nodeList.remove(0); nodeList.add(element); } }
java
<T> void shiftNodeList(List<T> nodeList) { int shiftBy = (int) (nodeOffset++ % nodeList.size()); for(int i = 0; i < shiftBy; i++) { T element = nodeList.remove(0); nodeList.add(element); } }
[ "<", "T", ">", "void", "shiftNodeList", "(", "List", "<", "T", ">", "nodeList", ")", "{", "int", "shiftBy", "=", "(", "int", ")", "(", "nodeOffset", "++", "%", "nodeList", ".", "size", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", ...
Helper method to transparently rearrange the node list based on the current global offset. @param nodeList the list to shift.
[ "Helper", "method", "to", "transparently", "rearrange", "the", "node", "list", "based", "on", "the", "current", "global", "offset", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java#L294-L300
107,183
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java
CarrierRefresher.isValidCarrierNode
private static boolean isValidCarrierNode(final boolean sslEnabled, final NodeInfo nodeInfo) { if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.BINARY)) { return true; } else if (nodeInfo.services().containsKey(ServiceType.BINARY)) { return true; } ...
java
private static boolean isValidCarrierNode(final boolean sslEnabled, final NodeInfo nodeInfo) { if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.BINARY)) { return true; } else if (nodeInfo.services().containsKey(ServiceType.BINARY)) { return true; } ...
[ "private", "static", "boolean", "isValidCarrierNode", "(", "final", "boolean", "sslEnabled", ",", "final", "NodeInfo", "nodeInfo", ")", "{", "if", "(", "sslEnabled", "&&", "nodeInfo", ".", "sslServices", "(", ")", ".", "containsKey", "(", "ServiceType", ".", "...
Helper method to detect if the given node can actually perform carrier refresh. @param sslEnabled true if ssl enabled, false otherwise. @param nodeInfo the node info for the given node. @return true if it is a valid carrier node, false otherwise.
[ "Helper", "method", "to", "detect", "if", "the", "given", "node", "can", "actually", "perform", "carrier", "refresh", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java#L309-L316
107,184
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java
CarrierRefresher.allowedToPoll
private boolean allowedToPoll(final String bucket) { Long bucketLastPollTimestamp = lastPollTimestamps.get(bucket); return bucketLastPollTimestamp == null || ((System.nanoTime() - bucketLastPollTimestamp) >= pollFloorNs); }
java
private boolean allowedToPoll(final String bucket) { Long bucketLastPollTimestamp = lastPollTimestamps.get(bucket); return bucketLastPollTimestamp == null || ((System.nanoTime() - bucketLastPollTimestamp) >= pollFloorNs); }
[ "private", "boolean", "allowedToPoll", "(", "final", "String", "bucket", ")", "{", "Long", "bucketLastPollTimestamp", "=", "lastPollTimestamps", ".", "get", "(", "bucket", ")", ";", "return", "bucketLastPollTimestamp", "==", "null", "||", "(", "(", "System", "."...
Returns true if polling is allowed, false if we are below the configured floor poll interval.
[ "Returns", "true", "if", "polling", "is", "allowed", "false", "if", "we", "are", "below", "the", "configured", "floor", "poll", "interval", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java#L321-L324
107,185
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/utils/yasjl/JsonNumberByteBufProcessor.java
JsonNumberByteBufProcessor.process
public boolean process(byte value) throws Exception { if (value == (byte) 'e' || value == (byte) 'E') { return true; } if (value >= (byte) '0' && value <= (byte) '9') { return true; } return value == JSON_MINUS || value == JSON_PLUS || value == (byte) '.';...
java
public boolean process(byte value) throws Exception { if (value == (byte) 'e' || value == (byte) 'E') { return true; } if (value >= (byte) '0' && value <= (byte) '9') { return true; } return value == JSON_MINUS || value == JSON_PLUS || value == (byte) '.';...
[ "public", "boolean", "process", "(", "byte", "value", ")", "throws", "Exception", "{", "if", "(", "value", "==", "(", "byte", ")", "'", "'", "||", "value", "==", "(", "byte", ")", "'", "'", ")", "{", "return", "true", ";", "}", "if", "(", "value"...
not verifying if valid
[ "not", "verifying", "if", "valid" ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/utils/yasjl/JsonNumberByteBufProcessor.java#L34-L42
107,186
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/ResponseHandler.java
ResponseHandler.bucketHasFastForwardMap
private static boolean bucketHasFastForwardMap(String bucketName, ClusterConfig clusterConfig) { if (bucketName == null) { return false; } BucketConfig bucketConfig = clusterConfig.bucketConfig(bucketName); return bucketConfig != null && bucketConfig.hasFastForwardMap(); ...
java
private static boolean bucketHasFastForwardMap(String bucketName, ClusterConfig clusterConfig) { if (bucketName == null) { return false; } BucketConfig bucketConfig = clusterConfig.bucketConfig(bucketName); return bucketConfig != null && bucketConfig.hasFastForwardMap(); ...
[ "private", "static", "boolean", "bucketHasFastForwardMap", "(", "String", "bucketName", ",", "ClusterConfig", "clusterConfig", ")", "{", "if", "(", "bucketName", "==", "null", ")", "{", "return", "false", ";", "}", "BucketConfig", "bucketConfig", "=", "clusterConf...
Helper method to check if the current given bucket contains a fast forward map. @param bucketName the name of the bucket. @param clusterConfig the current cluster configuration. @return true if it has a ffwd-map, false otherwise.
[ "Helper", "method", "to", "check", "if", "the", "current", "given", "bucket", "contains", "a", "fast", "forward", "map", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/ResponseHandler.java#L230-L236
107,187
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java
ResponseStatusConverter.fromBinary
public static ResponseStatus fromBinary(final short code) { KeyValueStatus status = KeyValueStatus.valueOf(code); switch (status) { case SUCCESS: return ResponseStatus.SUCCESS; case ERR_EXISTS: return ResponseStatus.EXISTS; case ERR_NOT...
java
public static ResponseStatus fromBinary(final short code) { KeyValueStatus status = KeyValueStatus.valueOf(code); switch (status) { case SUCCESS: return ResponseStatus.SUCCESS; case ERR_EXISTS: return ResponseStatus.EXISTS; case ERR_NOT...
[ "public", "static", "ResponseStatus", "fromBinary", "(", "final", "short", "code", ")", "{", "KeyValueStatus", "status", "=", "KeyValueStatus", ".", "valueOf", "(", "code", ")", ";", "switch", "(", "status", ")", "{", "case", "SUCCESS", ":", "return", "Respo...
Convert the binary protocol status in a typesafe enum that can be acted upon later. @param code the status to convert. @return the converted response status.
[ "Convert", "the", "binary", "protocol", "status", "in", "a", "typesafe", "enum", "that", "can", "be", "acted", "upon", "later", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java#L64-L137
107,188
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java
ResponseStatusConverter.readErrorCodeFromErrorMap
public static ErrorMap.ErrorCode readErrorCodeFromErrorMap(final short code) { if (BINARY_ERROR_MAP == null) { LOGGER.trace("Binary error map unavailable"); return null; } ErrorMap.ErrorCode result = BINARY_ERROR_MAP.errors().get(code); return result; }
java
public static ErrorMap.ErrorCode readErrorCodeFromErrorMap(final short code) { if (BINARY_ERROR_MAP == null) { LOGGER.trace("Binary error map unavailable"); return null; } ErrorMap.ErrorCode result = BINARY_ERROR_MAP.errors().get(code); return result; }
[ "public", "static", "ErrorMap", ".", "ErrorCode", "readErrorCodeFromErrorMap", "(", "final", "short", "code", ")", "{", "if", "(", "BINARY_ERROR_MAP", "==", "null", ")", "{", "LOGGER", ".", "trace", "(", "\"Binary error map unavailable\"", ")", ";", "return", "n...
Get the error code from Key Value error map @param code the status to convert.
[ "Get", "the", "error", "code", "from", "Key", "Value", "error", "map" ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java#L144-L151
107,189
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java
ResponseStatusConverter.fromHttp
public static ResponseStatus fromHttp(final int code) { ResponseStatus status; switch (code) { case HTTP_OK: case HTTP_CREATED: case HTTP_ACCEPTED: status = ResponseStatus.SUCCESS; break; case HTTP_NOT_FOUND: ...
java
public static ResponseStatus fromHttp(final int code) { ResponseStatus status; switch (code) { case HTTP_OK: case HTTP_CREATED: case HTTP_ACCEPTED: status = ResponseStatus.SUCCESS; break; case HTTP_NOT_FOUND: ...
[ "public", "static", "ResponseStatus", "fromHttp", "(", "final", "int", "code", ")", "{", "ResponseStatus", "status", ";", "switch", "(", "code", ")", "{", "case", "HTTP_OK", ":", "case", "HTTP_CREATED", ":", "case", "HTTP_ACCEPTED", ":", "status", "=", "Resp...
Convert the http protocol status in a typesafe enum that can be acted upon later. @param code the status to convert. @return the converted response status.
[ "Convert", "the", "http", "protocol", "status", "in", "a", "typesafe", "enum", "that", "can", "be", "acted", "upon", "later", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java#L159-L187
107,190
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java
ResponseStatusConverter.updateBinaryErrorMap
public static void updateBinaryErrorMap(final ErrorMap map) { if (map == null) { return; } if (BINARY_ERROR_MAP == null || map.compareTo(BINARY_ERROR_MAP) > 0) { BINARY_ERROR_MAP = map; } }
java
public static void updateBinaryErrorMap(final ErrorMap map) { if (map == null) { return; } if (BINARY_ERROR_MAP == null || map.compareTo(BINARY_ERROR_MAP) > 0) { BINARY_ERROR_MAP = map; } }
[ "public", "static", "void", "updateBinaryErrorMap", "(", "final", "ErrorMap", "map", ")", "{", "if", "(", "map", "==", "null", ")", "{", "return", ";", "}", "if", "(", "BINARY_ERROR_MAP", "==", "null", "||", "map", ".", "compareTo", "(", "BINARY_ERROR_MAP"...
Updates the current error map in use for all uses of the response status converter. If the provided one is older than the one stored, this update operation will be ignored. @param map the map in use, it always uses the latest one.
[ "Updates", "the", "current", "error", "map", "in", "use", "for", "all", "uses", "of", "the", "response", "status", "converter", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/ResponseStatusConverter.java#L204-L212
107,191
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/lang/Tuple.java
Tuple.create
public static <T1, T2> Tuple2<T1, T2> create(final T1 v1, final T2 v2) { return new Tuple2<T1, T2>(v1, v2); }
java
public static <T1, T2> Tuple2<T1, T2> create(final T1 v1, final T2 v2) { return new Tuple2<T1, T2>(v1, v2); }
[ "public", "static", "<", "T1", ",", "T2", ">", "Tuple2", "<", "T1", ",", "T2", ">", "create", "(", "final", "T1", "v1", ",", "final", "T2", "v2", ")", "{", "return", "new", "Tuple2", "<", "T1", ",", "T2", ">", "(", "v1", ",", "v2", ")", ";", ...
Creates a tuple with two values. @param v1 the first value. @param v2 the second value. @return a tuple containing the values.
[ "Creates", "a", "tuple", "with", "two", "values", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/lang/Tuple.java#L44-L46
107,192
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/lang/Tuple.java
Tuple.create
public static <T1, T2, T3> Tuple3<T1, T2, T3> create(final T1 v1, final T2 v2, final T3 v3) { return new Tuple3<T1, T2, T3>(v1, v2, v3); }
java
public static <T1, T2, T3> Tuple3<T1, T2, T3> create(final T1 v1, final T2 v2, final T3 v3) { return new Tuple3<T1, T2, T3>(v1, v2, v3); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ">", "Tuple3", "<", "T1", ",", "T2", ",", "T3", ">", "create", "(", "final", "T1", "v1", ",", "final", "T2", "v2", ",", "final", "T3", "v3", ")", "{", "return", "new", "Tuple3", "<", "T1", ...
Creates a tuple with three values. @param v1 the first value. @param v2 the second value. @param v3 the third value. @return a tuple containing the values.
[ "Creates", "a", "tuple", "with", "three", "values", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/lang/Tuple.java#L56-L58
107,193
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/lang/Tuple.java
Tuple.create
public static <T1, T2, T3, T4> Tuple4<T1, T2, T3, T4> create(final T1 v1, final T2 v2, final T3 v3, final T4 v4) { return new Tuple4<T1, T2, T3, T4>(v1, v2, v3, v4); }
java
public static <T1, T2, T3, T4> Tuple4<T1, T2, T3, T4> create(final T1 v1, final T2 v2, final T3 v3, final T4 v4) { return new Tuple4<T1, T2, T3, T4>(v1, v2, v3, v4); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ">", "Tuple4", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ">", "create", "(", "final", "T1", "v1", ",", "final", "T2", "v2", ",", "final", "T3", "v3", ",", "final", "T4", "v4", ...
Creates a tuple with four values. @param v1 the first value. @param v2 the second value. @param v3 the third value. @param v4 the fourth value. @return a tuple containing the values.
[ "Creates", "a", "tuple", "with", "four", "values", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/lang/Tuple.java#L69-L71
107,194
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/lang/Tuple.java
Tuple.create
public static <T1, T2, T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> create(final T1 v1, final T2 v2, final T3 v3, final T4 v4, final T5 v5) { return new Tuple5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); }
java
public static <T1, T2, T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> create(final T1 v1, final T2 v2, final T3 v3, final T4 v4, final T5 v5) { return new Tuple5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ">", "Tuple5", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ">", "create", "(", "final", "T1", "v1", ",", "final", "T2", "v2", ",", "final", "T3", "v3", ",...
Creates a tuple with five values. @param v1 the first value. @param v2 the second value. @param v3 the third value. @param v4 the fourth value. @param v5 the fifth value. @return a tuple containing the values.
[ "Creates", "a", "tuple", "with", "five", "values", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/lang/Tuple.java#L83-L86
107,195
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/message/internal/DiagnosticsReport.java
DiagnosticsReport.exportToJson
public String exportToJson(boolean pretty) { Map<String, Object> result = new HashMap<String, Object>(); Map<String, List<Map<String, Object>>> services = new HashMap<String, List<Map<String, Object>>>(); for (EndpointHealth h : endpoints) { String type = serviceTypeFromEnum(h.type(...
java
public String exportToJson(boolean pretty) { Map<String, Object> result = new HashMap<String, Object>(); Map<String, List<Map<String, Object>>> services = new HashMap<String, List<Map<String, Object>>>(); for (EndpointHealth h : endpoints) { String type = serviceTypeFromEnum(h.type(...
[ "public", "String", "exportToJson", "(", "boolean", "pretty", ")", "{", "Map", "<", "String", ",", "Object", ">", "result", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "Map", "<", "String", ",", "List", "<", "Map", "<", ...
Exports this report into the standard JSON format which is consistent across different language SDKs. @return the encoded JSON string.
[ "Exports", "this", "report", "into", "the", "standard", "JSON", "format", "which", "is", "consistent", "across", "different", "language", "SDKs", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/internal/DiagnosticsReport.java#L103-L130
107,196
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/config/DefaultConfigurationProvider.java
DefaultConfigurationProvider.upsertBucketConfig
private void upsertBucketConfig(final BucketConfig newConfig) { ClusterConfig cluster = currentConfig; BucketConfig oldConfig = cluster.bucketConfig(newConfig.name()); if (newConfig.rev() > 0 && oldConfig != null && newConfig.rev() <= oldConfig.rev()) { LOGGER.trace("Not applying ne...
java
private void upsertBucketConfig(final BucketConfig newConfig) { ClusterConfig cluster = currentConfig; BucketConfig oldConfig = cluster.bucketConfig(newConfig.name()); if (newConfig.rev() > 0 && oldConfig != null && newConfig.rev() <= oldConfig.rev()) { LOGGER.trace("Not applying ne...
[ "private", "void", "upsertBucketConfig", "(", "final", "BucketConfig", "newConfig", ")", "{", "ClusterConfig", "cluster", "=", "currentConfig", ";", "BucketConfig", "oldConfig", "=", "cluster", ".", "bucketConfig", "(", "newConfig", ".", "name", "(", ")", ")", "...
Helper method which takes the given bucket config and applies it to the cluster config. This method also sends out an update to the subject afterwards, so that observers are notified. @param newConfig the configuration of the bucket.
[ "Helper", "method", "which", "takes", "the", "given", "bucket", "config", "and", "applies", "it", "to", "the", "cluster", "config", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/DefaultConfigurationProvider.java#L492-L539
107,197
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/config/DefaultConfigurationProvider.java
DefaultConfigurationProvider.determineNetworkResolution
public static String determineNetworkResolution(final BucketConfig config, final NetworkResolution nr, final Set<NetworkAddress> seedHosts) { if (nr.equals(NetworkResolution.DEFAULT)) { return null; } else if (nr.equals(NetworkResolution.AUTO)) { for (NodeInfo info : conf...
java
public static String determineNetworkResolution(final BucketConfig config, final NetworkResolution nr, final Set<NetworkAddress> seedHosts) { if (nr.equals(NetworkResolution.DEFAULT)) { return null; } else if (nr.equals(NetworkResolution.AUTO)) { for (NodeInfo info : conf...
[ "public", "static", "String", "determineNetworkResolution", "(", "final", "BucketConfig", "config", ",", "final", "NetworkResolution", "nr", ",", "final", "Set", "<", "NetworkAddress", ">", "seedHosts", ")", "{", "if", "(", "nr", ".", "equals", "(", "NetworkReso...
Helper method to figure out which network resolution should be used. if DEFAULT is selected, then null is returned which is equal to the "internal" or default config mode. If AUTO is used then we perform the select heuristic based off of the seed hosts given. All other resolution settings (i.e. EXTERNAL) are returned ...
[ "Helper", "method", "to", "figure", "out", "which", "network", "resolution", "should", "be", "used", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/DefaultConfigurationProvider.java#L554-L578
107,198
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/utils/HealthPinger.java
HealthPinger.mapToServiceHealth
private static Observable<PingServiceHealth> mapToServiceHealth(final String scope, final ServiceType type, final Observable<? extends CouchbaseResponse> input, final AtomicReference<CouchbaseRequest> request, final long timeout, final TimeUnit timeUnit) { return input .map(new Func1...
java
private static Observable<PingServiceHealth> mapToServiceHealth(final String scope, final ServiceType type, final Observable<? extends CouchbaseResponse> input, final AtomicReference<CouchbaseRequest> request, final long timeout, final TimeUnit timeUnit) { return input .map(new Func1...
[ "private", "static", "Observable", "<", "PingServiceHealth", ">", "mapToServiceHealth", "(", "final", "String", "scope", ",", "final", "ServiceType", "type", ",", "final", "Observable", "<", "?", "extends", "CouchbaseResponse", ">", "input", ",", "final", "AtomicR...
Helper method to perform the proper health conversion. @param input the response input @return the converted output.
[ "Helper", "method", "to", "perform", "the", "proper", "health", "conversion", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/utils/HealthPinger.java#L190-L240
107,199
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueFeatureHandler.java
KeyValueFeatureHandler.helloRequest
private FullBinaryMemcacheRequest helloRequest(int connId) throws Exception { byte[] key = generateAgentJson( ctx.environment().userAgent(), ctx.coreId(), connId ); short keyLength = (short) key.length; ByteBuf wanted = Unpooled.buffer(features.size()...
java
private FullBinaryMemcacheRequest helloRequest(int connId) throws Exception { byte[] key = generateAgentJson( ctx.environment().userAgent(), ctx.coreId(), connId ); short keyLength = (short) key.length; ByteBuf wanted = Unpooled.buffer(features.size()...
[ "private", "FullBinaryMemcacheRequest", "helloRequest", "(", "int", "connId", ")", "throws", "Exception", "{", "byte", "[", "]", "key", "=", "generateAgentJson", "(", "ctx", ".", "environment", "(", ")", ".", "userAgent", "(", ")", ",", "ctx", ".", "coreId",...
Creates the HELLO request to ask for certain supported features. @param connId the connection id @return the request to send over the wire
[ "Creates", "the", "HELLO", "request", "to", "ask", "for", "certain", "supported", "features", "." ]
97f0427112c2168fee1d6499904f5fa0e24c6797
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueFeatureHandler.java#L130-L149