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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
105,000 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.processNextPage | private void processNextPage() throws IOException {
int bitOffset = sasFileProperties.isU64() ? PAGE_BIT_OFFSET_X64 : PAGE_BIT_OFFSET_X86;
currentPageDataSubheaderPointers.clear();
try {
sasFileStream.readFully(cachedPage, 0, sasFileProperties.getPageLength());
} catch (EOFE... | java | private void processNextPage() throws IOException {
int bitOffset = sasFileProperties.isU64() ? PAGE_BIT_OFFSET_X64 : PAGE_BIT_OFFSET_X86;
currentPageDataSubheaderPointers.clear();
try {
sasFileStream.readFully(cachedPage, 0, sasFileProperties.getPageLength());
} catch (EOFE... | [
"private",
"void",
"processNextPage",
"(",
")",
"throws",
"IOException",
"{",
"int",
"bitOffset",
"=",
"sasFileProperties",
".",
"isU64",
"(",
")",
"?",
"PAGE_BIT_OFFSET_X64",
":",
"PAGE_BIT_OFFSET_X86",
";",
"currentPageDataSubheaderPointers",
".",
"clear",
"(",
")... | Put next page to cache and read it's header.
@throws IOException if reading from the {@link SasFileParser#sasFileStream} string is impossible. | [
"Put",
"next",
"page",
"to",
"cache",
"and",
"read",
"it",
"s",
"header",
"."
] | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L576-L596 |
105,001 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.processMissingColumnInfo | private void processMissingColumnInfo() throws UnsupportedEncodingException {
for (ColumnMissingInfo columnMissingInfo : columnMissingInfoList) {
String missedInfo = bytesToString(columnsNamesBytes.get(columnMissingInfo.getTextSubheaderIndex()),
columnMissingInfo.getOffset(), col... | java | private void processMissingColumnInfo() throws UnsupportedEncodingException {
for (ColumnMissingInfo columnMissingInfo : columnMissingInfoList) {
String missedInfo = bytesToString(columnsNamesBytes.get(columnMissingInfo.getTextSubheaderIndex()),
columnMissingInfo.getOffset(), col... | [
"private",
"void",
"processMissingColumnInfo",
"(",
")",
"throws",
"UnsupportedEncodingException",
"{",
"for",
"(",
"ColumnMissingInfo",
"columnMissingInfo",
":",
"columnMissingInfoList",
")",
"{",
"String",
"missedInfo",
"=",
"bytesToString",
"(",
"columnsNamesBytes",
".... | The function to process missing column information.
@throws UnsupportedEncodingException when unknown encoding. | [
"The",
"function",
"to",
"process",
"missing",
"column",
"information",
"."
] | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L603-L622 |
105,002 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.processByteArrayWithData | private Object[] processByteArrayWithData(long rowOffset, long rowLength, List<String> columnNames) {
Object[] rowElements;
if (columnNames != null) {
rowElements = new Object[columnNames.size()];
} else {
rowElements = new Object[(int) sasFileProperties.getColumnsCount()... | java | private Object[] processByteArrayWithData(long rowOffset, long rowLength, List<String> columnNames) {
Object[] rowElements;
if (columnNames != null) {
rowElements = new Object[columnNames.size()];
} else {
rowElements = new Object[(int) sasFileProperties.getColumnsCount()... | [
"private",
"Object",
"[",
"]",
"processByteArrayWithData",
"(",
"long",
"rowOffset",
",",
"long",
"rowLength",
",",
"List",
"<",
"String",
">",
"columnNames",
")",
"{",
"Object",
"[",
"]",
"rowElements",
";",
"if",
"(",
"columnNames",
"!=",
"null",
")",
"{... | The function to convert the array of bytes that stores the data of a row into an array of objects.
Each object corresponds to a table cell.
@param rowOffset - the offset of the row in cachedPage.
@param rowLength - the length of the row.
@param columnNames - list of column names which should be processed.
@return ... | [
"The",
"function",
"to",
"convert",
"the",
"array",
"of",
"bytes",
"that",
"stores",
"the",
"data",
"of",
"a",
"row",
"into",
"an",
"array",
"of",
"objects",
".",
"Each",
"object",
"corresponds",
"to",
"a",
"table",
"cell",
"."
] | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L654-L686 |
105,003 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.processElement | private Object processElement(byte[] source, int offset, int currentColumnIndex) {
byte[] temp;
int length = columnsDataLength.get(currentColumnIndex);
if (columns.get(currentColumnIndex).getType() == Number.class) {
temp = Arrays.copyOfRange(source, offset + (int) (long) columnsData... | java | private Object processElement(byte[] source, int offset, int currentColumnIndex) {
byte[] temp;
int length = columnsDataLength.get(currentColumnIndex);
if (columns.get(currentColumnIndex).getType() == Number.class) {
temp = Arrays.copyOfRange(source, offset + (int) (long) columnsData... | [
"private",
"Object",
"processElement",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"offset",
",",
"int",
"currentColumnIndex",
")",
"{",
"byte",
"[",
"]",
"temp",
";",
"int",
"length",
"=",
"columnsDataLength",
".",
"get",
"(",
"currentColumnIndex",
")",
... | The function to process element of row.
@param source an array of bytes containing required data.
@param offset the offset in source of required data.
@param currentColumnIndex index of the current element.
@return object storing the data of the element. | [
"The",
"function",
"to",
"process",
"element",
"of",
"row",
"."
] | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L696-L733 |
105,004 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.getBytesFromFile | private List<byte[]> getBytesFromFile(Long[] offset, Integer[] length) throws IOException {
List<byte[]> vars = new ArrayList<byte[]>();
if (cachedPage == null) {
for (int i = 0; i < offset.length; i++) {
byte[] temp = new byte[length[i]];
long actuallySkipped... | java | private List<byte[]> getBytesFromFile(Long[] offset, Integer[] length) throws IOException {
List<byte[]> vars = new ArrayList<byte[]>();
if (cachedPage == null) {
for (int i = 0; i < offset.length; i++) {
byte[] temp = new byte[length[i]];
long actuallySkipped... | [
"private",
"List",
"<",
"byte",
"[",
"]",
">",
"getBytesFromFile",
"(",
"Long",
"[",
"]",
"offset",
",",
"Integer",
"[",
"]",
"length",
")",
"throws",
"IOException",
"{",
"List",
"<",
"byte",
"[",
"]",
">",
"vars",
"=",
"new",
"ArrayList",
"<",
"byte... | The function to read the list of bytes arrays from the sas7bdat file. The array of offsets and the array of
lengths serve as input data that define the location and number of bytes the function must read.
@param offset the array of offsets.
@param length the array of lengths.
@return the list of bytes arrays.
@throws ... | [
"The",
"function",
"to",
"read",
"the",
"list",
"of",
"bytes",
"arrays",
"from",
"the",
"sas7bdat",
"file",
".",
"The",
"array",
"of",
"offsets",
"and",
"the",
"array",
"of",
"lengths",
"serve",
"as",
"input",
"data",
"that",
"define",
"the",
"location",
... | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L744-L774 |
105,005 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.bytesToString | private String bytesToString(byte[] bytes, int offset, int length)
throws UnsupportedEncodingException, StringIndexOutOfBoundsException {
return new String(bytes, offset, length, encoding);
} | java | private String bytesToString(byte[] bytes, int offset, int length)
throws UnsupportedEncodingException, StringIndexOutOfBoundsException {
return new String(bytes, offset, length, encoding);
} | [
"private",
"String",
"bytesToString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"UnsupportedEncodingException",
",",
"StringIndexOutOfBoundsException",
"{",
"return",
"new",
"String",
"(",
"bytes",
",",
"offset",
... | The function to convert a sub-range of an array of bytes into a string.
@param bytes a string represented by an array of bytes.
@param offset the initial offset
@param length the length
@return the conversion result string.
@throws UnsupportedEncodingException when unknown encoding.
@throws StringIndexOutOfBoundsE... | [
"The",
"function",
"to",
"convert",
"a",
"sub",
"-",
"range",
"of",
"an",
"array",
"of",
"bytes",
"into",
"a",
"string",
"."
] | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L886-L889 |
105,006 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.bytesToDouble | private double bytesToDouble(byte[] bytes) {
ByteBuffer original = byteArrayToByteBuffer(bytes);
if (bytes.length < BYTES_IN_DOUBLE) {
ByteBuffer byteBuffer = ByteBuffer.allocate(BYTES_IN_DOUBLE);
if (sasFileProperties.getEndianness() == 1) {
byteBuffer.position(... | java | private double bytesToDouble(byte[] bytes) {
ByteBuffer original = byteArrayToByteBuffer(bytes);
if (bytes.length < BYTES_IN_DOUBLE) {
ByteBuffer byteBuffer = ByteBuffer.allocate(BYTES_IN_DOUBLE);
if (sasFileProperties.getEndianness() == 1) {
byteBuffer.position(... | [
"private",
"double",
"bytesToDouble",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"ByteBuffer",
"original",
"=",
"byteArrayToByteBuffer",
"(",
"bytes",
")",
";",
"if",
"(",
"bytes",
".",
"length",
"<",
"BYTES_IN_DOUBLE",
")",
"{",
"ByteBuffer",
"byteBuffer",
"... | The function to convert an array of bytes into a double number.
@param bytes a double number represented by an array of bytes.
@return a number of the double type that is the conversion result. | [
"The",
"function",
"to",
"convert",
"an",
"array",
"of",
"bytes",
"into",
"a",
"double",
"number",
"."
] | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L925-L940 |
105,007 | epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.trimBytesArray | private byte[] trimBytesArray(byte[] source, int offset, int length) {
int lengthFromBegin;
for (lengthFromBegin = offset + length; lengthFromBegin > offset; lengthFromBegin--) {
if (source[lengthFromBegin - 1] != ' ' && source[lengthFromBegin - 1] != '\0'
&& source[lengt... | java | private byte[] trimBytesArray(byte[] source, int offset, int length) {
int lengthFromBegin;
for (lengthFromBegin = offset + length; lengthFromBegin > offset; lengthFromBegin--) {
if (source[lengthFromBegin - 1] != ' ' && source[lengthFromBegin - 1] != '\0'
&& source[lengt... | [
"private",
"byte",
"[",
"]",
"trimBytesArray",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"int",
"lengthFromBegin",
";",
"for",
"(",
"lengthFromBegin",
"=",
"offset",
"+",
"length",
";",
"lengthFromBegin",
">",
... | The function to remove excess symbols from the end of a bytes array. Excess symbols are line end characters,
tabulation characters, and spaces, which do not contain useful information.
@param source an array of bytes containing required data.
@param offset the offset in source of required data.
@param length the lengt... | [
"The",
"function",
"to",
"remove",
"excess",
"symbols",
"from",
"the",
"end",
"of",
"a",
"bytes",
"array",
".",
"Excess",
"symbols",
"are",
"line",
"end",
"characters",
"tabulation",
"characters",
"and",
"spaces",
"which",
"do",
"not",
"contain",
"useful",
"... | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L951-L965 |
105,008 | camunda/camunda-bpm-platform-osgi | camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/el/OSGiELResolver.java | OSGiELResolver.checkRegisteredServicesByLdapFilter | private Object checkRegisteredServicesByLdapFilter(String filter) throws InvalidSyntaxException {
ServiceReference<?>[] references = getBundleContext().getServiceReferences((String) null, filter);
if (isEmptyOrNull(references)) {
return null;
}
if (references.length == 1) {
return getBundleC... | java | private Object checkRegisteredServicesByLdapFilter(String filter) throws InvalidSyntaxException {
ServiceReference<?>[] references = getBundleContext().getServiceReferences((String) null, filter);
if (isEmptyOrNull(references)) {
return null;
}
if (references.length == 1) {
return getBundleC... | [
"private",
"Object",
"checkRegisteredServicesByLdapFilter",
"(",
"String",
"filter",
")",
"throws",
"InvalidSyntaxException",
"{",
"ServiceReference",
"<",
"?",
">",
"[",
"]",
"references",
"=",
"getBundleContext",
"(",
")",
".",
"getServiceReferences",
"(",
"(",
"S... | Checks the OSGi ServiceRegistry if a service matching the given filter is
present.
@param filter
the LDAP filter
@return null if no service could be found or the service object
@throws InvalidSyntaxException
if the filter has an invalid syntax
@throws RuntimeException
if more than one service is found | [
"Checks",
"the",
"OSGi",
"ServiceRegistry",
"if",
"a",
"service",
"matching",
"the",
"given",
"filter",
"is",
"present",
"."
] | b91c6a68895947b320a7a5edf0db7158e945c4bb | https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/el/OSGiELResolver.java#L75-L84 |
105,009 | camunda/camunda-bpm-platform-osgi | camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/internal/impl/ProcessDefinitionDeployerImpl.java | ProcessDefinitionDeployerImpl.getPath | private String getPath(URL url) {
String path = url.toExternalForm();
return path.replaceAll("bundle://[^/]*/", "");
} | java | private String getPath(URL url) {
String path = url.toExternalForm();
return path.replaceAll("bundle://[^/]*/", "");
} | [
"private",
"String",
"getPath",
"(",
"URL",
"url",
")",
"{",
"String",
"path",
"=",
"url",
".",
"toExternalForm",
"(",
")",
";",
"return",
"path",
".",
"replaceAll",
"(",
"\"bundle://[^/]*/\"",
",",
"\"\"",
")",
";",
"}"
] | remove bundle protocol specific part, so that resource can be accessed by
path relative to bundle root | [
"remove",
"bundle",
"protocol",
"specific",
"part",
"so",
"that",
"resource",
"can",
"be",
"accessed",
"by",
"path",
"relative",
"to",
"bundle",
"root"
] | b91c6a68895947b320a7a5edf0db7158e945c4bb | https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/internal/impl/ProcessDefinitionDeployerImpl.java#L73-L76 |
105,010 | camunda/camunda-bpm-platform-osgi | camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/util/HeaderParser.java | HeaderParser.parseHeader | public static List<PathElement> parseHeader(String header) {
List<PathElement> elements = new ArrayList<PathElement>();
if (header == null || header.trim().length() == 0) {
return elements;
}
String[] clauses = header.split(",");
for (String clause : clauses) {
... | java | public static List<PathElement> parseHeader(String header) {
List<PathElement> elements = new ArrayList<PathElement>();
if (header == null || header.trim().length() == 0) {
return elements;
}
String[] clauses = header.split(",");
for (String clause : clauses) {
... | [
"public",
"static",
"List",
"<",
"PathElement",
">",
"parseHeader",
"(",
"String",
"header",
")",
"{",
"List",
"<",
"PathElement",
">",
"elements",
"=",
"new",
"ArrayList",
"<",
"PathElement",
">",
"(",
")",
";",
"if",
"(",
"header",
"==",
"null",
"||",
... | Parse a given OSGi header into a list of paths
@param header the OSGi header to parse
@return the list of paths extracted from this header | [
"Parse",
"a",
"given",
"OSGi",
"header",
"into",
"a",
"list",
"of",
"paths"
] | b91c6a68895947b320a7a5edf0db7158e945c4bb | https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/util/HeaderParser.java#L39-L71 |
105,011 | camunda/camunda-bpm-platform-osgi | camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/internal/ProcessDefinitionParser.java | ProcessDefinitionParser.addEntries | private static void addEntries(Bundle bundle, String path,
String filePattern, List<URL> pathList) {
Enumeration<?> e = bundle.findEntries(path, filePattern, false);
while (e != null && e.hasMoreElements()) {
URL u = (URL) e.nextElement();
pathList.add(u);
}
} | java | private static void addEntries(Bundle bundle, String path,
String filePattern, List<URL> pathList) {
Enumeration<?> e = bundle.findEntries(path, filePattern, false);
while (e != null && e.hasMoreElements()) {
URL u = (URL) e.nextElement();
pathList.add(u);
}
} | [
"private",
"static",
"void",
"addEntries",
"(",
"Bundle",
"bundle",
",",
"String",
"path",
",",
"String",
"filePattern",
",",
"List",
"<",
"URL",
">",
"pathList",
")",
"{",
"Enumeration",
"<",
"?",
">",
"e",
"=",
"bundle",
".",
"findEntries",
"(",
"path"... | Searches the bundle for files matching the path and filepattern and puts
them into the list.
@param bundle
@param path
@param filePattern
@param pathList | [
"Searches",
"the",
"bundle",
"for",
"files",
"matching",
"the",
"path",
"and",
"filepattern",
"and",
"puts",
"them",
"into",
"the",
"list",
"."
] | b91c6a68895947b320a7a5edf0db7158e945c4bb | https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/internal/ProcessDefinitionParser.java#L104-L111 |
105,012 | camunda/camunda-bpm-platform-osgi | camunda-bpm-osgi-fileinstall/src/main/java/org/camunda/bpm/extension/osgi/fileinstall/impl/BpmnURLHandler.java | BpmnURLHandler.openConnection | @Override
public URLConnection openConnection(URL url) throws IOException {
if (url.getPath() == null || url.getPath().trim().length() == 0) {
throw new MalformedURLException("Path can not be null or empty. Syntax: " + SYNTAX );
}
bpmnXmlURL = new URL(url.getPath());
log... | java | @Override
public URLConnection openConnection(URL url) throws IOException {
if (url.getPath() == null || url.getPath().trim().length() == 0) {
throw new MalformedURLException("Path can not be null or empty. Syntax: " + SYNTAX );
}
bpmnXmlURL = new URL(url.getPath());
log... | [
"@",
"Override",
"public",
"URLConnection",
"openConnection",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"url",
".",
"getPath",
"(",
")",
"==",
"null",
"||",
"url",
".",
"getPath",
"(",
")",
".",
"trim",
"(",
")",
".",
"length",
... | Open the connection for the given URL.
@param url the url from which to open a connection.
@return a connection on the specified URL.
@throws IOException if an error occurs or if the URL is malformed. | [
"Open",
"the",
"connection",
"for",
"the",
"given",
"URL",
"."
] | b91c6a68895947b320a7a5edf0db7158e945c4bb | https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi-fileinstall/src/main/java/org/camunda/bpm/extension/osgi/fileinstall/impl/BpmnURLHandler.java#L47-L56 |
105,013 | camunda/camunda-bpm-platform-osgi | camunda-bpm-osgi-configadmin/src/main/java/org/camunda/bpm/extension/osgi/configadmin/impl/ManagedProcessEngineFactoryImpl.java | ManagedProcessEngineFactoryImpl.hasPropertiesConfiguration | @SuppressWarnings("unchecked")
private boolean hasPropertiesConfiguration(Dictionary properties) {
HashMap<Object, Object> mapProperties = new HashMap<Object, Object>(properties.size());
for (Object key : Collections.list(properties.keys())) {
mapProperties.put(key, properties.get(key));
}
mapPr... | java | @SuppressWarnings("unchecked")
private boolean hasPropertiesConfiguration(Dictionary properties) {
HashMap<Object, Object> mapProperties = new HashMap<Object, Object>(properties.size());
for (Object key : Collections.list(properties.keys())) {
mapProperties.put(key, properties.get(key));
}
mapPr... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"hasPropertiesConfiguration",
"(",
"Dictionary",
"properties",
")",
"{",
"HashMap",
"<",
"Object",
",",
"Object",
">",
"mapProperties",
"=",
"new",
"HashMap",
"<",
"Object",
",",
"Object",
... | It happends that the factory get called with properties that only contain
service.pid and service.factoryPid. If that happens we don't want to create
an engine.
@param properties
@return | [
"It",
"happends",
"that",
"the",
"factory",
"get",
"called",
"with",
"properties",
"that",
"only",
"contain",
"service",
".",
"pid",
"and",
"service",
".",
"factoryPid",
".",
"If",
"that",
"happens",
"we",
"don",
"t",
"want",
"to",
"create",
"an",
"engine"... | b91c6a68895947b320a7a5edf0db7158e945c4bb | https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi-configadmin/src/main/java/org/camunda/bpm/extension/osgi/configadmin/impl/ManagedProcessEngineFactoryImpl.java#L81-L90 |
105,014 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/servlets/PipelineServlet.java | PipelineServlet.baseUrl | public static String baseUrl() {
String baseURL = System.getProperty(BASE_URL_PROPERTY, "/_ah/pipeline/");
if (!baseURL.endsWith("/")) {
baseURL += "/";
}
return baseURL;
} | java | public static String baseUrl() {
String baseURL = System.getProperty(BASE_URL_PROPERTY, "/_ah/pipeline/");
if (!baseURL.endsWith("/")) {
baseURL += "/";
}
return baseURL;
} | [
"public",
"static",
"String",
"baseUrl",
"(",
")",
"{",
"String",
"baseURL",
"=",
"System",
".",
"getProperty",
"(",
"BASE_URL_PROPERTY",
",",
"\"/_ah/pipeline/\"",
")",
";",
"if",
"(",
"!",
"baseURL",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"baseURL... | Returns the Pipeline's BASE URL.
This must match the URL in web.xml | [
"Returns",
"the",
"Pipeline",
"s",
"BASE",
"URL",
".",
"This",
"must",
"match",
"the",
"URL",
"in",
"web",
".",
"xml"
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/servlets/PipelineServlet.java#L45-L51 |
105,015 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/util/JsonUtils.java | JsonUtils.toJson | private static String toJson(Object x) {
try {
if (x == null || x instanceof String || x instanceof Number || x instanceof Character
|| x.getClass().isArray() || x instanceof Iterable<?>) {
return new JSONObject().put("JSON", x).toString(2);
} else if (x instanceof Map<?, ?>) {
... | java | private static String toJson(Object x) {
try {
if (x == null || x instanceof String || x instanceof Number || x instanceof Character
|| x.getClass().isArray() || x instanceof Iterable<?>) {
return new JSONObject().put("JSON", x).toString(2);
} else if (x instanceof Map<?, ?>) {
... | [
"private",
"static",
"String",
"toJson",
"(",
"Object",
"x",
")",
"{",
"try",
"{",
"if",
"(",
"x",
"==",
"null",
"||",
"x",
"instanceof",
"String",
"||",
"x",
"instanceof",
"Number",
"||",
"x",
"instanceof",
"Character",
"||",
"x",
".",
"getClass",
"("... | Convert an object into its JSON representation. | [
"Convert",
"an",
"object",
"into",
"its",
"JSON",
"representation",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/util/JsonUtils.java#L47-L62 |
105,016 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/util/JsonUtils.java | JsonUtils.fromJson | public static Object fromJson(String json) {
try {
JSONObject jsonObject = new JSONObject(json);
if (jsonObject.has("JSON")) {
return convert(jsonObject.get("JSON"));
} else {
return convert(jsonObject);
}
} catch (Exception e) {
throw new RuntimeException("json=" +... | java | public static Object fromJson(String json) {
try {
JSONObject jsonObject = new JSONObject(json);
if (jsonObject.has("JSON")) {
return convert(jsonObject.get("JSON"));
} else {
return convert(jsonObject);
}
} catch (Exception e) {
throw new RuntimeException("json=" +... | [
"public",
"static",
"Object",
"fromJson",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"JSONObject",
"jsonObject",
"=",
"new",
"JSONObject",
"(",
"json",
")",
";",
"if",
"(",
"jsonObject",
".",
"has",
"(",
"\"JSON\"",
")",
")",
"{",
"return",
"convert",
... | Convert a JSON representation into an object | [
"Convert",
"a",
"JSON",
"representation",
"into",
"an",
"object"
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/util/JsonUtils.java#L67-L78 |
105,017 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/backend/AppEngineBackEnd.java | AppEngineBackEnd.deletePipeline | @Override
public void deletePipeline(Key rootJobKey, boolean force, boolean async)
throws IllegalStateException {
if (!force) {
try {
JobRecord rootJobRecord = queryJob(rootJobKey, JobRecord.InflationType.NONE);
switch (rootJobRecord.getState()) {
case FINALIZED:
ca... | java | @Override
public void deletePipeline(Key rootJobKey, boolean force, boolean async)
throws IllegalStateException {
if (!force) {
try {
JobRecord rootJobRecord = queryJob(rootJobKey, JobRecord.InflationType.NONE);
switch (rootJobRecord.getState()) {
case FINALIZED:
ca... | [
"@",
"Override",
"public",
"void",
"deletePipeline",
"(",
"Key",
"rootJobKey",
",",
"boolean",
"force",
",",
"boolean",
"async",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"!",
"force",
")",
"{",
"try",
"{",
"JobRecord",
"rootJobRecord",
"=",
"q... | Delete all datastore entities corresponding to the given pipeline.
@param rootJobKey The root job key identifying the pipeline
@param force If this parameter is not {@code true} then this method will
throw an {@link IllegalStateException} if the specified pipeline is not in the
{@link com.google.appengine.tools.pipeli... | [
"Delete",
"all",
"datastore",
"entities",
"corresponding",
"to",
"the",
"given",
"pipeline",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/backend/AppEngineBackEnd.java#L603-L633 |
105,018 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.queryFullPipeline | public static PipelineObjects queryFullPipeline(String rootJobHandle) {
Key rootJobKey = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, rootJobHandle);
return backEnd.queryFullPipeline(rootJobKey);
} | java | public static PipelineObjects queryFullPipeline(String rootJobHandle) {
Key rootJobKey = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, rootJobHandle);
return backEnd.queryFullPipeline(rootJobKey);
} | [
"public",
"static",
"PipelineObjects",
"queryFullPipeline",
"(",
"String",
"rootJobHandle",
")",
"{",
"Key",
"rootJobKey",
"=",
"KeyFactory",
".",
"createKey",
"(",
"JobRecord",
".",
"DATA_STORE_KIND",
",",
"rootJobHandle",
")",
";",
"return",
"backEnd",
".",
"que... | Returns all the associated PipelineModelObject for a root pipeline.
@throws IllegalArgumentException if root pipeline was not found. | [
"Returns",
"all",
"the",
"associated",
"PipelineModelObject",
"for",
"a",
"root",
"pipeline",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L321-L324 |
105,019 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.getJob | public static JobRecord getJob(String jobHandle) throws NoSuchObjectException {
checkNonEmpty(jobHandle, "jobHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle);
logger.finest("getJob: " + key.getName());
return backEnd.queryJob(key, JobRecord.InflationType.FOR_OUTPUT);
} | java | public static JobRecord getJob(String jobHandle) throws NoSuchObjectException {
checkNonEmpty(jobHandle, "jobHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle);
logger.finest("getJob: " + key.getName());
return backEnd.queryJob(key, JobRecord.InflationType.FOR_OUTPUT);
} | [
"public",
"static",
"JobRecord",
"getJob",
"(",
"String",
"jobHandle",
")",
"throws",
"NoSuchObjectException",
"{",
"checkNonEmpty",
"(",
"jobHandle",
",",
"\"jobHandle\"",
")",
";",
"Key",
"key",
"=",
"KeyFactory",
".",
"createKey",
"(",
"JobRecord",
".",
"DATA... | Retrieves a JobRecord for the specified job handle. The returned instance
will be only partially inflated. The run and finalize barriers will not be
available but the output slot will be.
@param jobHandle The handle of a job.
@return The corresponding JobRecord
@throws NoSuchObjectException If a JobRecord with the giv... | [
"Retrieves",
"a",
"JobRecord",
"for",
"the",
"specified",
"job",
"handle",
".",
"The",
"returned",
"instance",
"will",
"be",
"only",
"partially",
"inflated",
".",
"The",
"run",
"and",
"finalize",
"barriers",
"will",
"not",
"be",
"available",
"but",
"the",
"o... | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L351-L356 |
105,020 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.stopJob | public static void stopJob(String jobHandle) throws NoSuchObjectException {
checkNonEmpty(jobHandle, "jobHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle);
JobRecord jobRecord = backEnd.queryJob(key, JobRecord.InflationType.NONE);
jobRecord.setState(State.STOPPED);
Updat... | java | public static void stopJob(String jobHandle) throws NoSuchObjectException {
checkNonEmpty(jobHandle, "jobHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle);
JobRecord jobRecord = backEnd.queryJob(key, JobRecord.InflationType.NONE);
jobRecord.setState(State.STOPPED);
Updat... | [
"public",
"static",
"void",
"stopJob",
"(",
"String",
"jobHandle",
")",
"throws",
"NoSuchObjectException",
"{",
"checkNonEmpty",
"(",
"jobHandle",
",",
"\"jobHandle\"",
")",
";",
"Key",
"key",
"=",
"KeyFactory",
".",
"createKey",
"(",
"JobRecord",
".",
"DATA_STO... | Changes the state of the specified job to STOPPED.
@param jobHandle The handle of a job
@throws NoSuchObjectException If a JobRecord with the given handle cannot
be found in the data store. | [
"Changes",
"the",
"state",
"of",
"the",
"specified",
"job",
"to",
"STOPPED",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L365-L373 |
105,021 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.cancelJob | public static void cancelJob(String jobHandle) throws NoSuchObjectException {
checkNonEmpty(jobHandle, "jobHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle);
JobRecord jobRecord = backEnd.queryJob(key, InflationType.NONE);
CancelJobTask cancelJobTask = new CancelJobTask(key,... | java | public static void cancelJob(String jobHandle) throws NoSuchObjectException {
checkNonEmpty(jobHandle, "jobHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle);
JobRecord jobRecord = backEnd.queryJob(key, InflationType.NONE);
CancelJobTask cancelJobTask = new CancelJobTask(key,... | [
"public",
"static",
"void",
"cancelJob",
"(",
"String",
"jobHandle",
")",
"throws",
"NoSuchObjectException",
"{",
"checkNonEmpty",
"(",
"jobHandle",
",",
"\"jobHandle\"",
")",
";",
"Key",
"key",
"=",
"KeyFactory",
".",
"createKey",
"(",
"JobRecord",
".",
"DATA_S... | Sends cancellation request to the root job.
@param jobHandle The handle of a job
@throws NoSuchObjectException If a JobRecord with the given handle cannot
be found in the data store. | [
"Sends",
"cancellation",
"request",
"to",
"the",
"root",
"job",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L382-L392 |
105,022 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.deletePipelineRecords | public static void deletePipelineRecords(String pipelineHandle, boolean force, boolean async)
throws NoSuchObjectException, IllegalStateException {
checkNonEmpty(pipelineHandle, "pipelineHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, pipelineHandle);
backEnd.deletePipeline(key, fo... | java | public static void deletePipelineRecords(String pipelineHandle, boolean force, boolean async)
throws NoSuchObjectException, IllegalStateException {
checkNonEmpty(pipelineHandle, "pipelineHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, pipelineHandle);
backEnd.deletePipeline(key, fo... | [
"public",
"static",
"void",
"deletePipelineRecords",
"(",
"String",
"pipelineHandle",
",",
"boolean",
"force",
",",
"boolean",
"async",
")",
"throws",
"NoSuchObjectException",
",",
"IllegalStateException",
"{",
"checkNonEmpty",
"(",
"pipelineHandle",
",",
"\"pipelineHan... | Delete all data store entities corresponding to the given pipeline.
@param pipelineHandle The handle of the pipeline to be deleted
@param force If this parameter is not {@code true} then this method will
throw an {@link IllegalStateException} if the specified pipeline is
not in the {@link State#FINALIZED} or {@link St... | [
"Delete",
"all",
"data",
"store",
"entities",
"corresponding",
"to",
"the",
"given",
"pipeline",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L409-L414 |
105,023 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.processTask | public static void processTask(Task task) {
logger.finest("Processing task " + task);
try {
switch (task.getType()) {
case RUN_JOB:
runJob((RunJobTask) task);
break;
case HANDLE_SLOT_FILLED:
handleSlotFilled((HandleSlotFilledTask) task);
break;
... | java | public static void processTask(Task task) {
logger.finest("Processing task " + task);
try {
switch (task.getType()) {
case RUN_JOB:
runJob((RunJobTask) task);
break;
case HANDLE_SLOT_FILLED:
handleSlotFilled((HandleSlotFilledTask) task);
break;
... | [
"public",
"static",
"void",
"processTask",
"(",
"Task",
"task",
")",
"{",
"logger",
".",
"finest",
"(",
"\"Processing task \"",
"+",
"task",
")",
";",
"try",
"{",
"switch",
"(",
"task",
".",
"getType",
"(",
")",
")",
"{",
"case",
"RUN_JOB",
":",
"runJo... | Process an incoming task received from the App Engine task queue.
@param task The task to be processed. | [
"Process",
"an",
"incoming",
"task",
"received",
"from",
"the",
"App",
"Engine",
"task",
"queue",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L518-L558 |
105,024 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.handleDelayedSlotFill | private static void handleDelayedSlotFill(DelayedSlotFillTask task) {
Key slotKey = task.getSlotKey();
Slot slot = querySlotOrAbandonTask(slotKey, true);
Key rootJobKey = task.getRootJobKey();
UpdateSpec updateSpec = new UpdateSpec(rootJobKey);
slot.fill(null);
updateSpec.getNonTransactionalGrou... | java | private static void handleDelayedSlotFill(DelayedSlotFillTask task) {
Key slotKey = task.getSlotKey();
Slot slot = querySlotOrAbandonTask(slotKey, true);
Key rootJobKey = task.getRootJobKey();
UpdateSpec updateSpec = new UpdateSpec(rootJobKey);
slot.fill(null);
updateSpec.getNonTransactionalGrou... | [
"private",
"static",
"void",
"handleDelayedSlotFill",
"(",
"DelayedSlotFillTask",
"task",
")",
"{",
"Key",
"slotKey",
"=",
"task",
".",
"getSlotKey",
"(",
")",
";",
"Slot",
"slot",
"=",
"querySlotOrAbandonTask",
"(",
"slotKey",
",",
"true",
")",
";",
"Key",
... | Fills the slot with null value and calls handleSlotFilled | [
"Fills",
"the",
"slot",
"with",
"null",
"value",
"and",
"calls",
"handleSlotFilled"
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L1162-L1172 |
105,025 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/model/Barrier.java | Barrier.addListArgumentSlots | public void addListArgumentSlots(Slot initialSlot, List<Slot> slotList) {
if (!initialSlot.isFilled()) {
throw new IllegalArgumentException("initialSlot must be filled");
}
verifyStateBeforAdd(initialSlot);
int groupSize = slotList.size() + 1;
addSlotDescriptor(new SlotDescriptor(initialSlot, ... | java | public void addListArgumentSlots(Slot initialSlot, List<Slot> slotList) {
if (!initialSlot.isFilled()) {
throw new IllegalArgumentException("initialSlot must be filled");
}
verifyStateBeforAdd(initialSlot);
int groupSize = slotList.size() + 1;
addSlotDescriptor(new SlotDescriptor(initialSlot, ... | [
"public",
"void",
"addListArgumentSlots",
"(",
"Slot",
"initialSlot",
",",
"List",
"<",
"Slot",
">",
"slotList",
")",
"{",
"if",
"(",
"!",
"initialSlot",
".",
"isFilled",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"initialSlot must ... | Adds multiple slots to this barrier's waiting-on list representing a single
Job argument of type list.
@param slotList A list of slots that will be added to the barrier and used
as the elements of the list Job argument.
@throws IllegalArgumentException if intialSlot is not filled. | [
"Adds",
"multiple",
"slots",
"to",
"this",
"barrier",
"s",
"waiting",
"-",
"on",
"list",
"representing",
"a",
"single",
"Job",
"argument",
"of",
"type",
"list",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/model/Barrier.java#L269-L279 |
105,026 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/model/JobRecord.java | JobRecord.toEntity | @Override
public Entity toEntity() {
Entity entity = toProtoEntity();
entity.setProperty(JOB_INSTANCE_PROPERTY, jobInstanceKey);
entity.setProperty(FINALIZE_BARRIER_PROPERTY, finalizeBarrierKey);
entity.setProperty(RUN_BARRIER_PROPERTY, runBarrierKey);
entity.setProperty(OUTPUT_SLOT_PROPERTY, outp... | java | @Override
public Entity toEntity() {
Entity entity = toProtoEntity();
entity.setProperty(JOB_INSTANCE_PROPERTY, jobInstanceKey);
entity.setProperty(FINALIZE_BARRIER_PROPERTY, finalizeBarrierKey);
entity.setProperty(RUN_BARRIER_PROPERTY, runBarrierKey);
entity.setProperty(OUTPUT_SLOT_PROPERTY, outp... | [
"@",
"Override",
"public",
"Entity",
"toEntity",
"(",
")",
"{",
"Entity",
"entity",
"=",
"toProtoEntity",
"(",
")",
";",
"entity",
".",
"setProperty",
"(",
"JOB_INSTANCE_PROPERTY",
",",
"jobInstanceKey",
")",
";",
"entity",
".",
"setProperty",
"(",
"FINALIZE_B... | Constructs and returns a Data Store Entity that represents this model
object | [
"Constructs",
"and",
"returns",
"a",
"Data",
"Store",
"Entity",
"that",
"represents",
"this",
"model",
"object"
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/model/JobRecord.java#L237-L282 |
105,027 | GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/model/JobRecord.java | JobRecord.createRootJobRecord | public static JobRecord createRootJobRecord(Job<?> jobInstance, JobSetting[] settings) {
Key key = generateKey(null, DATA_STORE_KIND);
return new JobRecord(key, jobInstance, settings);
} | java | public static JobRecord createRootJobRecord(Job<?> jobInstance, JobSetting[] settings) {
Key key = generateKey(null, DATA_STORE_KIND);
return new JobRecord(key, jobInstance, settings);
} | [
"public",
"static",
"JobRecord",
"createRootJobRecord",
"(",
"Job",
"<",
"?",
">",
"jobInstance",
",",
"JobSetting",
"[",
"]",
"settings",
")",
"{",
"Key",
"key",
"=",
"generateKey",
"(",
"null",
",",
"DATA_STORE_KIND",
")",
";",
"return",
"new",
"JobRecord"... | A factory method for root jobs.
@param jobInstance The non-null user-supplied instance of {@code Job} that
implements the Job that the newly created JobRecord represents.
@param settings Array of {@code JobSetting} to apply to the newly created
JobRecord. | [
"A",
"factory",
"method",
"for",
"root",
"jobs",
"."
] | 277394648dac3e8214677af898935d07399ac8e1 | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/model/JobRecord.java#L403-L406 |
105,028 | craigwblake/redline | src/main/java/org/redline_rpm/Main.java | Main.run | public void run( File file) throws SAXException, NoSuchAlgorithmException, IOException {
XmlEditor editor = new XmlEditor();
editor.read( file);
run( editor, new File( "."));
} | java | public void run( File file) throws SAXException, NoSuchAlgorithmException, IOException {
XmlEditor editor = new XmlEditor();
editor.read( file);
run( editor, new File( "."));
} | [
"public",
"void",
"run",
"(",
"File",
"file",
")",
"throws",
"SAXException",
",",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"XmlEditor",
"editor",
"=",
"new",
"XmlEditor",
"(",
")",
";",
"editor",
".",
"read",
"(",
"file",
")",
";",
"run",
"(",
... | Runs the tool using a configuration provided in the given file parameter. The configuration file
is expected to be well formed XML conforming to the Redline configuration syntax.
@param file the configuration file to use
@throws SAXException if the provided file is not well formed XML
@throws NoSuchAlgorithmException ... | [
"Runs",
"the",
"tool",
"using",
"a",
"configuration",
"provided",
"in",
"the",
"given",
"file",
"parameter",
".",
"The",
"configuration",
"file",
"is",
"expected",
"to",
"be",
"well",
"formed",
"XML",
"conforming",
"to",
"the",
"Redline",
"configuration",
"syn... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Main.java#L43-L47 |
105,029 | craigwblake/redline | src/main/java/org/redline_rpm/Main.java | Main.run | public void run( XmlEditor editor, File destination) throws NoSuchAlgorithmException, IOException {
editor.startPrefixMapping( "http://redline-rpm.org/ns", "rpm");
Contents include = new Contents();
for ( Node files : editor.findNodes( "rpm:files")) {
try {
editor.pushContext( files);
int permission =... | java | public void run( XmlEditor editor, File destination) throws NoSuchAlgorithmException, IOException {
editor.startPrefixMapping( "http://redline-rpm.org/ns", "rpm");
Contents include = new Contents();
for ( Node files : editor.findNodes( "rpm:files")) {
try {
editor.pushContext( files);
int permission =... | [
"public",
"void",
"run",
"(",
"XmlEditor",
"editor",
",",
"File",
"destination",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"editor",
".",
"startPrefixMapping",
"(",
"\"http://redline-rpm.org/ns\"",
",",
"\"rpm\"",
")",
";",
"Contents",
"inc... | Runs the tool using a configuration provided in the given configuration and output file.
@param editor the XML configuration file, parsed by the XmlEditor utility
@param destination the destination file to use in creating the RPM
@throws NoSuchAlgorithmException if an operation attempted during RPM creation fails due
... | [
"Runs",
"the",
"tool",
"using",
"a",
"configuration",
"provided",
"in",
"the",
"given",
"configuration",
"and",
"output",
"file",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Main.java#L59-L84 |
105,030 | craigwblake/redline | src/main/java/org/redline_rpm/Main.java | Main.run | public void run( XmlEditor editor, String name, String version, String release, Contents include, File destination) throws NoSuchAlgorithmException, IOException {
Builder builder = new Builder();
builder.setPackage( name, version, release);
RpmType type = RpmType.valueOf( editor.getValue( "rpm:type", BINARY.to... | java | public void run( XmlEditor editor, String name, String version, String release, Contents include, File destination) throws NoSuchAlgorithmException, IOException {
Builder builder = new Builder();
builder.setPackage( name, version, release);
RpmType type = RpmType.valueOf( editor.getValue( "rpm:type", BINARY.to... | [
"public",
"void",
"run",
"(",
"XmlEditor",
"editor",
",",
"String",
"name",
",",
"String",
"version",
",",
"String",
"release",
",",
"Contents",
"include",
",",
"File",
"destination",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"Builder",... | Runs the tool using the provided settings.
@param editor the XML configuration file, parsed by the XmlEditor utility
@param name the name of the RPM file to create
@param version the version of the created RPM
@param release the release version of the created RPM
@param include the contents to include in the generated... | [
"Runs",
"the",
"tool",
"using",
"the",
"provided",
"settings",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Main.java#L100-L122 |
105,031 | craigwblake/redline | src/main/java/org/redline_rpm/header/AbstractHeader.java | AbstractEntry.index | public void index( final ByteBuffer index, final int position) {
index.putInt( tag).putInt( getType()).putInt( position).putInt( count);
} | java | public void index( final ByteBuffer index, final int position) {
index.putInt( tag).putInt( getType()).putInt( position).putInt( count);
} | [
"public",
"void",
"index",
"(",
"final",
"ByteBuffer",
"index",
",",
"final",
"int",
"position",
")",
"{",
"index",
".",
"putInt",
"(",
"tag",
")",
".",
"putInt",
"(",
"getType",
"(",
")",
")",
".",
"putInt",
"(",
"position",
")",
".",
"putInt",
"(",... | Writes the index entry into the provided buffer at the current position. | [
"Writes",
"the",
"index",
"entry",
"into",
"the",
"provided",
"buffer",
"at",
"the",
"current",
"position",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/header/AbstractHeader.java#L476-L478 |
105,032 | craigwblake/redline | src/main/java/org/redline_rpm/DumpPayload.java | DumpPayload.main | public static void main( String[] args) throws Exception {
ReadableByteChannel in = Channels.newChannel( System.in);
new Scanner().run( new ReadableChannelWrapper( in));
FileOutputStream fout = new FileOutputStream( args[ 0]);
FileChannel out = fout.getChannel();
long position = 0;
long read;
while (( ... | java | public static void main( String[] args) throws Exception {
ReadableByteChannel in = Channels.newChannel( System.in);
new Scanner().run( new ReadableChannelWrapper( in));
FileOutputStream fout = new FileOutputStream( args[ 0]);
FileChannel out = fout.getChannel();
long position = 0;
long read;
while (( ... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"ReadableByteChannel",
"in",
"=",
"Channels",
".",
"newChannel",
"(",
"System",
".",
"in",
")",
";",
"new",
"Scanner",
"(",
")",
".",
"run",
"(",
"new... | Dumps the contents of the payload for an RPM file to
the provided file. This method accepts an RPM file from
standard input and dumps it's payload out to the file
name provided as the first argument.
@param args command line arguements
@throws Exception an exception occurred | [
"Dumps",
"the",
"contents",
"of",
"the",
"payload",
"for",
"an",
"RPM",
"file",
"to",
"the",
"provided",
"file",
".",
"This",
"method",
"accepts",
"an",
"RPM",
"file",
"from",
"standard",
"input",
"and",
"dumps",
"it",
"s",
"payload",
"out",
"to",
"the",... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/DumpPayload.java#L24-L34 |
105,033 | craigwblake/redline | src/main/java/org/redline_rpm/changelog/ChangelogHandler.java | ChangelogHandler.addChangeLog | public void addChangeLog(File changelogFile) throws IOException, ChangelogParseException {
// parse the change log to a list of entries
InputStream changelog = new FileInputStream(changelogFile);
ChangelogParser parser = new ChangelogParser();
List<ChangelogEntry> entries = parser.parse(changelog);
for (... | java | public void addChangeLog(File changelogFile) throws IOException, ChangelogParseException {
// parse the change log to a list of entries
InputStream changelog = new FileInputStream(changelogFile);
ChangelogParser parser = new ChangelogParser();
List<ChangelogEntry> entries = parser.parse(changelog);
for (... | [
"public",
"void",
"addChangeLog",
"(",
"File",
"changelogFile",
")",
"throws",
"IOException",
",",
"ChangelogParseException",
"{",
"// parse the change log to a list of entries\r",
"InputStream",
"changelog",
"=",
"new",
"FileInputStream",
"(",
"changelogFile",
")",
";",
... | Adds the specified Changelog file to the rpm
@param changelogFile the Changelog file to be added
@throws IOException if the specified file cannot be read
@throws ChangelogParseException if the file violates the requirements of a Changelog | [
"Adds",
"the",
"specified",
"Changelog",
"file",
"to",
"the",
"rpm"
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/changelog/ChangelogHandler.java#L31-L39 |
105,034 | craigwblake/redline | src/main/java/org/redline_rpm/ChannelWrapper.java | ChannelWrapper.start | public Key< Integer> start() {
final Key< Integer> object = new Key< Integer>();
consumers.put( object, new Consumer< Integer>() {
int count;
public void consume( final ByteBuffer buffer) { count += buffer.remaining(); }
public Integer finish() { return count; }
});
return object;
} | java | public Key< Integer> start() {
final Key< Integer> object = new Key< Integer>();
consumers.put( object, new Consumer< Integer>() {
int count;
public void consume( final ByteBuffer buffer) { count += buffer.remaining(); }
public Integer finish() { return count; }
});
return object;
} | [
"public",
"Key",
"<",
"Integer",
">",
"start",
"(",
")",
"{",
"final",
"Key",
"<",
"Integer",
">",
"object",
"=",
"new",
"Key",
"<",
"Integer",
">",
"(",
")",
";",
"consumers",
".",
"put",
"(",
"object",
",",
"new",
"Consumer",
"<",
"Integer",
">",... | Initializes a byte counter on this channel.
@return reference to the new key added to the consumers | [
"Initializes",
"a",
"byte",
"counter",
"on",
"this",
"channel",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/ChannelWrapper.java#L77-L85 |
105,035 | craigwblake/redline | src/main/java/org/redline_rpm/ChannelWrapper.java | ChannelWrapper.start | public Key< byte[]> start( final PrivateKey key) throws NoSuchAlgorithmException, InvalidKeyException {
final Signature signature = Signature.getInstance( key.getAlgorithm());
signature.initSign( key);
final Key< byte[]> object = new Key< byte[]>();
consumers.put( object, new Consumer< byte[]>() {
public voi... | java | public Key< byte[]> start( final PrivateKey key) throws NoSuchAlgorithmException, InvalidKeyException {
final Signature signature = Signature.getInstance( key.getAlgorithm());
signature.initSign( key);
final Key< byte[]> object = new Key< byte[]>();
consumers.put( object, new Consumer< byte[]>() {
public voi... | [
"public",
"Key",
"<",
"byte",
"[",
"]",
">",
"start",
"(",
"final",
"PrivateKey",
"key",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"final",
"Signature",
"signature",
"=",
"Signature",
".",
"getInstance",
"(",
"key",
".",
"getA... | Initialize a signature on this channel.
@param key the private key to use in signing this data stream.
@return reference to the new key added to the consumers
@throws NoSuchAlgorithmException if the key algorithm is not supported
@throws InvalidKeyException if the key provided is invalid for signing | [
"Initialize",
"a",
"signature",
"on",
"this",
"channel",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/ChannelWrapper.java#L95-L116 |
105,036 | craigwblake/redline | src/main/java/org/redline_rpm/ChannelWrapper.java | ChannelWrapper.start | public Key<byte[]> start( final PGPPrivateKey key, int algorithm ) {
BcPGPContentSignerBuilder contentSignerBuilder = new BcPGPContentSignerBuilder( algorithm, SHA1 );
final PGPSignatureGenerator signatureGenerator = new PGPSignatureGenerator( contentSignerBuilder );
try {
signatureG... | java | public Key<byte[]> start( final PGPPrivateKey key, int algorithm ) {
BcPGPContentSignerBuilder contentSignerBuilder = new BcPGPContentSignerBuilder( algorithm, SHA1 );
final PGPSignatureGenerator signatureGenerator = new PGPSignatureGenerator( contentSignerBuilder );
try {
signatureG... | [
"public",
"Key",
"<",
"byte",
"[",
"]",
">",
"start",
"(",
"final",
"PGPPrivateKey",
"key",
",",
"int",
"algorithm",
")",
"{",
"BcPGPContentSignerBuilder",
"contentSignerBuilder",
"=",
"new",
"BcPGPContentSignerBuilder",
"(",
"algorithm",
",",
"SHA1",
")",
";",
... | Initialize a PGP signatue on the channel
@param key the private key to use in signing this data stream.
@param algorithm the algorithm to use. Can be extracted from public key.
@return reference to the new key added to the consumers | [
"Initialize",
"a",
"PGP",
"signatue",
"on",
"the",
"channel"
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/ChannelWrapper.java#L125-L177 |
105,037 | craigwblake/redline | src/main/java/org/redline_rpm/ChannelWrapper.java | ChannelWrapper.start | public Key< byte[]> start( final String algorithm) throws NoSuchAlgorithmException {
final MessageDigest digest = MessageDigest.getInstance( algorithm);
final Key< byte[]> object = new Key< byte[]>();
consumers.put( object, new Consumer< byte[]>() {
public void consume( final ByteBuffer buffer) {
try {
... | java | public Key< byte[]> start( final String algorithm) throws NoSuchAlgorithmException {
final MessageDigest digest = MessageDigest.getInstance( algorithm);
final Key< byte[]> object = new Key< byte[]>();
consumers.put( object, new Consumer< byte[]>() {
public void consume( final ByteBuffer buffer) {
try {
... | [
"public",
"Key",
"<",
"byte",
"[",
"]",
">",
"start",
"(",
"final",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"final",
"MessageDigest",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"algorithm",
")",
";",
"final",
"Key",... | Initialize a digest on this channel.
@param algorithm the digest algorithm to use in computing the hash
@return reference to the new key added to the consumers
@throws NoSuchAlgorithmException if the given algorithm does not exist | [
"Initialize",
"a",
"digest",
"on",
"this",
"channel",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/ChannelWrapper.java#L186-L206 |
105,038 | craigwblake/redline | src/main/java/org/redline_rpm/Util.java | Util.fill | public static ByteBuffer fill( ReadableByteChannel in, int size) throws IOException {
return fill( in, ByteBuffer.allocate( size));
} | java | public static ByteBuffer fill( ReadableByteChannel in, int size) throws IOException {
return fill( in, ByteBuffer.allocate( size));
} | [
"public",
"static",
"ByteBuffer",
"fill",
"(",
"ReadableByteChannel",
"in",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"return",
"fill",
"(",
"in",
",",
"ByteBuffer",
".",
"allocate",
"(",
"size",
")",
")",
";",
"}"
] | Creates a new buffer and fills it with bytes from the
provided channel. The amount of data to read is specified
in the arguments.
@param in the channel to read from
@param size the number of bytes to read into a new buffer
@return a new buffer containing the bytes read
@throws IOException if an IO error occurs | [
"Creates",
"a",
"new",
"buffer",
"and",
"fills",
"it",
"with",
"bytes",
"from",
"the",
"provided",
"channel",
".",
"The",
"amount",
"of",
"data",
"to",
"read",
"is",
"specified",
"in",
"the",
"arguments",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Util.java#L59-L61 |
105,039 | craigwblake/redline | src/main/java/org/redline_rpm/Util.java | Util.fill | public static ByteBuffer fill( ReadableByteChannel in, ByteBuffer buffer) throws IOException {
while ( buffer.hasRemaining()) if ( in.read( buffer) == -1) throw new BufferUnderflowException();
buffer.flip();
return buffer;
} | java | public static ByteBuffer fill( ReadableByteChannel in, ByteBuffer buffer) throws IOException {
while ( buffer.hasRemaining()) if ( in.read( buffer) == -1) throw new BufferUnderflowException();
buffer.flip();
return buffer;
} | [
"public",
"static",
"ByteBuffer",
"fill",
"(",
"ReadableByteChannel",
"in",
",",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"while",
"(",
"buffer",
".",
"hasRemaining",
"(",
")",
")",
"if",
"(",
"in",
".",
"read",
"(",
"buffer",
")",
"==",
... | Fills the provided buffer it with bytes from the
provided channel. The amount of data to read is
dependant on the available space in the provided
buffer.
@param in the channel to read from
@param buffer the buffer to read into
@return the provided buffer
@throws IOException if an IO error occurs | [
"Fills",
"the",
"provided",
"buffer",
"it",
"with",
"bytes",
"from",
"the",
"provided",
"channel",
".",
"The",
"amount",
"of",
"data",
"to",
"read",
"is",
"dependant",
"on",
"the",
"available",
"space",
"in",
"the",
"provided",
"buffer",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Util.java#L74-L78 |
105,040 | craigwblake/redline | src/main/java/org/redline_rpm/Util.java | Util.empty | public static void empty( WritableByteChannel out, ByteBuffer buffer) throws IOException {
while ( buffer.hasRemaining()) out.write( buffer);
} | java | public static void empty( WritableByteChannel out, ByteBuffer buffer) throws IOException {
while ( buffer.hasRemaining()) out.write( buffer);
} | [
"public",
"static",
"void",
"empty",
"(",
"WritableByteChannel",
"out",
",",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"while",
"(",
"buffer",
".",
"hasRemaining",
"(",
")",
")",
"out",
".",
"write",
"(",
"buffer",
")",
";",
"}"
] | Empties the contents of the given buffer into the
writable channel provided. The buffer will be copied
to the channel in it's entirety.
@param out the channel to write to
@param buffer the buffer to write out to the channel
@throws IOException if an IO error occurs | [
"Empties",
"the",
"contents",
"of",
"the",
"given",
"buffer",
"into",
"the",
"writable",
"channel",
"provided",
".",
"The",
"buffer",
"will",
"be",
"copied",
"to",
"the",
"channel",
"in",
"it",
"s",
"entirety",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Util.java#L89-L91 |
105,041 | craigwblake/redline | src/main/java/org/redline_rpm/Util.java | Util.check | public static void check( byte expected, byte actual) throws IOException {
if ( expected != actual) throw new IOException( "check expected " + Integer.toHexString( 0xff & expected) + ", found " + Integer.toHexString( 0xff & actual));
} | java | public static void check( byte expected, byte actual) throws IOException {
if ( expected != actual) throw new IOException( "check expected " + Integer.toHexString( 0xff & expected) + ", found " + Integer.toHexString( 0xff & actual));
} | [
"public",
"static",
"void",
"check",
"(",
"byte",
"expected",
",",
"byte",
"actual",
")",
"throws",
"IOException",
"{",
"if",
"(",
"expected",
"!=",
"actual",
")",
"throw",
"new",
"IOException",
"(",
"\"check expected \"",
"+",
"Integer",
".",
"toHexString",
... | Checks that two bytes are the same, while generating
a formatted error message if they are not. The error
message will indicate the hex value of the bytes if
they do not match.
@param expected the expected value
@param actual the actual value
@throws IOException if the two values do not match | [
"Checks",
"that",
"two",
"bytes",
"are",
"the",
"same",
"while",
"generating",
"a",
"formatted",
"error",
"message",
"if",
"they",
"are",
"not",
".",
"The",
"error",
"message",
"will",
"indicate",
"the",
"hex",
"value",
"of",
"the",
"bytes",
"if",
"they",
... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Util.java#L117-L119 |
105,042 | craigwblake/redline | src/main/java/org/redline_rpm/Util.java | Util.pad | public static void pad( ByteBuffer buffer, int boundary) {
buffer.position( round( buffer.position(), boundary));
} | java | public static void pad( ByteBuffer buffer, int boundary) {
buffer.position( round( buffer.position(), boundary));
} | [
"public",
"static",
"void",
"pad",
"(",
"ByteBuffer",
"buffer",
",",
"int",
"boundary",
")",
"{",
"buffer",
".",
"position",
"(",
"round",
"(",
"buffer",
".",
"position",
"(",
")",
",",
"boundary",
")",
")",
";",
"}"
] | Pads the given buffer up to the indicated boundary.
The RPM file format requires that headers be aligned
with various boundaries, this method pads output
to match the requirements.
@param buffer the buffer to pad zeros into
@param boundary the boundary to which we need to pad | [
"Pads",
"the",
"given",
"buffer",
"up",
"to",
"the",
"indicated",
"boundary",
".",
"The",
"RPM",
"file",
"format",
"requires",
"that",
"headers",
"be",
"aligned",
"with",
"various",
"boundaries",
"this",
"method",
"pads",
"output",
"to",
"match",
"the",
"req... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Util.java#L138-L140 |
105,043 | craigwblake/redline | src/main/java/org/redline_rpm/XmlEditor.java | XmlEditor.readDocument | public static Document readDocument( File file) throws SAXException, IOException {
InputStream in = new FileInputStream( file);
Document result = readDocument( in);
in.close();
return result;
} | java | public static Document readDocument( File file) throws SAXException, IOException {
InputStream in = new FileInputStream( file);
Document result = readDocument( in);
in.close();
return result;
} | [
"public",
"static",
"Document",
"readDocument",
"(",
"File",
"file",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"InputStream",
"in",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"Document",
"result",
"=",
"readDocument",
"(",
"in",
")",
... | Static API follows | [
"Static",
"API",
"follows"
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/XmlEditor.java#L327-L332 |
105,044 | craigwblake/redline | src/main/java/org/redline_rpm/Scanner.java | Scanner.main | public static void main( String[] args) throws Exception {
InputStream fios = new FileInputStream ( args[0] );
ReadableChannelWrapper in = new ReadableChannelWrapper( Channels.newChannel( fios));
Scanner scanner = new Scanner(System.out);
Format format = scanner.run(in);
scanner.log( format.toS... | java | public static void main( String[] args) throws Exception {
InputStream fios = new FileInputStream ( args[0] );
ReadableChannelWrapper in = new ReadableChannelWrapper( Channels.newChannel( fios));
Scanner scanner = new Scanner(System.out);
Format format = scanner.run(in);
scanner.log( format.toS... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"InputStream",
"fios",
"=",
"new",
"FileInputStream",
"(",
"args",
"[",
"0",
"]",
")",
";",
"ReadableChannelWrapper",
"in",
"=",
"new",
"ReadableChannelWrap... | Scans a file and prints out useful information.
This utility reads from standard input, and parses
the binary contents of the RPM file.
@param args command line arguements
@throws Exception if an error occurs while
reading the RPM file or it's contents | [
"Scans",
"a",
"file",
"and",
"prints",
"out",
"useful",
"information",
".",
"This",
"utility",
"reads",
"from",
"standard",
"input",
"and",
"parses",
"the",
"binary",
"contents",
"of",
"the",
"RPM",
"file",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Scanner.java#L54-L74 |
105,045 | craigwblake/redline | src/main/java/org/redline_rpm/Scanner.java | Scanner.run | public Format run( ReadableChannelWrapper in) throws IOException {
Format format = new Format();
Key< Integer> headerStartKey = in.start();
Key< Integer> lead = in.start();
format.getLead().read( in);
log( "Lead ended at '" + in.finish( lead) + "'.");
Key< Integer> signature = in.start();
int c... | java | public Format run( ReadableChannelWrapper in) throws IOException {
Format format = new Format();
Key< Integer> headerStartKey = in.start();
Key< Integer> lead = in.start();
format.getLead().read( in);
log( "Lead ended at '" + in.finish( lead) + "'.");
Key< Integer> signature = in.start();
int c... | [
"public",
"Format",
"run",
"(",
"ReadableChannelWrapper",
"in",
")",
"throws",
"IOException",
"{",
"Format",
"format",
"=",
"new",
"Format",
"(",
")",
";",
"Key",
"<",
"Integer",
">",
"headerStartKey",
"=",
"in",
".",
"start",
"(",
")",
";",
"Key",
"<",
... | Reads the headers of an RPM and returns a description of it
and it's format.
@param in the channel wrapper to read input from
@return information describing the RPM file
@throws IOException if an error occurs reading the file | [
"Reads",
"the",
"headers",
"of",
"an",
"RPM",
"and",
"returns",
"a",
"description",
"of",
"it",
"and",
"it",
"s",
"format",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Scanner.java#L84-L109 |
105,046 | craigwblake/redline | src/main/java/org/redline_rpm/payload/CpioHeader.java | CpioHeader.write | public int write( final WritableByteChannel channel, int total) throws IOException {
final ByteBuffer buffer = charset.encode( CharBuffer.wrap( name));
int length = buffer.remaining() + 1;
ByteBuffer descriptor = ByteBuffer.allocate( CPIO_HEADER);
descriptor.put( writeSix( MAGIC));
descriptor.put( writeEight(... | java | public int write( final WritableByteChannel channel, int total) throws IOException {
final ByteBuffer buffer = charset.encode( CharBuffer.wrap( name));
int length = buffer.remaining() + 1;
ByteBuffer descriptor = ByteBuffer.allocate( CPIO_HEADER);
descriptor.put( writeSix( MAGIC));
descriptor.put( writeEight(... | [
"public",
"int",
"write",
"(",
"final",
"WritableByteChannel",
"channel",
",",
"int",
"total",
")",
"throws",
"IOException",
"{",
"final",
"ByteBuffer",
"buffer",
"=",
"charset",
".",
"encode",
"(",
"CharBuffer",
".",
"wrap",
"(",
"name",
")",
")",
";",
"i... | Write the content for the CPIO header, including the name immediately following. The name data is rounded
to the nearest 2 byte boundary as CPIO requires by appending a null when needed.
@param channel which channel to write on
@param total current size of header?
@return total written and skipped
@throws IOException t... | [
"Write",
"the",
"content",
"for",
"the",
"CPIO",
"header",
"including",
"the",
"name",
"immediately",
"following",
".",
"The",
"name",
"data",
"is",
"rounded",
"to",
"the",
"nearest",
"2",
"byte",
"boundary",
"as",
"CPIO",
"requires",
"by",
"appending",
"a",... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/payload/CpioHeader.java#L232-L257 |
105,047 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addDependencyLess | public void addDependencyLess( final CharSequence name, final CharSequence version) {
int flag = LESS | EQUAL;
if (name.toString().startsWith("rpmlib(")){
flag = flag | RPMLIB;
}
addDependency( name, version, flag);
} | java | public void addDependencyLess( final CharSequence name, final CharSequence version) {
int flag = LESS | EQUAL;
if (name.toString().startsWith("rpmlib(")){
flag = flag | RPMLIB;
}
addDependency( name, version, flag);
} | [
"public",
"void",
"addDependencyLess",
"(",
"final",
"CharSequence",
"name",
",",
"final",
"CharSequence",
"version",
")",
"{",
"int",
"flag",
"=",
"LESS",
"|",
"EQUAL",
";",
"if",
"(",
"name",
".",
"toString",
"(",
")",
".",
"startsWith",
"(",
"\"rpmlib(\... | Adds a dependency to the RPM package. This dependency version will be marked as the maximum
allowed, and the package will require the named dependency with this version or lower at
install time.
@param name the name of the dependency.
@param version the version identifier. | [
"Adds",
"a",
"dependency",
"to",
"the",
"RPM",
"package",
".",
"This",
"dependency",
"version",
"will",
"be",
"marked",
"as",
"the",
"maximum",
"allowed",
"and",
"the",
"package",
"will",
"require",
"the",
"named",
"dependency",
"with",
"this",
"version",
"o... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L181-L187 |
105,048 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addDependencyMore | public void addDependencyMore( final CharSequence name, final CharSequence version) {
addDependency( name, version, GREATER | EQUAL);
} | java | public void addDependencyMore( final CharSequence name, final CharSequence version) {
addDependency( name, version, GREATER | EQUAL);
} | [
"public",
"void",
"addDependencyMore",
"(",
"final",
"CharSequence",
"name",
",",
"final",
"CharSequence",
"version",
")",
"{",
"addDependency",
"(",
"name",
",",
"version",
",",
"GREATER",
"|",
"EQUAL",
")",
";",
"}"
] | Adds a dependency to the RPM package. This dependency version will be marked as the minimum
allowed, and the package will require the named dependency with this version or higher at
install time.
@param name the name of the dependency.
@param version the version identifier. | [
"Adds",
"a",
"dependency",
"to",
"the",
"RPM",
"package",
".",
"This",
"dependency",
"version",
"will",
"be",
"marked",
"as",
"the",
"minimum",
"allowed",
"and",
"the",
"package",
"will",
"require",
"the",
"named",
"dependency",
"with",
"this",
"version",
"o... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L197-L199 |
105,049 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addHeaderEntry | public void addHeaderEntry( final Tag tag, final String value) {
format.getHeader().createEntry(tag, value);
} | java | public void addHeaderEntry( final Tag tag, final String value) {
format.getHeader().createEntry(tag, value);
} | [
"public",
"void",
"addHeaderEntry",
"(",
"final",
"Tag",
"tag",
",",
"final",
"String",
"value",
")",
"{",
"format",
".",
"getHeader",
"(",
")",
".",
"createEntry",
"(",
"tag",
",",
"value",
")",
";",
"}"
] | Adds a header entry value to the header. For example use this to set the source RPM package
name on your RPM
@param tag the header tag to set
@param value the value to set the header entry with | [
"Adds",
"a",
"header",
"entry",
"value",
"to",
"the",
"header",
".",
"For",
"example",
"use",
"this",
"to",
"set",
"the",
"source",
"RPM",
"package",
"name",
"on",
"your",
"RPM"
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L220-L222 |
105,050 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.setSourceRpm | public void setSourceRpm( final String rpm) {
if ( rpm != null) format.getHeader().createEntry( SOURCERPM, rpm);
} | java | public void setSourceRpm( final String rpm) {
if ( rpm != null) format.getHeader().createEntry( SOURCERPM, rpm);
} | [
"public",
"void",
"setSourceRpm",
"(",
"final",
"String",
"rpm",
")",
"{",
"if",
"(",
"rpm",
"!=",
"null",
")",
"format",
".",
"getHeader",
"(",
")",
".",
"createEntry",
"(",
"SOURCERPM",
",",
"rpm",
")",
";",
"}"
] | Adds a source rpm.
@param rpm name of rpm source file | [
"Adds",
"a",
"source",
"rpm",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L522-L524 |
105,051 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.setPrefixes | public void setPrefixes( final String... prefixes) {
if ( prefixes != null && 0 < prefixes.length) format.getHeader().createEntry( PREFIXES, prefixes);
} | java | public void setPrefixes( final String... prefixes) {
if ( prefixes != null && 0 < prefixes.length) format.getHeader().createEntry( PREFIXES, prefixes);
} | [
"public",
"void",
"setPrefixes",
"(",
"final",
"String",
"...",
"prefixes",
")",
"{",
"if",
"(",
"prefixes",
"!=",
"null",
"&&",
"0",
"<",
"prefixes",
".",
"length",
")",
"format",
".",
"getHeader",
"(",
")",
".",
"createEntry",
"(",
"PREFIXES",
",",
"... | Sets the package prefix directories to allow any files installed under
them to be relocatable.
@param prefixes Path prefixes which may be relocated | [
"Sets",
"the",
"package",
"prefix",
"directories",
"to",
"allow",
"any",
"files",
"installed",
"under",
"them",
"to",
"be",
"relocatable",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L532-L534 |
105,052 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.readScript | private String readScript( File file) throws IOException {
if ( file == null) return null;
StringBuilder script = new StringBuilder();
BufferedReader in = new BufferedReader( new FileReader(file));
try {
String line;
while (( line = in.readLine()) != null) {
... | java | private String readScript( File file) throws IOException {
if ( file == null) return null;
StringBuilder script = new StringBuilder();
BufferedReader in = new BufferedReader( new FileReader(file));
try {
String line;
while (( line = in.readLine()) != null) {
... | [
"private",
"String",
"readScript",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"return",
"null",
";",
"StringBuilder",
"script",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"BufferedReader",
"in",
"=",
"new... | Return the content of the specified script file as a String.
@param file the script file to be read | [
"Return",
"the",
"content",
"of",
"the",
"specified",
"script",
"file",
"as",
"a",
"String",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L541-L558 |
105,053 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addTrigger | public void addTrigger( final File script, final String prog, final Map< String, IntString> depends, final int flag) throws IOException {
triggerscripts.add(readScript(script));
if ( null == prog) {
triggerscriptprogs.add(DEFAULTSCRIPTPROG);
} else if ( 0 == prog.length()){
triggerscriptprogs.add(DEFAULTSCR... | java | public void addTrigger( final File script, final String prog, final Map< String, IntString> depends, final int flag) throws IOException {
triggerscripts.add(readScript(script));
if ( null == prog) {
triggerscriptprogs.add(DEFAULTSCRIPTPROG);
} else if ( 0 == prog.length()){
triggerscriptprogs.add(DEFAULTSCR... | [
"public",
"void",
"addTrigger",
"(",
"final",
"File",
"script",
",",
"final",
"String",
"prog",
",",
"final",
"Map",
"<",
"String",
",",
"IntString",
">",
"depends",
",",
"final",
"int",
"flag",
")",
"throws",
"IOException",
"{",
"triggerscripts",
".",
"ad... | Adds a trigger to the RPM package.
@param script the script to add.
@param prog the interpreter with which to run the script.
@param depends the map of rpms and versions that will trigger the script
@param flag the trigger type (SCRIPT_TRIGGERPREIN, SCRIPT_TRIGGERIN, SCRIPT_TRIGGERUN, or SCRIPT_TRIGGERPOSTUN)
@throws ... | [
"Adds",
"a",
"trigger",
"to",
"the",
"RPM",
"package",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L835-L851 |
105,054 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addFile | public void addFile( final String path, final File source, final int mode, final int dirmode, final Directive directive, final String uname, final String gname, final boolean addParents) throws NoSuchAlgorithmException, IOException {
contents.addFile( path, source, mode, directive, uname, gname, dirmode, addPar... | java | public void addFile( final String path, final File source, final int mode, final int dirmode, final Directive directive, final String uname, final String gname, final boolean addParents) throws NoSuchAlgorithmException, IOException {
contents.addFile( path, source, mode, directive, uname, gname, dirmode, addPar... | [
"public",
"void",
"addFile",
"(",
"final",
"String",
"path",
",",
"final",
"File",
"source",
",",
"final",
"int",
"mode",
",",
"final",
"int",
"dirmode",
",",
"final",
"Directive",
"directive",
",",
"final",
"String",
"uname",
",",
"final",
"String",
"gnam... | Add the specified file to the repository payload in order.
The required header entries will automatically be generated
to record the directory names and file names, as well as their
digests.
@param path the absolute path at which this file will be installed.
@param source the file content to include in this rpm.
@para... | [
"Add",
"the",
"specified",
"file",
"to",
"the",
"repository",
"payload",
"in",
"order",
".",
"The",
"required",
"header",
"entries",
"will",
"automatically",
"be",
"generated",
"to",
"record",
"the",
"directory",
"names",
"and",
"file",
"names",
"as",
"well",
... | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L942-L944 |
105,055 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addDirectory | public void addDirectory( final String path, final int permissions, final Directive directive, final String uname, final String gname) throws NoSuchAlgorithmException, IOException {
contents.addDirectory( path, permissions, directive, uname, gname);
} | java | public void addDirectory( final String path, final int permissions, final Directive directive, final String uname, final String gname) throws NoSuchAlgorithmException, IOException {
contents.addDirectory( path, permissions, directive, uname, gname);
} | [
"public",
"void",
"addDirectory",
"(",
"final",
"String",
"path",
",",
"final",
"int",
"permissions",
",",
"final",
"Directive",
"directive",
",",
"final",
"String",
"uname",
",",
"final",
"String",
"gname",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOExc... | Adds the directory to the repository.
@param path the absolute path to add as a directory.
@param permissions the mode of the directory in standard three octet notation.
@param directive directive indicating special handling for this file.
@param uname user owner of the directory
@param gname group owner of the direct... | [
"Adds",
"the",
"directory",
"to",
"the",
"repository",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1094-L1096 |
105,056 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addChangelogFile | public void addChangelogFile(File changelogFile) throws IOException, ChangelogParseException {
new ChangelogHandler(this.format.getHeader()).addChangeLog(changelogFile);
} | java | public void addChangelogFile(File changelogFile) throws IOException, ChangelogParseException {
new ChangelogHandler(this.format.getHeader()).addChangeLog(changelogFile);
} | [
"public",
"void",
"addChangelogFile",
"(",
"File",
"changelogFile",
")",
"throws",
"IOException",
",",
"ChangelogParseException",
"{",
"new",
"ChangelogHandler",
"(",
"this",
".",
"format",
".",
"getHeader",
"(",
")",
")",
".",
"addChangeLog",
"(",
"changelogFile"... | Adds the supplied Changelog file as a Changelog to the header
@param changelogFile File containing the Changelog information
@throws IOException if file does not exist or cannot be read
@throws ChangelogParseException if file is not of the correct format. | [
"Adds",
"the",
"supplied",
"Changelog",
"file",
"as",
"a",
"Changelog",
"to",
"the",
"header"
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1182-L1184 |
105,057 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.build | public String build( final File directory) throws NoSuchAlgorithmException, IOException {
final String rpm = format.getLead().getName() + "." + format.getLead().getArch().toString().toLowerCase() + ".rpm";
final File file = new File( directory, rpm);
if ( file.exists()) file.delete();
RandomAccessFile raFile = ... | java | public String build( final File directory) throws NoSuchAlgorithmException, IOException {
final String rpm = format.getLead().getName() + "." + format.getLead().getArch().toString().toLowerCase() + ".rpm";
final File file = new File( directory, rpm);
if ( file.exists()) file.delete();
RandomAccessFile raFile = ... | [
"public",
"String",
"build",
"(",
"final",
"File",
"directory",
")",
"throws",
"NoSuchAlgorithmException",
",",
"IOException",
"{",
"final",
"String",
"rpm",
"=",
"format",
".",
"getLead",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\".\"",
"+",
"format",
".... | Generates an RPM with a standard name consisting of the RPM package name, version, release,
and type in the given directory.
@param directory the destination directory for the new RPM file.
@return the name of the rpm
@throws NoSuchAlgorithmException the algorithm isn't supported
@throws IOException there was an IO er... | [
"Generates",
"an",
"RPM",
"with",
"a",
"standard",
"name",
"consisting",
"of",
"the",
"RPM",
"package",
"name",
"version",
"release",
"and",
"type",
"in",
"the",
"given",
"directory",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1233-L1241 |
105,058 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.getSpecial | protected byte[] getSpecial( final int tag, final int count) {
final ByteBuffer buffer = ByteBuffer.allocate( 16);
buffer.putInt( tag);
buffer.putInt( 0x00000007);
buffer.putInt( count * -16);
buffer.putInt( 0x00000010);
return buffer.array();
} | java | protected byte[] getSpecial( final int tag, final int count) {
final ByteBuffer buffer = ByteBuffer.allocate( 16);
buffer.putInt( tag);
buffer.putInt( 0x00000007);
buffer.putInt( count * -16);
buffer.putInt( 0x00000010);
return buffer.array();
} | [
"protected",
"byte",
"[",
"]",
"getSpecial",
"(",
"final",
"int",
"tag",
",",
"final",
"int",
"count",
")",
"{",
"final",
"ByteBuffer",
"buffer",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"16",
")",
";",
"buffer",
".",
"putInt",
"(",
"tag",
")",
";",
... | Returns the special header expected by RPM for
a particular header.
@param tag the tag to get
@param count the number to get
@return the header bytes | [
"Returns",
"the",
"special",
"header",
"expected",
"by",
"RPM",
"for",
"a",
"particular",
"header",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1421-L1428 |
105,059 | craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.convert | protected int[] convert( final Integer[] ints) {
int[] array = new int[ ints.length];
int count = 0;
for ( int i : ints) array[ count++] = i;
return array;
} | java | protected int[] convert( final Integer[] ints) {
int[] array = new int[ ints.length];
int count = 0;
for ( int i : ints) array[ count++] = i;
return array;
} | [
"protected",
"int",
"[",
"]",
"convert",
"(",
"final",
"Integer",
"[",
"]",
"ints",
")",
"{",
"int",
"[",
"]",
"array",
"=",
"new",
"int",
"[",
"ints",
".",
"length",
"]",
";",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
":",
"ints",... | Converts an array of Integer objects into an equivalent
array of int primitives.
@param ints the array of Integer objects
@return the primitive ints array | [
"Converts",
"an",
"array",
"of",
"Integer",
"objects",
"into",
"an",
"equivalent",
"array",
"of",
"int",
"primitives",
"."
] | b2fee5eb6c8150e801a132a4478a643f9ec0df04 | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1436-L1441 |
105,060 | FlexTradeUKLtd/jfixture | jfixture/src/main/java/com/flextrade/jfixture/requests/enrichers/NumberListBuilder.java | NumberListBuilder.toActualNumber | private Object toActualNumber(Double value, Type type) {
if (type.equals(Byte.class)) return value.byteValue();
if (type.equals(Short.class)) return value.shortValue();
if (type.equals(Integer.class)) return value.intValue();
if (type.equals(Long.class)) return value.longValue();
... | java | private Object toActualNumber(Double value, Type type) {
if (type.equals(Byte.class)) return value.byteValue();
if (type.equals(Short.class)) return value.shortValue();
if (type.equals(Integer.class)) return value.intValue();
if (type.equals(Long.class)) return value.longValue();
... | [
"private",
"Object",
"toActualNumber",
"(",
"Double",
"value",
",",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"Byte",
".",
"class",
")",
")",
"return",
"value",
".",
"byteValue",
"(",
")",
";",
"if",
"(",
"type",
".",
"equals",... | but I'm going to rely on the user to not do anything silly | [
"but",
"I",
"m",
"going",
"to",
"rely",
"on",
"the",
"user",
"to",
"not",
"do",
"anything",
"silly"
] | 8733db70343bc253b9b8626aa94ed538ccb21a82 | https://github.com/FlexTradeUKLtd/jfixture/blob/8733db70343bc253b9b8626aa94ed538ccb21a82/jfixture/src/main/java/com/flextrade/jfixture/requests/enrichers/NumberListBuilder.java#L25-L36 |
105,061 | santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/sax/SAXDelegate.java | SAXDelegate.setHandler | public void setHandler(Object handler){
if(handler instanceof ContentHandler)
setContentHandler((ContentHandler)handler);
if(handler instanceof EntityResolver)
setEntityResolver((EntityResolver)handler);
if(handler instanceof ErrorHandler)
setErrorHandler((Err... | java | public void setHandler(Object handler){
if(handler instanceof ContentHandler)
setContentHandler((ContentHandler)handler);
if(handler instanceof EntityResolver)
setEntityResolver((EntityResolver)handler);
if(handler instanceof ErrorHandler)
setErrorHandler((Err... | [
"public",
"void",
"setHandler",
"(",
"Object",
"handler",
")",
"{",
"if",
"(",
"handler",
"instanceof",
"ContentHandler",
")",
"setContentHandler",
"(",
"(",
"ContentHandler",
")",
"handler",
")",
";",
"if",
"(",
"handler",
"instanceof",
"EntityResolver",
")",
... | Registers given handler with all its implementing interfaces.
This would be handy if you want to register to all interfaces
implemented by given handler object
@param handler Object implementing one or more sax handler interfaces | [
"Registers",
"given",
"handler",
"with",
"all",
"its",
"implementing",
"interfaces",
".",
"This",
"would",
"be",
"handy",
"if",
"you",
"want",
"to",
"register",
"to",
"all",
"interfaces",
"implemented",
"by",
"given",
"handler",
"object"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/sax/SAXDelegate.java#L45-L58 |
105,062 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/RuntimeUtil.java | RuntimeUtil.redirectStreams | public static void redirectStreams(Process process, OutputStream output, OutputStream error){
if(output!=null)
new Thread(new IOPump(process.getInputStream(), output, false, false).asRunnable()).start();
if(error!=null)
new Thread(new IOPump(process.getErrorStream(), error, false... | java | public static void redirectStreams(Process process, OutputStream output, OutputStream error){
if(output!=null)
new Thread(new IOPump(process.getInputStream(), output, false, false).asRunnable()).start();
if(error!=null)
new Thread(new IOPump(process.getErrorStream(), error, false... | [
"public",
"static",
"void",
"redirectStreams",
"(",
"Process",
"process",
",",
"OutputStream",
"output",
",",
"OutputStream",
"error",
")",
"{",
"if",
"(",
"output",
"!=",
"null",
")",
"new",
"Thread",
"(",
"new",
"IOPump",
"(",
"process",
".",
"getInputStre... | Redirects given process's input and error streams to the specified streams.
the streams specified are not closed automatically. The streams passed
can be null, if you don't want to redirect them.
@param process process whose streams to be redirected
@param output outputStream to which process's inputStream is red... | [
"Redirects",
"given",
"process",
"s",
"input",
"and",
"error",
"streams",
"to",
"the",
"specified",
"streams",
".",
"the",
"streams",
"specified",
"are",
"not",
"closed",
"automatically",
".",
"The",
"streams",
"passed",
"can",
"be",
"null",
"if",
"you",
"do... | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/RuntimeUtil.java#L43-L48 |
105,063 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ArrayUtil.java | ArrayUtil.concat | public static Object[] concat(Object array1[], Object array2[]){
Class<?> class1 = array1.getClass().getComponentType();
Class<?> class2 = array2.getClass().getComponentType();
Class<?> commonClass = class1.isAssignableFrom(class2)
? class1
... | java | public static Object[] concat(Object array1[], Object array2[]){
Class<?> class1 = array1.getClass().getComponentType();
Class<?> class2 = array2.getClass().getComponentType();
Class<?> commonClass = class1.isAssignableFrom(class2)
? class1
... | [
"public",
"static",
"Object",
"[",
"]",
"concat",
"(",
"Object",
"array1",
"[",
"]",
",",
"Object",
"array2",
"[",
"]",
")",
"{",
"Class",
"<",
"?",
">",
"class1",
"=",
"array1",
".",
"getClass",
"(",
")",
".",
"getComponentType",
"(",
")",
";",
"C... | Returns new array which has all values from array1 and array2 in order.
The componentType for the new array is determined by the componentTypes of
two arrays. | [
"Returns",
"new",
"array",
"which",
"has",
"all",
"values",
"from",
"array1",
"and",
"array2",
"in",
"order",
".",
"The",
"componentType",
"for",
"the",
"new",
"array",
"is",
"determined",
"by",
"the",
"componentTypes",
"of",
"two",
"arrays",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ArrayUtil.java#L195-L202 |
105,064 | santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/xsl/TransformerUtil.java | TransformerUtil.setOutputProperties | public static Transformer setOutputProperties(Transformer transformer, boolean omitXMLDeclaration, int indentAmount, String encoding){
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXMLDeclaration ? "yes" : "no");
// indentation
if(indentAmount>0){
transformer.se... | java | public static Transformer setOutputProperties(Transformer transformer, boolean omitXMLDeclaration, int indentAmount, String encoding){
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, omitXMLDeclaration ? "yes" : "no");
// indentation
if(indentAmount>0){
transformer.se... | [
"public",
"static",
"Transformer",
"setOutputProperties",
"(",
"Transformer",
"transformer",
",",
"boolean",
"omitXMLDeclaration",
",",
"int",
"indentAmount",
",",
"String",
"encoding",
")",
"{",
"transformer",
".",
"setOutputProperty",
"(",
"OutputKeys",
".",
"OMIT_X... | to set various output properties on given transformer.
@param transformer transformer on which properties are set
@param omitXMLDeclaration omit xml declaration or not
@param indentAmount the number fo spaces used for indentation.
use <=0, in case you dont want indentation
@param encoding ... | [
"to",
"set",
"various",
"output",
"properties",
"on",
"given",
"transformer",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/xsl/TransformerUtil.java#L44-L57 |
105,065 | santhosh-tekuri/jlibs | nbp/src/main/java/jlibs/nbp/Location.java | Location.consume | public boolean consume(int ch){
offset++;
if(ch==0x0D){
skipLF = true;
line++;
col = 0;
return true;
}else if(ch==0x0A){
if(skipLF){
skipLF = false;
return false;
}else{
line++... | java | public boolean consume(int ch){
offset++;
if(ch==0x0D){
skipLF = true;
line++;
col = 0;
return true;
}else if(ch==0x0A){
if(skipLF){
skipLF = false;
return false;
}else{
line++... | [
"public",
"boolean",
"consume",
"(",
"int",
"ch",
")",
"{",
"offset",
"++",
";",
"if",
"(",
"ch",
"==",
"0x0D",
")",
"{",
"skipLF",
"=",
"true",
";",
"line",
"++",
";",
"col",
"=",
"0",
";",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"ch",
... | return value tells whether the given character
has been included in location or not
for example in sequence "\r\n", the character
'\n' is not included in location. | [
"return",
"value",
"tells",
"whether",
"the",
"given",
"character",
"has",
"been",
"included",
"in",
"location",
"or",
"not"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/nbp/src/main/java/jlibs/nbp/Location.java#L47-L68 |
105,066 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/StringUtil.java | StringUtil.getTokens | public static String[] getTokens(String str, String delim, boolean trim){
StringTokenizer stok = new StringTokenizer(str, delim);
String tokens[] = new String[stok.countTokens()];
for(int i=0; i<tokens.length; i++){
tokens[i] = stok.nextToken();
if(trim)
t... | java | public static String[] getTokens(String str, String delim, boolean trim){
StringTokenizer stok = new StringTokenizer(str, delim);
String tokens[] = new String[stok.countTokens()];
for(int i=0; i<tokens.length; i++){
tokens[i] = stok.nextToken();
if(trim)
t... | [
"public",
"static",
"String",
"[",
"]",
"getTokens",
"(",
"String",
"str",
",",
"String",
"delim",
",",
"boolean",
"trim",
")",
"{",
"StringTokenizer",
"stok",
"=",
"new",
"StringTokenizer",
"(",
"str",
",",
"delim",
")",
";",
"String",
"tokens",
"[",
"]... | Splits given string into tokens with delimiters specified.
It uses StringTokenizer for tokenizing.
@param str string to be tokenized
@param delim delimiters used for tokenizing
@param trim trim the tokens
@return non-null token array | [
"Splits",
"given",
"string",
"into",
"tokens",
"with",
"delimiters",
"specified",
".",
"It",
"uses",
"StringTokenizer",
"for",
"tokenizing",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/StringUtil.java#L79-L88 |
105,067 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/StringUtil.java | StringUtil.ordinalize | public static String ordinalize(int number){
int modulo = number%100;
if(modulo>=11 && modulo<=13)
return number+"th";
switch(number%10){
case 1:
return number+"st";
case 2:
return number+"nd";
case 3:
... | java | public static String ordinalize(int number){
int modulo = number%100;
if(modulo>=11 && modulo<=13)
return number+"th";
switch(number%10){
case 1:
return number+"st";
case 2:
return number+"nd";
case 3:
... | [
"public",
"static",
"String",
"ordinalize",
"(",
"int",
"number",
")",
"{",
"int",
"modulo",
"=",
"number",
"%",
"100",
";",
"if",
"(",
"modulo",
">=",
"11",
"&&",
"modulo",
"<=",
"13",
")",
"return",
"number",
"+",
"\"th\"",
";",
"switch",
"(",
"num... | Turns a non-negative number into an ordinal string used to
denote the position in an ordered sequence, such as 1st, 2nd,
3rd, 4th
@param number the non-negative number
@return the string with the number and ordinal suffix | [
"Turns",
"a",
"non",
"-",
"negative",
"number",
"into",
"an",
"ordinal",
"string",
"used",
"to",
"denote",
"the",
"position",
"in",
"an",
"ordered",
"sequence",
"such",
"as",
"1st",
"2nd",
"3rd",
"4th"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/StringUtil.java#L178-L192 |
105,068 | santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java | ClipboardUtil.getText | public static String getText(){
Transferable contents = clipboard().getContents(null);
try{
if(contents!=null && contents.isDataFlavorSupported(DataFlavor.stringFlavor))
return (String)contents.getTransferData(DataFlavor.stringFlavor);
else
return ... | java | public static String getText(){
Transferable contents = clipboard().getContents(null);
try{
if(contents!=null && contents.isDataFlavorSupported(DataFlavor.stringFlavor))
return (String)contents.getTransferData(DataFlavor.stringFlavor);
else
return ... | [
"public",
"static",
"String",
"getText",
"(",
")",
"{",
"Transferable",
"contents",
"=",
"clipboard",
"(",
")",
".",
"getContents",
"(",
"null",
")",
";",
"try",
"{",
"if",
"(",
"contents",
"!=",
"null",
"&&",
"contents",
".",
"isDataFlavorSupported",
"(",... | returns the current text contents of clipboard. If clipboard
has no text contents or has no content, it returns null | [
"returns",
"the",
"current",
"text",
"contents",
"of",
"clipboard",
".",
"If",
"clipboard",
"has",
"no",
"text",
"contents",
"or",
"has",
"no",
"content",
"it",
"returns",
"null"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java#L54-L66 |
105,069 | santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java | ClipboardUtil.clear | public static void clear(){
clipboard().setContents(new Transferable(){
public DataFlavor[] getTransferDataFlavors(){
return new DataFlavor[0];
}
public boolean isDataFlavorSupported(DataFlavor flavor){
return false;
}
... | java | public static void clear(){
clipboard().setContents(new Transferable(){
public DataFlavor[] getTransferDataFlavors(){
return new DataFlavor[0];
}
public boolean isDataFlavorSupported(DataFlavor flavor){
return false;
}
... | [
"public",
"static",
"void",
"clear",
"(",
")",
"{",
"clipboard",
"(",
")",
".",
"setContents",
"(",
"new",
"Transferable",
"(",
")",
"{",
"public",
"DataFlavor",
"[",
"]",
"getTransferDataFlavors",
"(",
")",
"{",
"return",
"new",
"DataFlavor",
"[",
"0",
... | clears contents of clipboard | [
"clears",
"contents",
"of",
"clipboard"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/datatransfer/ClipboardUtil.java#L69-L83 |
105,070 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ByteSequence.java | ByteSequence.set | public void set(byte[] buff, int offset, int length){
if(offset<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+offset);
if(length<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+length);
if(offset>buff.length-length)
... | java | public void set(byte[] buff, int offset, int length){
if(offset<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+offset);
if(length<0)
throw new IndexOutOfBoundsException("ByteSequence index out of range: "+length);
if(offset>buff.length-length)
... | [
"public",
"void",
"set",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"ByteSequence index out of range: \"",
"+",
"offset",
")",
... | replaces the internal byte buffer with the given byte array.
@param buff Array that is the source of bytes
@param offset The initial offset
@param length The length | [
"replaces",
"the",
"internal",
"byte",
"buffer",
"with",
"the",
"given",
"byte",
"array",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ByteSequence.java#L72-L83 |
105,071 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/ClassUtil.java | ClassUtil.getClassingClass | public static Class getClassingClass(int offset){
Class[] context = ClassContext.INSTANCE.getClassContext();
offset += 2;
return context.length>offset ? context[offset] : null;
} | java | public static Class getClassingClass(int offset){
Class[] context = ClassContext.INSTANCE.getClassContext();
offset += 2;
return context.length>offset ? context[offset] : null;
} | [
"public",
"static",
"Class",
"getClassingClass",
"(",
"int",
"offset",
")",
"{",
"Class",
"[",
"]",
"context",
"=",
"ClassContext",
".",
"INSTANCE",
".",
"getClassContext",
"(",
")",
";",
"offset",
"+=",
"2",
";",
"return",
"context",
".",
"length",
">",
... | returns the calling class.
offset 0 returns class who is calling this method
offset 1 returns class who called your method
and so on | [
"returns",
"the",
"calling",
"class",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/ClassUtil.java#L153-L157 |
105,072 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.split | public static String[] split(String fileName){
int dot = fileName.lastIndexOf('.');
if(dot==-1)
return new String[]{ fileName, null };
else
return new String[] { fileName.substring(0, dot), fileName.substring(dot+1)};
} | java | public static String[] split(String fileName){
int dot = fileName.lastIndexOf('.');
if(dot==-1)
return new String[]{ fileName, null };
else
return new String[] { fileName.substring(0, dot), fileName.substring(dot+1)};
} | [
"public",
"static",
"String",
"[",
"]",
"split",
"(",
"String",
"fileName",
")",
"{",
"int",
"dot",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"dot",
"==",
"-",
"1",
")",
"return",
"new",
"String",
"[",
"]",
"{",
"fi... | splits given fileName into name and extension.
@param fileName fileName
@return string array is of length 2, where 1st item is name and 2nd item is extension(null if no extension) | [
"splits",
"given",
"fileName",
"into",
"name",
"and",
"extension",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L58-L64 |
105,073 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.getName | public static String getName(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? fileName : fileName.substring(0, dot);
} | java | public static String getName(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? fileName : fileName.substring(0, dot);
} | [
"public",
"static",
"String",
"getName",
"(",
"String",
"fileName",
")",
"{",
"int",
"dot",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"dot",
"==",
"-",
"1",
"?",
"fileName",
":",
"fileName",
".",
"substring",
"(",
"0",
"... | Returns name of the file without extension | [
"Returns",
"name",
"of",
"the",
"file",
"without",
"extension"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L67-L70 |
105,074 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.getExtension | public static String getExtension(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? null : fileName.substring(dot+1);
} | java | public static String getExtension(String fileName){
int dot = fileName.lastIndexOf('.');
return dot==-1 ? null : fileName.substring(dot+1);
} | [
"public",
"static",
"String",
"getExtension",
"(",
"String",
"fileName",
")",
"{",
"int",
"dot",
"=",
"fileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"dot",
"==",
"-",
"1",
"?",
"null",
":",
"fileName",
".",
"substring",
"(",
"dot",
... | Returns extension of the file. Returns null if there is no extension | [
"Returns",
"extension",
"of",
"the",
"file",
".",
"Returns",
"null",
"if",
"there",
"is",
"no",
"extension"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L73-L76 |
105,075 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.mkdir | public static void mkdir(File dir) throws IOException{
if(!dir.exists() && !dir.mkdir())
throw new IOException("couldn't create directory: "+dir);
} | java | public static void mkdir(File dir) throws IOException{
if(!dir.exists() && !dir.mkdir())
throw new IOException("couldn't create directory: "+dir);
} | [
"public",
"static",
"void",
"mkdir",
"(",
"File",
"dir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"dir",
".",
"exists",
"(",
")",
"&&",
"!",
"dir",
".",
"mkdir",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"couldn't create directory: \... | create specified directory if doesn't exist. | [
"create",
"specified",
"directory",
"if",
"doesn",
"t",
"exist",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L202-L205 |
105,076 | santhosh-tekuri/jlibs | xsd/src/main/java/jlibs/xml/xsd/XSParser.java | XSParser.parseString | public XSModel parseString(String schema, String baseURI){
return xsLoader.load(new DOMInputImpl(null, null, baseURI, schema, null));
} | java | public XSModel parseString(String schema, String baseURI){
return xsLoader.load(new DOMInputImpl(null, null, baseURI, schema, null));
} | [
"public",
"XSModel",
"parseString",
"(",
"String",
"schema",
",",
"String",
"baseURI",
")",
"{",
"return",
"xsLoader",
".",
"load",
"(",
"new",
"DOMInputImpl",
"(",
"null",
",",
"null",
",",
"baseURI",
",",
"schema",
",",
"null",
")",
")",
";",
"}"
] | Parse an XML Schema document from String specified
@param schema String data to parse. If provided, this will always be treated as a
sequence of 16-bit units (UTF-16 encoded characters). If an XML
declaration is present, the value of the encoding attribute
will be ignored.
@param baseURI The base URI to be used f... | [
"Parse",
"an",
"XML",
"Schema",
"document",
"from",
"String",
"specified"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xsd/src/main/java/jlibs/xml/xsd/XSParser.java#L121-L123 |
105,077 | santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java | MyNamespaceSupport.findPrefix | public String findPrefix(String uri){
if(uri==null)
uri = "";
String prefix = getPrefix(uri);
if(prefix==null){
String defaultURI = getURI("");
if(defaultURI==null)
defaultURI = "";
if(Util.equals(uri, defaultURI))
p... | java | public String findPrefix(String uri){
if(uri==null)
uri = "";
String prefix = getPrefix(uri);
if(prefix==null){
String defaultURI = getURI("");
if(defaultURI==null)
defaultURI = "";
if(Util.equals(uri, defaultURI))
p... | [
"public",
"String",
"findPrefix",
"(",
"String",
"uri",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"uri",
"=",
"\"\"",
";",
"String",
"prefix",
"=",
"getPrefix",
"(",
"uri",
")",
";",
"if",
"(",
"prefix",
"==",
"null",
")",
"{",
"String",
"defa... | Return one of the prefixes mapped to a Namespace URI.
<p>If more than one prefix is currently mapped to the same
URI, this method will make an arbitrary selection;
<p>Unlike {@link #getPrefix(String)} this method, this returns empty
prefix if the given uri is bound to default prefix. | [
"Return",
"one",
"of",
"the",
"prefixes",
"mapped",
"to",
"a",
"Namespace",
"URI",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java#L62-L74 |
105,078 | santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java | MyNamespaceSupport.declarePrefix | public String declarePrefix(String uri){
String prefix = findPrefix(uri);
if(prefix==null){
if(uri.isEmpty())
prefix = ""; // non-empty prefix cannot be used for empty namespace
else{
prefix = suggested.getProperty(uri, suggestPrefix);
... | java | public String declarePrefix(String uri){
String prefix = findPrefix(uri);
if(prefix==null){
if(uri.isEmpty())
prefix = ""; // non-empty prefix cannot be used for empty namespace
else{
prefix = suggested.getProperty(uri, suggestPrefix);
... | [
"public",
"String",
"declarePrefix",
"(",
"String",
"uri",
")",
"{",
"String",
"prefix",
"=",
"findPrefix",
"(",
"uri",
")",
";",
"if",
"(",
"prefix",
"==",
"null",
")",
"{",
"if",
"(",
"uri",
".",
"isEmpty",
"(",
")",
")",
"prefix",
"=",
"\"\"",
"... | generated a new prefix and binds it to given uri.
<p>you can customize the generated prefix using {@link #suggestPrefix(String, String)} | [
"generated",
"a",
"new",
"prefix",
"and",
"binds",
"it",
"to",
"given",
"uri",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/sax/helpers/MyNamespaceSupport.java#L102-L127 |
105,079 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/util/CollectionUtil.java | CollectionUtil.addAll | @SuppressWarnings({"unchecked", "ManualArrayToCollectionCopy"})
public static <E, T extends E> Collection<E> addAll(Collection<E> c, T... array){
for(T obj: array)
c.add(obj);
return c;
} | java | @SuppressWarnings({"unchecked", "ManualArrayToCollectionCopy"})
public static <E, T extends E> Collection<E> addAll(Collection<E> c, T... array){
for(T obj: array)
c.add(obj);
return c;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"ManualArrayToCollectionCopy\"",
"}",
")",
"public",
"static",
"<",
"E",
",",
"T",
"extends",
"E",
">",
"Collection",
"<",
"E",
">",
"addAll",
"(",
"Collection",
"<",
"E",
">",
"c",
",",
"T",
"..... | Adds objects in array to the given collection
@return the same collection which is passed as argument | [
"Adds",
"objects",
"in",
"array",
"to",
"the",
"given",
"collection"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/util/CollectionUtil.java#L50-L55 |
105,080 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/util/CollectionUtil.java | CollectionUtil.removeAll | @SuppressWarnings("unchecked")
public static <E, T extends E> Collection<E> removeAll(Collection<E> c, T... array){
for(T obj: array)
c.remove(obj);
return c;
} | java | @SuppressWarnings("unchecked")
public static <E, T extends E> Collection<E> removeAll(Collection<E> c, T... array){
for(T obj: array)
c.remove(obj);
return c;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
",",
"T",
"extends",
"E",
">",
"Collection",
"<",
"E",
">",
"removeAll",
"(",
"Collection",
"<",
"E",
">",
"c",
",",
"T",
"...",
"array",
")",
"{",
"for",
"(",
"T",
"... | Removes objects in array to the given collection
@return the same collection which is passed as argument | [
"Removes",
"objects",
"in",
"array",
"to",
"the",
"given",
"collection"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/util/CollectionUtil.java#L62-L67 |
105,081 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/util/CollectionUtil.java | CollectionUtil.filter | public static <T> List<T> filter(Collection<T> c, Filter<T> filter){
if(c.size()==0)
return Collections.emptyList();
List<T> filteredList = new ArrayList<T>(c.size());
for(T element: c){
if(filter.select(element))
filteredList.add(element);
}
... | java | public static <T> List<T> filter(Collection<T> c, Filter<T> filter){
if(c.size()==0)
return Collections.emptyList();
List<T> filteredList = new ArrayList<T>(c.size());
for(T element: c){
if(filter.select(element))
filteredList.add(element);
}
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"filter",
"(",
"Collection",
"<",
"T",
">",
"c",
",",
"Filter",
"<",
"T",
">",
"filter",
")",
"{",
"if",
"(",
"c",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"Collections",
".",
... | Returns List with elements from given collections which are selected
by specified filter | [
"Returns",
"List",
"with",
"elements",
"from",
"given",
"collections",
"which",
"are",
"selected",
"by",
"specified",
"filter"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/util/CollectionUtil.java#L85-L95 |
105,082 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java | JavaProcessBuilder.command | public String[] command() throws IOException{
List<String> cmd = new ArrayList<String>();
String executable = javaHome.getCanonicalPath()+FileUtil.SEPARATOR+"bin"+FileUtil.SEPARATOR+"java";
if(OS.get().isWindows())
executable += ".exe";
cmd.add(executable);
String p... | java | public String[] command() throws IOException{
List<String> cmd = new ArrayList<String>();
String executable = javaHome.getCanonicalPath()+FileUtil.SEPARATOR+"bin"+FileUtil.SEPARATOR+"java";
if(OS.get().isWindows())
executable += ".exe";
cmd.add(executable);
String p... | [
"public",
"String",
"[",
"]",
"command",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"cmd",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"String",
"executable",
"=",
"javaHome",
".",
"getCanonicalPath",
"(",
")",
... | Returns command with all its arguments | [
"Returns",
"command",
"with",
"all",
"its",
"arguments"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java#L395-L458 |
105,083 | santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java | JavaProcessBuilder.launch | public Process launch(OutputStream output, OutputStream error) throws IOException{
Process process = Runtime.getRuntime().exec(command(), null, workingDir);
RuntimeUtil.redirectStreams(process, output, error);
return process;
} | java | public Process launch(OutputStream output, OutputStream error) throws IOException{
Process process = Runtime.getRuntime().exec(command(), null, workingDir);
RuntimeUtil.redirectStreams(process, output, error);
return process;
} | [
"public",
"Process",
"launch",
"(",
"OutputStream",
"output",
",",
"OutputStream",
"error",
")",
"throws",
"IOException",
"{",
"Process",
"process",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"exec",
"(",
"command",
"(",
")",
",",
"null",
",",
"work... | launches jvm with current configuration.
note that, the streams passed are not closed automatically.
@param output outputstream to which process's input stream to be redirected.
if null, it is not redirected
@param error outputstream to which process's error stream to be redirected.
if null, it is not redirect... | [
"launches",
"jvm",
"with",
"current",
"configuration",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/JavaProcessBuilder.java#L475-L479 |
105,084 | santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/SwingUtil.java | SwingUtil.setInitialFocus | public static void setInitialFocus(Window window, final Component comp){
window.addWindowFocusListener(new WindowAdapter(){
@Override
public void windowGainedFocus(WindowEvent we){
comp.requestFocusInWindow();
we.getWindow().removeWindowFocusListener(this)... | java | public static void setInitialFocus(Window window, final Component comp){
window.addWindowFocusListener(new WindowAdapter(){
@Override
public void windowGainedFocus(WindowEvent we){
comp.requestFocusInWindow();
we.getWindow().removeWindowFocusListener(this)... | [
"public",
"static",
"void",
"setInitialFocus",
"(",
"Window",
"window",
",",
"final",
"Component",
"comp",
")",
"{",
"window",
".",
"addWindowFocusListener",
"(",
"new",
"WindowAdapter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"windowGainedFocus",
"(",... | sets intial focus in window to the specified component
@param window window on which focus has to be set
@param comp component which need to have initial focus | [
"sets",
"intial",
"focus",
"in",
"window",
"to",
"the",
"specified",
"component"
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/SwingUtil.java#L40-L48 |
105,085 | santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/SwingUtil.java | SwingUtil.doAction | public static void doAction(JTextField textField){
String command = null;
if(textField.getAction()!=null)
command = (String)textField.getAction().getValue(Action.ACTION_COMMAND_KEY);
ActionEvent event = null;
for(ActionListener listener: textField.getActionListeners(... | java | public static void doAction(JTextField textField){
String command = null;
if(textField.getAction()!=null)
command = (String)textField.getAction().getValue(Action.ACTION_COMMAND_KEY);
ActionEvent event = null;
for(ActionListener listener: textField.getActionListeners(... | [
"public",
"static",
"void",
"doAction",
"(",
"JTextField",
"textField",
")",
"{",
"String",
"command",
"=",
"null",
";",
"if",
"(",
"textField",
".",
"getAction",
"(",
")",
"!=",
"null",
")",
"command",
"=",
"(",
"String",
")",
"textField",
".",
"getActi... | Programmatically perform action on textfield.This does the same
thing as if the user had pressed enter key in textfield.
@param textField textField on which action to be preformed | [
"Programmatically",
"perform",
"action",
"on",
"textfield",
".",
"This",
"does",
"the",
"same",
"thing",
"as",
"if",
"the",
"user",
"had",
"pressed",
"enter",
"key",
"in",
"textfield",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/SwingUtil.java#L56-L67 |
105,086 | santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/SwingUtil.java | SwingUtil.setText | public static void setText(JTextComponent textComp, String text){
if(text==null)
text = "";
if(textComp.getCaret() instanceof DefaultCaret){
DefaultCaret caret = (DefaultCaret)textComp.getCaret();
int updatePolicy = caret.getUpdatePolicy();
caret.... | java | public static void setText(JTextComponent textComp, String text){
if(text==null)
text = "";
if(textComp.getCaret() instanceof DefaultCaret){
DefaultCaret caret = (DefaultCaret)textComp.getCaret();
int updatePolicy = caret.getUpdatePolicy();
caret.... | [
"public",
"static",
"void",
"setText",
"(",
"JTextComponent",
"textComp",
",",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"text",
"=",
"\"\"",
";",
"if",
"(",
"textComp",
".",
"getCaret",
"(",
")",
"instanceof",
"DefaultCaret",
")"... | sets text of textComp without moving its caret.
@param textComp text component whose text needs to be set
@param text text to be set. null will be treated as empty string | [
"sets",
"text",
"of",
"textComp",
"without",
"moving",
"its",
"caret",
"."
] | 59c28719f054123cf778278154e1b92e943ad232 | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/SwingUtil.java#L75-L104 |
105,087 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/ResourceMetadata.java | ResourceMetadata.merge | public boolean merge(ResourceMetadata other) {
boolean modified = m_metrics.addAll(other.m_metrics);
if (!modified) {
modified = !m_attributes.equals(other.m_attributes);
}
m_attributes.putAll(other.m_attributes);
return modified;
} | java | public boolean merge(ResourceMetadata other) {
boolean modified = m_metrics.addAll(other.m_metrics);
if (!modified) {
modified = !m_attributes.equals(other.m_attributes);
}
m_attributes.putAll(other.m_attributes);
return modified;
} | [
"public",
"boolean",
"merge",
"(",
"ResourceMetadata",
"other",
")",
"{",
"boolean",
"modified",
"=",
"m_metrics",
".",
"addAll",
"(",
"other",
".",
"m_metrics",
")",
";",
"if",
"(",
"!",
"modified",
")",
"{",
"modified",
"=",
"!",
"m_attributes",
".",
"... | Merges the metrics and attributes from the given instance, to the current instance.
@param other a {@link ResourceMetadata} object
@return true if the meta-data was modified as a result of the merge, false otherwise | [
"Merges",
"the",
"metrics",
"and",
"attributes",
"from",
"the",
"given",
"instance",
"to",
"the",
"current",
"instance",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/ResourceMetadata.java#L82-L89 |
105,088 | OpenNMS/newts | rest/src/main/java/org/opennms/newts/rest/RepositoryHealthCheck.java | RepositoryHealthCheck.check | @Override
protected Result check() throws Exception {
m_repository.select(Context.DEFAULT_CONTEXT, new Resource("notreal"), Optional.of(Timestamp.fromEpochMillis(0)), Optional.of(Timestamp.fromEpochMillis(0)));
return Result.healthy();
} | java | @Override
protected Result check() throws Exception {
m_repository.select(Context.DEFAULT_CONTEXT, new Resource("notreal"), Optional.of(Timestamp.fromEpochMillis(0)), Optional.of(Timestamp.fromEpochMillis(0)));
return Result.healthy();
} | [
"@",
"Override",
"protected",
"Result",
"check",
"(",
")",
"throws",
"Exception",
"{",
"m_repository",
".",
"select",
"(",
"Context",
".",
"DEFAULT_CONTEXT",
",",
"new",
"Resource",
"(",
"\"notreal\"",
")",
",",
"Optional",
".",
"of",
"(",
"Timestamp",
".",
... | Perform simple query; Establishes only that we can go to the database without excepting. | [
"Perform",
"simple",
"query",
";",
"Establishes",
"only",
"that",
"we",
"can",
"go",
"to",
"the",
"database",
"without",
"excepting",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/rest/src/main/java/org/opennms/newts/rest/RepositoryHealthCheck.java#L39-L45 |
105,089 | OpenNMS/newts | api/src/main/java/org/opennms/newts/api/query/ResultDescriptor.java | ResultDescriptor.getSourceNames | public Set<String> getSourceNames() {
return Sets.newHashSet(Iterables.transform(getDatasources().values(), new Function<Datasource, String>() {
@Override
public String apply(Datasource input) {
return input.getSource();
}
}));
} | java | public Set<String> getSourceNames() {
return Sets.newHashSet(Iterables.transform(getDatasources().values(), new Function<Datasource, String>() {
@Override
public String apply(Datasource input) {
return input.getSource();
}
}));
} | [
"public",
"Set",
"<",
"String",
">",
"getSourceNames",
"(",
")",
"{",
"return",
"Sets",
".",
"newHashSet",
"(",
"Iterables",
".",
"transform",
"(",
"getDatasources",
"(",
")",
".",
"values",
"(",
")",
",",
"new",
"Function",
"<",
"Datasource",
",",
"Stri... | Returns the set of unique source names; The names of the underlying samples used as the
source of aggregations.
@return source names | [
"Returns",
"the",
"set",
"of",
"unique",
"source",
"names",
";",
"The",
"names",
"of",
"the",
"underlying",
"samples",
"used",
"as",
"the",
"source",
"of",
"aggregations",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/api/src/main/java/org/opennms/newts/api/query/ResultDescriptor.java#L117-L125 |
105,090 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java | CassandraResourceTreeWalker.breadthFirstSearch | public void breadthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
Queue<Resource> queue = Lists.newLinkedList();
queue.add(root);
while (!queue.isEmpty()) {
Resource r = queue.remove();
for (SearchResults.Result result : m_searcher
... | java | public void breadthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
Queue<Resource> queue = Lists.newLinkedList();
queue.add(root);
while (!queue.isEmpty()) {
Resource r = queue.remove();
for (SearchResults.Result result : m_searcher
... | [
"public",
"void",
"breadthFirstSearch",
"(",
"Context",
"context",
",",
"SearchResultVisitor",
"visitor",
",",
"Resource",
"root",
")",
"{",
"Queue",
"<",
"Resource",
">",
"queue",
"=",
"Lists",
".",
"newLinkedList",
"(",
")",
";",
"queue",
".",
"add",
"(",
... | Visits all nodes in the resource tree bellow the given resource using
breadth-first search. | [
"Visits",
"all",
"nodes",
"in",
"the",
"resource",
"tree",
"bellow",
"the",
"given",
"resource",
"using",
"breadth",
"-",
"first",
"search",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java#L74-L87 |
105,091 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java | CassandraResourceTreeWalker.depthFirstSearch | public void depthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
ArrayDeque<SearchResults.Result> stack = Queues.newArrayDeque();
// Build an instance of a SearchResult for the root resource
// but don't invoke the visitor with it
boolean skipFirstVisit = true... | java | public void depthFirstSearch(Context context, SearchResultVisitor visitor, Resource root) {
ArrayDeque<SearchResults.Result> stack = Queues.newArrayDeque();
// Build an instance of a SearchResult for the root resource
// but don't invoke the visitor with it
boolean skipFirstVisit = true... | [
"public",
"void",
"depthFirstSearch",
"(",
"Context",
"context",
",",
"SearchResultVisitor",
"visitor",
",",
"Resource",
"root",
")",
"{",
"ArrayDeque",
"<",
"SearchResults",
".",
"Result",
">",
"stack",
"=",
"Queues",
".",
"newArrayDeque",
"(",
")",
";",
"// ... | Visits all nodes in the resource tree bellow the given resource using
depth-first search. | [
"Visits",
"all",
"nodes",
"in",
"the",
"resource",
"tree",
"bellow",
"the",
"given",
"resource",
"using",
"depth",
"-",
"first",
"search",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraResourceTreeWalker.java#L100-L128 |
105,092 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java | CassandraSearcher.searchForIds | private Set<String> searchForIds(Context context, TermQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
BoundStatement bindStatement = m_searchStatement.bind();
bindStatement.setString(Schema.C_TERMS_CONTEXT, context.getId());
bindStatement.setString(... | java | private Set<String> searchForIds(Context context, TermQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
BoundStatement bindStatement = m_searchStatement.bind();
bindStatement.setString(Schema.C_TERMS_CONTEXT, context.getId());
bindStatement.setString(... | [
"private",
"Set",
"<",
"String",
">",
"searchForIds",
"(",
"Context",
"context",
",",
"TermQuery",
"query",
",",
"ConsistencyLevel",
"readConsistency",
")",
"{",
"Set",
"<",
"String",
">",
"ids",
"=",
"Sets",
".",
"newTreeSet",
"(",
")",
";",
"BoundStatement... | Returns the set of resource ids that match the given
term query. | [
"Returns",
"the",
"set",
"of",
"resource",
"ids",
"that",
"match",
"the",
"given",
"term",
"query",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java#L169-L183 |
105,093 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java | CassandraSearcher.searchForIds | private Set<String> searchForIds(Context context, BooleanQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
for (BooleanClause clause : query.getClauses()) {
Set<String> subQueryIds;
Query subQuery = clause.getQuery();
if (subQuery... | java | private Set<String> searchForIds(Context context, BooleanQuery query, ConsistencyLevel readConsistency) {
Set<String> ids = Sets.newTreeSet();
for (BooleanClause clause : query.getClauses()) {
Set<String> subQueryIds;
Query subQuery = clause.getQuery();
if (subQuery... | [
"private",
"Set",
"<",
"String",
">",
"searchForIds",
"(",
"Context",
"context",
",",
"BooleanQuery",
"query",
",",
"ConsistencyLevel",
"readConsistency",
")",
"{",
"Set",
"<",
"String",
">",
"ids",
"=",
"Sets",
".",
"newTreeSet",
"(",
")",
";",
"for",
"("... | Returns the set of resource ids that match the given
boolean query.
Separate clauses are performed with separate database queries and their
results are joined in memory. | [
"Returns",
"the",
"set",
"of",
"resource",
"ids",
"that",
"match",
"the",
"given",
"boolean",
"query",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/CassandraSearcher.java#L192-L220 |
105,094 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java | EscapableResourceIdSplitter.splitIdIntoElements | @Override
public List<String> splitIdIntoElements(String id) {
Preconditions.checkNotNull(id, "id argument");
List<String> elements = Lists.newArrayList();
int startOfNextElement = 0;
int numConsecutiveEscapeCharacters = 0;
char[] idChars = id.toCharArray();
for (int... | java | @Override
public List<String> splitIdIntoElements(String id) {
Preconditions.checkNotNull(id, "id argument");
List<String> elements = Lists.newArrayList();
int startOfNextElement = 0;
int numConsecutiveEscapeCharacters = 0;
char[] idChars = id.toCharArray();
for (int... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"splitIdIntoElements",
"(",
"String",
"id",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"id",
",",
"\"id argument\"",
")",
";",
"List",
"<",
"String",
">",
"elements",
"=",
"Lists",
".",
"newA... | Splits a resource id into a list of elements.
Elements in the resource id are delimited by colons (:).
Colons can be escaped by a backslash (\:).
Backslashes are escaped when paired (\\).
For example, the following resources id:
a:b\::c\\:d
will result in the following elements:
a, b:, c\, d
@param id the resource i... | [
"Splits",
"a",
"resource",
"id",
"into",
"a",
"list",
"of",
"elements",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java#L50-L74 |
105,095 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java | EscapableResourceIdSplitter.maybeAddSanitizedElement | private static void maybeAddSanitizedElement(final String element, final List<String> elements) {
// Trim the element and skip it when empty
String sanitizedElement = element.trim();
if (sanitizedElement.length() == 0) {
return;
}
// \: -> :
sanitizedElement =... | java | private static void maybeAddSanitizedElement(final String element, final List<String> elements) {
// Trim the element and skip it when empty
String sanitizedElement = element.trim();
if (sanitizedElement.length() == 0) {
return;
}
// \: -> :
sanitizedElement =... | [
"private",
"static",
"void",
"maybeAddSanitizedElement",
"(",
"final",
"String",
"element",
",",
"final",
"List",
"<",
"String",
">",
"elements",
")",
"{",
"// Trim the element and skip it when empty",
"String",
"sanitizedElement",
"=",
"element",
".",
"trim",
"(",
... | Maybe adds to element to the list after being sanitized. | [
"Maybe",
"adds",
"to",
"element",
"to",
"the",
"list",
"after",
"being",
"sanitized",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java#L79-L90 |
105,096 | OpenNMS/newts | cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java | EscapableResourceIdSplitter.joinElementsToId | @Override
public String joinElementsToId(List<String> elements) {
Preconditions.checkNotNull(elements, "elements argument");
StringBuilder sb = new StringBuilder();
for (String el : elements) {
// Skip null elements
if (el == null) {
continue;
... | java | @Override
public String joinElementsToId(List<String> elements) {
Preconditions.checkNotNull(elements, "elements argument");
StringBuilder sb = new StringBuilder();
for (String el : elements) {
// Skip null elements
if (el == null) {
continue;
... | [
"@",
"Override",
"public",
"String",
"joinElementsToId",
"(",
"List",
"<",
"String",
">",
"elements",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"elements",
",",
"\"elements argument\"",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"("... | Joins a list of elements into a resource id, escaping
special characters if required.
See {@link #splitIdIntoElements(String)} for details.
@param elements a list of elements
@return the resource id | [
"Joins",
"a",
"list",
"of",
"elements",
"into",
"a",
"resource",
"id",
"escaping",
"special",
"characters",
"if",
"required",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/cassandra/search/src/main/java/org/opennms/newts/cassandra/search/EscapableResourceIdSplitter.java#L101-L128 |
105,097 | OpenNMS/newts | aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java | Aggregation.aggregate | private Double aggregate(Datasource ds, Collection<Double> values) {
return ((values.size() / m_intervalsPer) > ds.getXff()) ? ds.getAggregationFuction().apply(values) : Double.NaN;
} | java | private Double aggregate(Datasource ds, Collection<Double> values) {
return ((values.size() / m_intervalsPer) > ds.getXff()) ? ds.getAggregationFuction().apply(values) : Double.NaN;
} | [
"private",
"Double",
"aggregate",
"(",
"Datasource",
"ds",
",",
"Collection",
"<",
"Double",
">",
"values",
")",
"{",
"return",
"(",
"(",
"values",
".",
"size",
"(",
")",
"/",
"m_intervalsPer",
")",
">",
"ds",
".",
"getXff",
"(",
")",
")",
"?",
"ds",... | is within XFF, otherwise return NaN. | [
"is",
"within",
"XFF",
"otherwise",
"return",
"NaN",
"."
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java#L133-L135 |
105,098 | OpenNMS/newts | aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java | Aggregation.inRange | private boolean inRange() {
if (m_working == null || m_nextOut == null) {
return false;
}
Timestamp rangeUpper = m_nextOut.getTimestamp();
Timestamp rangeLower = m_nextOut.getTimestamp().minus(m_resolution);
return m_working.getTimestamp().lte(rangeUpper) && m_worki... | java | private boolean inRange() {
if (m_working == null || m_nextOut == null) {
return false;
}
Timestamp rangeUpper = m_nextOut.getTimestamp();
Timestamp rangeLower = m_nextOut.getTimestamp().minus(m_resolution);
return m_working.getTimestamp().lte(rangeUpper) && m_worki... | [
"private",
"boolean",
"inRange",
"(",
")",
"{",
"if",
"(",
"m_working",
"==",
"null",
"||",
"m_nextOut",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"Timestamp",
"rangeUpper",
"=",
"m_nextOut",
".",
"getTimestamp",
"(",
")",
";",
"Timestamp",
"r... | true if the working input Row is within the Range of the next output Row; false otherwise | [
"true",
"if",
"the",
"working",
"input",
"Row",
"is",
"within",
"the",
"Range",
"of",
"the",
"next",
"output",
"Row",
";",
"false",
"otherwise"
] | e1b53169d8a7fbc5e9fb826da08d602f628063ea | https://github.com/OpenNMS/newts/blob/e1b53169d8a7fbc5e9fb826da08d602f628063ea/aggregate/src/main/java/org/opennms/newts/aggregate/Aggregation.java#L138-L147 |
105,099 | ffpojo/ffpojo | ffpojo/src/main/java/com/github/ffpojo/file/reader/FlatFileReaderDefinition.java | FlatFileReaderDefinition.getBody | public Class<?> getBody(String message) {
final Set<IdentifierLine> identifierLines = this.definitions.keySet();
final IdentifierLine messageId = new IdentifierLine();
for(IdentifierLine id : identifierLines){
final Map<Integer, String> mapIds = id.getMapIds();
final Set<Integer> keys = mapIds.keySet();
... | java | public Class<?> getBody(String message) {
final Set<IdentifierLine> identifierLines = this.definitions.keySet();
final IdentifierLine messageId = new IdentifierLine();
for(IdentifierLine id : identifierLines){
final Map<Integer, String> mapIds = id.getMapIds();
final Set<Integer> keys = mapIds.keySet();
... | [
"public",
"Class",
"<",
"?",
">",
"getBody",
"(",
"String",
"message",
")",
"{",
"final",
"Set",
"<",
"IdentifierLine",
">",
"identifierLines",
"=",
"this",
".",
"definitions",
".",
"keySet",
"(",
")",
";",
"final",
"IdentifierLine",
"messageId",
"=",
"new... | GETTERS AND SETTERS | [
"GETTERS",
"AND",
"SETTERS"
] | af86a8bc1fa716f23d1f7cd7f9c7c65e63b1681a | https://github.com/ffpojo/ffpojo/blob/af86a8bc1fa716f23d1f7cd7f9c7c65e63b1681a/ffpojo/src/main/java/com/github/ffpojo/file/reader/FlatFileReaderDefinition.java#L79-L106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.