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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/common/CoGProperties.java | CoGProperties.getCertCacheLifetime | public long getCertCacheLifetime()
throws NumberFormatException {
long value = 60*1000;
String property = getProperty(CERT_CACHE_LIFETIME);
if (property != null && property.length() > 0) {
long parsedValue = Long.parseLong(property);
if (parsedValue > 0) {
... | java | public long getCertCacheLifetime()
throws NumberFormatException {
long value = 60*1000;
String property = getProperty(CERT_CACHE_LIFETIME);
if (property != null && property.length() > 0) {
long parsedValue = Long.parseLong(property);
if (parsedValue > 0) {
... | [
"public",
"long",
"getCertCacheLifetime",
"(",
")",
"throws",
"NumberFormatException",
"{",
"long",
"value",
"=",
"60",
"*",
"1000",
";",
"String",
"property",
"=",
"getProperty",
"(",
"CERT_CACHE_LIFETIME",
")",
";",
"if",
"(",
"property",
"!=",
"null",
"&&",... | Returns the Cert cache lifetime. If this property is
set to zero or less, no caching is done. The value is the
number of milliseconds the certificates are cached without checking for
modifications on disk.
Defaults to 60s.
@throws NumberFormatException if the cache lifetime property
could not be parsed
@return the Ce... | [
"Returns",
"the",
"Cert",
"cache",
"lifetime",
".",
"If",
"this",
"property",
"is",
"set",
"to",
"zero",
"or",
"less",
"no",
"caching",
"is",
"done",
".",
"The",
"value",
"is",
"the",
"number",
"of",
"milliseconds",
"the",
"certificates",
"are",
"cached",
... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/common/CoGProperties.java#L580-L603 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/common/CoGProperties.java | CoGProperties.getReveseDNSCacheLifetime | public long getReveseDNSCacheLifetime()
throws NumberFormatException {
long value = 60*60*1000;
String property = getProperty(REVERSE_DNS_CACHE_LIFETIME);
if (property != null && property.length() > 0) {
long parsedValue = Long.parseLong(property);
if (parse... | java | public long getReveseDNSCacheLifetime()
throws NumberFormatException {
long value = 60*60*1000;
String property = getProperty(REVERSE_DNS_CACHE_LIFETIME);
if (property != null && property.length() > 0) {
long parsedValue = Long.parseLong(property);
if (parse... | [
"public",
"long",
"getReveseDNSCacheLifetime",
"(",
")",
"throws",
"NumberFormatException",
"{",
"long",
"value",
"=",
"60",
"*",
"60",
"*",
"1000",
";",
"String",
"property",
"=",
"getProperty",
"(",
"REVERSE_DNS_CACHE_LIFETIME",
")",
";",
"if",
"(",
"property"... | Returns the reverse DNS cache time.
Defaults to 1h.
@throws NumberFormatException if the cache lifetime property
could not be parsed
@return the reverse DNS cache lifetime in milliseconds | [
"Returns",
"the",
"reverse",
"DNS",
"cache",
"time",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/common/CoGProperties.java#L614-L637 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/common/CoGProperties.java | CoGProperties.getReverseDNSCacheType | public String getReverseDNSCacheType() {
String value = System.getProperty(REVERSE_DNS_CACHETYPE);
if (value != null) {
return value;
}
return getProperty(REVERSE_DNS_CACHETYPE, THREADED_CACHE);
} | java | public String getReverseDNSCacheType() {
String value = System.getProperty(REVERSE_DNS_CACHETYPE);
if (value != null) {
return value;
}
return getProperty(REVERSE_DNS_CACHETYPE, THREADED_CACHE);
} | [
"public",
"String",
"getReverseDNSCacheType",
"(",
")",
"{",
"String",
"value",
"=",
"System",
".",
"getProperty",
"(",
"REVERSE_DNS_CACHETYPE",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"value",
";",
"}",
"return",
"getProperty",
"(",
... | Returns the reverse DNS cache type.
Defaults to a threaded chache.
@return the type of cache for reverse DNS requests | [
"Returns",
"the",
"reverse",
"DNS",
"cache",
"type",
".",
"Defaults",
"to",
"a",
"threaded",
"chache",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/common/CoGProperties.java#L645-L651 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/Bindings.java | Bindings.add | public void add(Binding binding) {
if (values == null) values = new LinkedList();
values.add(binding);
} | java | public void add(Binding binding) {
if (values == null) values = new LinkedList();
values.add(binding);
} | [
"public",
"void",
"add",
"(",
"Binding",
"binding",
")",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"values",
"=",
"new",
"LinkedList",
"(",
")",
";",
"values",
".",
"add",
"(",
"binding",
")",
";",
"}"
] | Adds a new variable definition to the list.
@param binding a new variable definition. | [
"Adds",
"a",
"new",
"variable",
"definition",
"to",
"the",
"list",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/Bindings.java#L36-L39 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/Bindings.java | Bindings.evaluate | public Bindings evaluate(Map symbolTable)
throws RslEvaluationException {
if (symbolTable == null) {
throw new IllegalArgumentException("Symbol table must be initialized.");
}
List newValues = new LinkedList();
Iterator iter = values.iterator();
Object vl;
Binding binding;
while (iter.hasNext()) {
vl ... | java | public Bindings evaluate(Map symbolTable)
throws RslEvaluationException {
if (symbolTable == null) {
throw new IllegalArgumentException("Symbol table must be initialized.");
}
List newValues = new LinkedList();
Iterator iter = values.iterator();
Object vl;
Binding binding;
while (iter.hasNext()) {
vl ... | [
"public",
"Bindings",
"evaluate",
"(",
"Map",
"symbolTable",
")",
"throws",
"RslEvaluationException",
"{",
"if",
"(",
"symbolTable",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Symbol table must be initialized.\"",
")",
";",
"}",
"Lis... | Evaluates the variable definitions as variable definitions
can reference each other against the symbol table.
The evaluation process updates the symbol table.
@param symbolTable the symbol table to evalute the variables
against.
@return a new evaluted variable definition.
@exception RslEvaluationException If an error ... | [
"Evaluates",
"the",
"variable",
"definitions",
"as",
"variable",
"definitions",
"can",
"reference",
"each",
"other",
"against",
"the",
"symbol",
"table",
".",
"The",
"evaluation",
"process",
"updates",
"the",
"symbol",
"table",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/Bindings.java#L83-L111 | train |
jglobus/JGlobus | ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java | GlobusSSLSocketFactory.getTrustManagers | @Override
protected TrustManager[] getTrustManagers(String keystoreType, String keystoreProvider, String algorithm)
throws Exception {
KeyStore trustStore = getTrustStore(keystoreType, keystoreProvider);
CertStore crlStore = null;
if (crlLocation != null) {
crlStore ... | java | @Override
protected TrustManager[] getTrustManagers(String keystoreType, String keystoreProvider, String algorithm)
throws Exception {
KeyStore trustStore = getTrustStore(keystoreType, keystoreProvider);
CertStore crlStore = null;
if (crlLocation != null) {
crlStore ... | [
"@",
"Override",
"protected",
"TrustManager",
"[",
"]",
"getTrustManagers",
"(",
"String",
"keystoreType",
",",
"String",
"keystoreProvider",
",",
"String",
"algorithm",
")",
"throws",
"Exception",
"{",
"KeyStore",
"trustStore",
"=",
"getTrustStore",
"(",
"keystoreT... | Create a Globus trust manager which supports proxy certificates. This requires that the CRL store, and
signing policy store be configured.
@param keystoreType The type of keystore to create.
@param keystoreProvider The keystore provider to use.
@param algorithm The keystore algorithm.
@return A set of conf... | [
"Create",
"a",
"Globus",
"trust",
"manager",
"which",
"supports",
"proxy",
"certificates",
".",
"This",
"requires",
"that",
"the",
"CRL",
"store",
"and",
"signing",
"policy",
"store",
"be",
"configured",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies-tomcat/src/main/java/org/globus/gsi/tomcat/GlobusSSLSocketFactory.java#L71-L93 | train |
jglobus/JGlobus | gss/src/main/java/org/globus/net/PortRange.java | PortRange.getTcpInstance | public static synchronized PortRange getTcpInstance() {
if (tcpPortRange == null) {
tcpPortRange = new PortRange();
tcpPortRange.init(CoGProperties.getDefault().getTcpPortRange());
}
return tcpPortRange;
} | java | public static synchronized PortRange getTcpInstance() {
if (tcpPortRange == null) {
tcpPortRange = new PortRange();
tcpPortRange.init(CoGProperties.getDefault().getTcpPortRange());
}
return tcpPortRange;
} | [
"public",
"static",
"synchronized",
"PortRange",
"getTcpInstance",
"(",
")",
"{",
"if",
"(",
"tcpPortRange",
"==",
"null",
")",
"{",
"tcpPortRange",
"=",
"new",
"PortRange",
"(",
")",
";",
"tcpPortRange",
".",
"init",
"(",
"CoGProperties",
".",
"getDefault",
... | Returns PortRange instance for TCP listening sockets.
If the tcp.port.range property is set, the class
will be initialized with the specified port ranges.
@return PortRange the default instace of this class. | [
"Returns",
"PortRange",
"instance",
"for",
"TCP",
"listening",
"sockets",
".",
"If",
"the",
"tcp",
".",
"port",
".",
"range",
"property",
"is",
"set",
"the",
"class",
"will",
"be",
"initialized",
"with",
"the",
"specified",
"port",
"ranges",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/net/PortRange.java#L57-L63 | train |
jglobus/JGlobus | gss/src/main/java/org/globus/net/PortRange.java | PortRange.getTcpSourceInstance | public static synchronized PortRange getTcpSourceInstance() {
if (tcpSourcePortRange == null) {
tcpSourcePortRange = new PortRange();
tcpSourcePortRange.init(
CoGProperties.getDefault().getTcpSourcePortRange());
}
return tcpSourcePortRange;
} | java | public static synchronized PortRange getTcpSourceInstance() {
if (tcpSourcePortRange == null) {
tcpSourcePortRange = new PortRange();
tcpSourcePortRange.init(
CoGProperties.getDefault().getTcpSourcePortRange());
}
return tcpSourcePortRange;
} | [
"public",
"static",
"synchronized",
"PortRange",
"getTcpSourceInstance",
"(",
")",
"{",
"if",
"(",
"tcpSourcePortRange",
"==",
"null",
")",
"{",
"tcpSourcePortRange",
"=",
"new",
"PortRange",
"(",
")",
";",
"tcpSourcePortRange",
".",
"init",
"(",
"CoGProperties",
... | Returns PortRange instance for TCP source sockets.
If the tcp.source.port.range property is set, the class
will be initialized with the specified port ranges.
@return PortRange the default instace of this class. | [
"Returns",
"PortRange",
"instance",
"for",
"TCP",
"source",
"sockets",
".",
"If",
"the",
"tcp",
".",
"source",
".",
"port",
".",
"range",
"property",
"is",
"set",
"the",
"class",
"will",
"be",
"initialized",
"with",
"the",
"specified",
"port",
"ranges",
".... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/net/PortRange.java#L72-L79 | train |
jglobus/JGlobus | gss/src/main/java/org/globus/net/PortRange.java | PortRange.getUdpSourceInstance | public static synchronized PortRange getUdpSourceInstance() {
if (udpSourcePortRange == null) {
udpSourcePortRange = new PortRange();
udpSourcePortRange.init(
CoGProperties.getDefault().getUdpSourcePortRange());
}
return udpSourcePortRange;
} | java | public static synchronized PortRange getUdpSourceInstance() {
if (udpSourcePortRange == null) {
udpSourcePortRange = new PortRange();
udpSourcePortRange.init(
CoGProperties.getDefault().getUdpSourcePortRange());
}
return udpSourcePortRange;
} | [
"public",
"static",
"synchronized",
"PortRange",
"getUdpSourceInstance",
"(",
")",
"{",
"if",
"(",
"udpSourcePortRange",
"==",
"null",
")",
"{",
"udpSourcePortRange",
"=",
"new",
"PortRange",
"(",
")",
";",
"udpSourcePortRange",
".",
"init",
"(",
"CoGProperties",
... | Returns PortRange instance for UDP source sockets.
If the udp.source.port.range property is set, the class
will be initialized with the specified port ranges.
@return PortRange the default instace of this class. | [
"Returns",
"PortRange",
"instance",
"for",
"UDP",
"source",
"sockets",
".",
"If",
"the",
"udp",
".",
"source",
".",
"port",
".",
"range",
"property",
"is",
"set",
"the",
"class",
"will",
"be",
"initialized",
"with",
"the",
"specified",
"port",
"ranges",
".... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/net/PortRange.java#L88-L95 | train |
jglobus/JGlobus | gss/src/main/java/org/globus/net/PortRange.java | PortRange.getFreePort | public synchronized int getFreePort(int lastPortNumber)
throws IOException {
int id = 0;
if (lastPortNumber != 0) {
id = lastPortNumber - minPort;
if (id < 0) {
throw new IOException("Port number out of range.");
}
}
for(int i=i... | java | public synchronized int getFreePort(int lastPortNumber)
throws IOException {
int id = 0;
if (lastPortNumber != 0) {
id = lastPortNumber - minPort;
if (id < 0) {
throw new IOException("Port number out of range.");
}
}
for(int i=i... | [
"public",
"synchronized",
"int",
"getFreePort",
"(",
"int",
"lastPortNumber",
")",
"throws",
"IOException",
"{",
"int",
"id",
"=",
"0",
";",
"if",
"(",
"lastPortNumber",
"!=",
"0",
")",
"{",
"id",
"=",
"lastPortNumber",
"-",
"minPort",
";",
"if",
"(",
"i... | Returns first available port.
@param lastPortNumber port number to start finding the next
available port from. Set it to 0 if
called initialy.
@return the next available port number from the lastPortNumber.
@exception IOException if there is no more free ports available or
if the lastPortNumber is incorrect. | [
"Returns",
"first",
"available",
"port",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/net/PortRange.java#L116-L130 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/GlobusCredential.java | GlobusCredential.save | public void save(OutputStream out) throws IOException {
try {
cred.save(out);
} catch (CertificateEncodingException e) {
throw new ChainedIOException(e.getMessage(), e);
}
} | java | public void save(OutputStream out) throws IOException {
try {
cred.save(out);
} catch (CertificateEncodingException e) {
throw new ChainedIOException(e.getMessage(), e);
}
} | [
"public",
"void",
"save",
"(",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"try",
"{",
"cred",
".",
"save",
"(",
"out",
")",
";",
"}",
"catch",
"(",
"CertificateEncodingException",
"e",
")",
"{",
"throw",
"new",
"ChainedIOException",
"(",
"e"... | Saves the credential into a specified output stream. The self-signed certificates in the certificate
chain will not be saved. The output stream should always be closed after calling this function.
@param out
the output stream to write the credential to.
@exception IOException
if any error occurred during saving. | [
"Saves",
"the",
"credential",
"into",
"a",
"specified",
"output",
"stream",
".",
"The",
"self",
"-",
"signed",
"certificates",
"in",
"the",
"certificate",
"chain",
"will",
"not",
"be",
"saved",
".",
"The",
"output",
"stream",
"should",
"always",
"be",
"close... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/GlobusCredential.java#L142-L149 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/proxy/ext/ProxyCertInfo.java | ProxyCertInfo.toASN1Primitive | public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector vec = new ASN1EncodableVector();
if (this.pathLenConstraint != null) {
vec.add(this.pathLenConstraint);
}
vec.add(this.proxyPolicy.toASN1Primitive());
return new DERSequence(vec);
} | java | public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector vec = new ASN1EncodableVector();
if (this.pathLenConstraint != null) {
vec.add(this.pathLenConstraint);
}
vec.add(this.proxyPolicy.toASN1Primitive());
return new DERSequence(vec);
} | [
"public",
"ASN1Primitive",
"toASN1Primitive",
"(",
")",
"{",
"ASN1EncodableVector",
"vec",
"=",
"new",
"ASN1EncodableVector",
"(",
")",
";",
"if",
"(",
"this",
".",
"pathLenConstraint",
"!=",
"null",
")",
"{",
"vec",
".",
"add",
"(",
"this",
".",
"pathLenCon... | Returns the DER-encoded ASN.1 representation of the extension.
@return <code>DERObject</code> the encoded representation of the extension. | [
"Returns",
"the",
"DER",
"-",
"encoded",
"ASN",
".",
"1",
"representation",
"of",
"the",
"extension",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/proxy/ext/ProxyCertInfo.java#L131-L141 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/SigningPolicyChecker.java | SigningPolicyChecker.invoke | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
if (!requireSigningPolicyCheck(certType)) {
return;
}
X500Principal caPrincipal = cert.getIssuerX500Principal();
SigningPolicy policy;
try {
... | java | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
if (!requireSigningPolicyCheck(certType)) {
return;
}
X500Principal caPrincipal = cert.getIssuerX500Principal();
SigningPolicy policy;
try {
... | [
"public",
"void",
"invoke",
"(",
"X509Certificate",
"cert",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"CertPathValidatorException",
"{",
"if",
"(",
"!",
"requireSigningPolicyCheck",
"(",
"certType",
")",
")",
"{",
"return",
";",
"}",
... | Validate DN against the signing policy
@param cert The certificate to check.
@param certType The type of certificate to check.
@throws CertPathValidatorException if the certificate is invalid according to the signing policy. | [
"Validate",
"DN",
"against",
"the",
"signing",
"policy"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/SigningPolicyChecker.java#L48-L70 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/SigningPolicyChecker.java | SigningPolicyChecker.requireSigningPolicyCheck | private boolean requireSigningPolicyCheck(GSIConstants.CertificateType certType) {
return !ProxyCertificateUtil.isProxy(certType) && certType != GSIConstants.CertificateType.CA;
} | java | private boolean requireSigningPolicyCheck(GSIConstants.CertificateType certType) {
return !ProxyCertificateUtil.isProxy(certType) && certType != GSIConstants.CertificateType.CA;
} | [
"private",
"boolean",
"requireSigningPolicyCheck",
"(",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"{",
"return",
"!",
"ProxyCertificateUtil",
".",
"isProxy",
"(",
"certType",
")",
"&&",
"certType",
"!=",
"GSIConstants",
".",
"CertificateType",
".",
"C... | if a certificate is not a CA or if it is not a proxy, return true.
@param certType The type of Certificate being queried.
@return True if the CertificateType requires a Signing Policy check. | [
"if",
"a",
"certificate",
"is",
"not",
"a",
"CA",
"or",
"if",
"it",
"is",
"not",
"a",
"proxy",
"return",
"true",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/SigningPolicyChecker.java#L78-L81 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/dc/AbstractDataChannel.java | AbstractDataChannel.getDataChannelSource | public DataChannelReader getDataChannelSource(TransferContext context)
throws Exception {
String id = getHandlerID(session.transferMode, session.transferType, SOURCE);
logger.debug("type/mode: " + id);
Class clazz = (Class)dataHandlers.get(id);
if (clazz == null) {
throw new Exception("No data reader for type... | java | public DataChannelReader getDataChannelSource(TransferContext context)
throws Exception {
String id = getHandlerID(session.transferMode, session.transferType, SOURCE);
logger.debug("type/mode: " + id);
Class clazz = (Class)dataHandlers.get(id);
if (clazz == null) {
throw new Exception("No data reader for type... | [
"public",
"DataChannelReader",
"getDataChannelSource",
"(",
"TransferContext",
"context",
")",
"throws",
"Exception",
"{",
"String",
"id",
"=",
"getHandlerID",
"(",
"session",
".",
"transferMode",
",",
"session",
".",
"transferType",
",",
"SOURCE",
")",
";",
"logg... | currently context is only needed in case of EBlock mode | [
"currently",
"context",
"is",
"only",
"needed",
"in",
"case",
"of",
"EBlock",
"mode"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/dc/AbstractDataChannel.java#L147-L160 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/CRLChecker.java | CRLChecker.invoke | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
X500Principal certIssuer = cert.getIssuerX500Principal();
X509CRLSelector crlSelector = new X509CRLSelector();
crlSelector.addIssuer(certIssuer);
Collection<? extends CRL... | java | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
X500Principal certIssuer = cert.getIssuerX500Principal();
X509CRLSelector crlSelector = new X509CRLSelector();
crlSelector.addIssuer(certIssuer);
Collection<? extends CRL... | [
"public",
"void",
"invoke",
"(",
"X509Certificate",
"cert",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"CertPathValidatorException",
"{",
"X500Principal",
"certIssuer",
"=",
"cert",
".",
"getIssuerX500Principal",
"(",
")",
";",
"X509CRLSel... | Method that checks the if the certificate is in a CRL, if CRL is
available If no CRL is found, then no error is thrown If an expired CRL
is found, an error is thrown
@throws CertPathValidatorException If CRL or CA certificate could not be
loaded from store, CRL is not valid or
expired, certificate is revoked. | [
"Method",
"that",
"checks",
"the",
"if",
"the",
"certificate",
"is",
"in",
"a",
"CRL",
"if",
"CRL",
"is",
"available",
"If",
"no",
"CRL",
"is",
"found",
"then",
"no",
"error",
"is",
"thrown",
"If",
"an",
"expired",
"CRL",
"is",
"found",
"an",
"error",
... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/CRLChecker.java#L93-L154 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/exception/ServerException.java | ServerException.embedFTPReplyParseException | public static ServerException embedFTPReplyParseException(
FTPReplyParseException rpe,
String message) {
ServerException se = new ServerException(
WRONG_PROTOCOL,
message);
se.setRootCause(rpe);
return se;
} | java | public static ServerException embedFTPReplyParseException(
FTPReplyParseException rpe,
String message) {
ServerException se = new ServerException(
WRONG_PROTOCOL,
message);
se.setRootCause(rpe);
return se;
} | [
"public",
"static",
"ServerException",
"embedFTPReplyParseException",
"(",
"FTPReplyParseException",
"rpe",
",",
"String",
"message",
")",
"{",
"ServerException",
"se",
"=",
"new",
"ServerException",
"(",
"WRONG_PROTOCOL",
",",
"message",
")",
";",
"se",
".",
"setRo... | Constructs server exception with FTPReplyParseException
nested in it. | [
"Constructs",
"server",
"exception",
"with",
"FTPReplyParseException",
"nested",
"in",
"it",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/exception/ServerException.java#L76-L84 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/exception/ServerException.java | ServerException.embedUnexpectedReplyCodeException | public static ServerException embedUnexpectedReplyCodeException(
UnexpectedReplyCodeException urce,
String message) {
ServerException se = new ServerException(
SERVER_REFUSED,
message);
se.setRootCause(urce);
return se;
} | java | public static ServerException embedUnexpectedReplyCodeException(
UnexpectedReplyCodeException urce,
String message) {
ServerException se = new ServerException(
SERVER_REFUSED,
message);
se.setRootCause(urce);
return se;
} | [
"public",
"static",
"ServerException",
"embedUnexpectedReplyCodeException",
"(",
"UnexpectedReplyCodeException",
"urce",
",",
"String",
"message",
")",
"{",
"ServerException",
"se",
"=",
"new",
"ServerException",
"(",
"SERVER_REFUSED",
",",
"message",
")",
";",
"se",
... | Constructs server exception with UnexpectedReplyCodeException
nested in it. | [
"Constructs",
"server",
"exception",
"with",
"UnexpectedReplyCodeException",
"nested",
"in",
"it",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/exception/ServerException.java#L96-L104 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/I18n.java | I18n.getI18n | public static synchronized I18n getI18n(String resource) {
I18n instance = (I18n)mapping.get(resource);
if (instance == null) {
instance = new I18n(ResourceBundle.getBundle(resource,
Locale.getDefault(),
... | java | public static synchronized I18n getI18n(String resource) {
I18n instance = (I18n)mapping.get(resource);
if (instance == null) {
instance = new I18n(ResourceBundle.getBundle(resource,
Locale.getDefault(),
... | [
"public",
"static",
"synchronized",
"I18n",
"getI18n",
"(",
"String",
"resource",
")",
"{",
"I18n",
"instance",
"=",
"(",
"I18n",
")",
"mapping",
".",
"get",
"(",
"resource",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"instance",
"=",
"ne... | Retrieve a I18n instance by resource name.
@param resource resource name. See {@link
ResourceBundle#getBundle(String) ResourceBundle.getBundle()} | [
"Retrieve",
"a",
"I18n",
"instance",
"by",
"resource",
"name",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/I18n.java#L53-L62 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/HostPortList.java | HostPortList.toFtpCmdArgument | public String toFtpCmdArgument() {
if (this.sporCommandParam == null && this.vector != null) {
StringBuffer cmd = new StringBuffer();
for (int i = 0; i < this.vector.size(); i ++) {
HostPort hp = (HostPort)this.vector.get(i);
if (i != 0) {
... | java | public String toFtpCmdArgument() {
if (this.sporCommandParam == null && this.vector != null) {
StringBuffer cmd = new StringBuffer();
for (int i = 0; i < this.vector.size(); i ++) {
HostPort hp = (HostPort)this.vector.get(i);
if (i != 0) {
... | [
"public",
"String",
"toFtpCmdArgument",
"(",
")",
"{",
"if",
"(",
"this",
".",
"sporCommandParam",
"==",
"null",
"&&",
"this",
".",
"vector",
"!=",
"null",
")",
"{",
"StringBuffer",
"cmd",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"... | Returns the host-port infromation in the
format used by SPOR command.
@return host-port information in SPOR command parameter
representation. | [
"Returns",
"the",
"host",
"-",
"port",
"infromation",
"in",
"the",
"format",
"used",
"by",
"SPOR",
"command",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/HostPortList.java#L100-L113 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/TransferState.java | TransferState.transferError | public synchronized void transferError(Exception e) {
logger.debug("intercepted exception", e);
if (transferException == null) {
transferException = e;
} else if (transferException instanceof InterruptedException
|| transferException instanceof InterruptedIOException) {
//if one of the threads throws ... | java | public synchronized void transferError(Exception e) {
logger.debug("intercepted exception", e);
if (transferException == null) {
transferException = e;
} else if (transferException instanceof InterruptedException
|| transferException instanceof InterruptedIOException) {
//if one of the threads throws ... | [
"public",
"synchronized",
"void",
"transferError",
"(",
"Exception",
"e",
")",
"{",
"logger",
".",
"debug",
"(",
"\"intercepted exception\"",
",",
"e",
")",
";",
"if",
"(",
"transferException",
"==",
"null",
")",
"{",
"transferException",
"=",
"e",
";",
"}",... | this is called when an error occurs during transfer | [
"this",
"is",
"called",
"when",
"an",
"error",
"occurs",
"during",
"transfer"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/TransferState.java#L56-L69 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/TransferState.java | TransferState.waitForEnd | public synchronized void waitForEnd()
throws ServerException,
ClientException,
IOException {
try {
while(!isDone() && !hasError()) {
wait();
}
} catch(InterruptedException e) {
// break
}
checkError();
} | java | public synchronized void waitForEnd()
throws ServerException,
ClientException,
IOException {
try {
while(!isDone() && !hasError()) {
wait();
}
} catch(InterruptedException e) {
// break
}
checkError();
} | [
"public",
"synchronized",
"void",
"waitForEnd",
"(",
")",
"throws",
"ServerException",
",",
"ClientException",
",",
"IOException",
"{",
"try",
"{",
"while",
"(",
"!",
"isDone",
"(",
")",
"&&",
"!",
"hasError",
"(",
")",
")",
"{",
"wait",
"(",
")",
";",
... | Blocks until the transfer is complete or
the transfer fails. | [
"Blocks",
"until",
"the",
"transfer",
"is",
"complete",
"or",
"the",
"transfer",
"fails",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/TransferState.java#L83-L95 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/TransferState.java | TransferState.waitForStart | public synchronized void waitForStart()
throws ServerException,
ClientException,
IOException {
try {
while(!isStarted() && !hasError()) {
wait();
}
} catch(InterruptedException e) {
// break
}
checkError();
} | java | public synchronized void waitForStart()
throws ServerException,
ClientException,
IOException {
try {
while(!isStarted() && !hasError()) {
wait();
}
} catch(InterruptedException e) {
// break
}
checkError();
} | [
"public",
"synchronized",
"void",
"waitForStart",
"(",
")",
"throws",
"ServerException",
",",
"ClientException",
",",
"IOException",
"{",
"try",
"{",
"while",
"(",
"!",
"isStarted",
"(",
")",
"&&",
"!",
"hasError",
"(",
")",
")",
"{",
"wait",
"(",
")",
"... | Blocks until the transfer begins or
the transfer fails to start. | [
"Blocks",
"until",
"the",
"transfer",
"begins",
"or",
"the",
"transfer",
"fails",
"to",
"start",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/TransferState.java#L101-L113 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/X509NameHelper.java | X509NameHelper.add | public void add(
ASN1ObjectIdentifier oid,
String value) {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(oid);
v.add(new DERPrintableString(value));
add(new DERSet(new DERSequence(v)));
} | java | public void add(
ASN1ObjectIdentifier oid,
String value) {
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(oid);
v.add(new DERPrintableString(value));
add(new DERSet(new DERSequence(v)));
} | [
"public",
"void",
"add",
"(",
"ASN1ObjectIdentifier",
"oid",
",",
"String",
"value",
")",
"{",
"ASN1EncodableVector",
"v",
"=",
"new",
"ASN1EncodableVector",
"(",
")",
";",
"v",
".",
"add",
"(",
"oid",
")",
";",
"v",
".",
"add",
"(",
"new",
"DERPrintable... | Appends the specified OID and value pair name component to the end of the
current name.
@param oid the name component oid, e.g. {@link org.bouncycastle.asn1.x500.style.BCStyle#CN
BCStyle.CN}
@param value the value (e.g. "proxy") | [
"Appends",
"the",
"specified",
"OID",
"and",
"value",
"pair",
"name",
"component",
"to",
"the",
"end",
"of",
"the",
"current",
"name",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/X509NameHelper.java#L96-L103 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/X509NameHelper.java | X509NameHelper.add | public void add(ASN1Set entry) {
ASN1EncodableVector v = new ASN1EncodableVector();
int size = seq.size();
for (int i = 0; i < size; i++) {
v.add(seq.getObjectAt(i));
}
v.add(entry);
seq = new DERSequence(v);
} | java | public void add(ASN1Set entry) {
ASN1EncodableVector v = new ASN1EncodableVector();
int size = seq.size();
for (int i = 0; i < size; i++) {
v.add(seq.getObjectAt(i));
}
v.add(entry);
seq = new DERSequence(v);
} | [
"public",
"void",
"add",
"(",
"ASN1Set",
"entry",
")",
"{",
"ASN1EncodableVector",
"v",
"=",
"new",
"ASN1EncodableVector",
"(",
")",
";",
"int",
"size",
"=",
"seq",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size"... | Appends the specified name component entry to the current name. This can
be used to add handle multiple AVAs in one name component.
@param entry the name component to add. | [
"Appends",
"the",
"specified",
"name",
"component",
"entry",
"to",
"the",
"current",
"name",
".",
"This",
"can",
"be",
"used",
"to",
"add",
"handle",
"multiple",
"AVAs",
"in",
"one",
"name",
"component",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/X509NameHelper.java#L111-L119 | train |
jglobus/JGlobus | io/src/main/java/org/globus/io/gass/client/internal/GASSProtocol.java | GASSProtocol.GET | public static String GET(String path, String host) {
return HTTPProtocol.createGETHeader("/" + path, host, USER_AGENT);
} | java | public static String GET(String path, String host) {
return HTTPProtocol.createGETHeader("/" + path, host, USER_AGENT);
} | [
"public",
"static",
"String",
"GET",
"(",
"String",
"path",
",",
"String",
"host",
")",
"{",
"return",
"HTTPProtocol",
".",
"createGETHeader",
"(",
"\"/\"",
"+",
"path",
",",
"host",
",",
"USER_AGENT",
")",
";",
"}"
] | This method concatenates a properly formatted header for performing
Globus Gass GETs with the given information.
@param path the path of the file to get
@param host the host which contains the file to get
@return <code>String</code> the properly formatted header to be sent to a
gass server | [
"This",
"method",
"concatenates",
"a",
"properly",
"formatted",
"header",
"for",
"performing",
"Globus",
"Gass",
"GETs",
"with",
"the",
"given",
"information",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/gass/client/internal/GASSProtocol.java#L43-L45 | train |
jglobus/JGlobus | io/src/main/java/org/globus/io/gass/client/internal/GASSProtocol.java | GASSProtocol.PUT | public static String PUT(String path, String host, long length, boolean append) {
String newPath = null;
if (append) {
newPath = APPEND_URI + "/" + path;
} else {
newPath = "/" + path;
}
return HTTPProtocol.createPUTHeader(newPath, host, USER_AGENT,
TYPE, length, append);
} | java | public static String PUT(String path, String host, long length, boolean append) {
String newPath = null;
if (append) {
newPath = APPEND_URI + "/" + path;
} else {
newPath = "/" + path;
}
return HTTPProtocol.createPUTHeader(newPath, host, USER_AGENT,
TYPE, length, append);
} | [
"public",
"static",
"String",
"PUT",
"(",
"String",
"path",
",",
"String",
"host",
",",
"long",
"length",
",",
"boolean",
"append",
")",
"{",
"String",
"newPath",
"=",
"null",
";",
"if",
"(",
"append",
")",
"{",
"newPath",
"=",
"APPEND_URI",
"+",
"\"/\... | This method concatenates a properly formatted header for performing
Globus Gass PUTs with the given information.
@param path the path of the remote file to put to
@param host the host of the remote file to put to
@param length the length of data which will be sent (the size of the file)
@param append append mode
@ret... | [
"This",
"method",
"concatenates",
"a",
"properly",
"formatted",
"header",
"for",
"performing",
"Globus",
"Gass",
"PUTs",
"with",
"the",
"given",
"information",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/gass/client/internal/GASSProtocol.java#L58-L69 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java | FTPControlChannel.close | public void close() throws IOException {
logger.debug("ftp socket closed");
if (ftpIn != null)
ftpIn.close();
if (ftpOut != null)
ftpOut.close();
if (socket != null)
socket.close();
hasBeenOpened = false;
} | java | public void close() throws IOException {
logger.debug("ftp socket closed");
if (ftpIn != null)
ftpIn.close();
if (ftpOut != null)
ftpOut.close();
if (socket != null)
socket.close();
hasBeenOpened = false;
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"ftp socket closed\"",
")",
";",
"if",
"(",
"ftpIn",
"!=",
"null",
")",
"ftpIn",
".",
"close",
"(",
")",
";",
"if",
"(",
"ftpOut",
"!=",
"null",
")",
"f... | Closes the control channel | [
"Closes",
"the",
"control",
"channel"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java#L242-L252 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java | FTPControlChannel.read | public Reply read()
throws ServerException, IOException, FTPReplyParseException, EOFException {
Reply reply = new Reply(ftpIn);
//System.out.println("FTP IN string "+reply.toString());
if (logger.isDebugEnabled()) {
logger.debug("Control channel received: " + reply);
... | java | public Reply read()
throws ServerException, IOException, FTPReplyParseException, EOFException {
Reply reply = new Reply(ftpIn);
//System.out.println("FTP IN string "+reply.toString());
if (logger.isDebugEnabled()) {
logger.debug("Control channel received: " + reply);
... | [
"public",
"Reply",
"read",
"(",
")",
"throws",
"ServerException",
",",
"IOException",
",",
"FTPReplyParseException",
",",
"EOFException",
"{",
"Reply",
"reply",
"=",
"new",
"Reply",
"(",
"ftpIn",
")",
";",
"//System.out.println(\"FTP IN string \"+reply.toString());",
... | Block until a reply is available in the control channel.
@return the first unread reply from the control channel.
@throws IOException on I/O error
@throws FTPReplyParseException on malformatted server reply | [
"Block",
"until",
"a",
"reply",
"is",
"available",
"in",
"the",
"control",
"channel",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java#L371-L381 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java | FTPControlChannel.write | public void write(Command cmd)
throws IOException, IllegalArgumentException {
//we delete the initial reply when the first command is sent
if (cmd == null) {
throw new IllegalArgumentException("null argument: cmd");
}
if (logger.isDebugEnabled()) {
logger.... | java | public void write(Command cmd)
throws IOException, IllegalArgumentException {
//we delete the initial reply when the first command is sent
if (cmd == null) {
throw new IllegalArgumentException("null argument: cmd");
}
if (logger.isDebugEnabled()) {
logger.... | [
"public",
"void",
"write",
"(",
"Command",
"cmd",
")",
"throws",
"IOException",
",",
"IllegalArgumentException",
"{",
"//we delete the initial reply when the first command is sent",
"if",
"(",
"cmd",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(... | Sends the command over the control channel.
Do not wait for reply.
@throws java.io.IOException on I/O error
@param cmd FTP command | [
"Sends",
"the",
"command",
"over",
"the",
"control",
"channel",
".",
"Do",
"not",
"wait",
"for",
"reply",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java#L392-L402 | train |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java | FTPControlChannel.exchange | public Reply exchange(Command cmd)
throws ServerException, IOException, FTPReplyParseException {
// send the command
write(cmd);
// get the reply
return read();
} | java | public Reply exchange(Command cmd)
throws ServerException, IOException, FTPReplyParseException {
// send the command
write(cmd);
// get the reply
return read();
} | [
"public",
"Reply",
"exchange",
"(",
"Command",
"cmd",
")",
"throws",
"ServerException",
",",
"IOException",
",",
"FTPReplyParseException",
"{",
"// send the command",
"write",
"(",
"cmd",
")",
";",
"// get the reply",
"return",
"read",
"(",
")",
";",
"}"
] | Write the command to the control channel,
block until reply arrives and return the reply.
Before calling this method make sure that no old replies are
waiting on the control channel. Otherwise the reply returned
may not be the reply to this command.
@throws java.io.IOException on I/O error
@throws FTPReplyParseExceptio... | [
"Write",
"the",
"command",
"to",
"the",
"control",
"channel",
"block",
"until",
"reply",
"arrives",
"and",
"return",
"the",
"reply",
".",
"Before",
"calling",
"this",
"method",
"make",
"sure",
"that",
"no",
"old",
"replies",
"are",
"waiting",
"on",
"the",
... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/vanilla/FTPControlChannel.java#L415-L421 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java | ClassLoaderUtils.getClassContextAt | public static Class getClassContextAt(int i) {
Class[] classes = MANAGER.getClassContext();
if (classes != null && classes.length > i) {
return classes[i];
}
return null;
} | java | public static Class getClassContextAt(int i) {
Class[] classes = MANAGER.getClassContext();
if (classes != null && classes.length > i) {
return classes[i];
}
return null;
} | [
"public",
"static",
"Class",
"getClassContextAt",
"(",
"int",
"i",
")",
"{",
"Class",
"[",
"]",
"classes",
"=",
"MANAGER",
".",
"getClassContext",
"(",
")",
";",
"if",
"(",
"classes",
"!=",
"null",
"&&",
"classes",
".",
"length",
">",
"i",
")",
"{",
... | Returns a class at specified depth of the current execution stack.
@return the class at the specified depth of the current execution stack.
Migth return null if depth is out of range. | [
"Returns",
"a",
"class",
"at",
"specified",
"depth",
"of",
"the",
"current",
"execution",
"stack",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java#L53-L59 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java | ClassLoaderUtils.getClassLoaderContextAt | public static ClassLoader getClassLoaderContextAt(int i) {
Class[] classes = MANAGER.getClassContext();
if (classes != null && classes.length > i) {
return classes[i].getClassLoader();
}
return null;
} | java | public static ClassLoader getClassLoaderContextAt(int i) {
Class[] classes = MANAGER.getClassContext();
if (classes != null && classes.length > i) {
return classes[i].getClassLoader();
}
return null;
} | [
"public",
"static",
"ClassLoader",
"getClassLoaderContextAt",
"(",
"int",
"i",
")",
"{",
"Class",
"[",
"]",
"classes",
"=",
"MANAGER",
".",
"getClassContext",
"(",
")",
";",
"if",
"(",
"classes",
"!=",
"null",
"&&",
"classes",
".",
"length",
">",
"i",
")... | Returns a classloader at specified depth of the current execution stack.
@return the classloader at the specified depth of the current execution
stack. Migth return null if depth is out of range. | [
"Returns",
"a",
"classloader",
"at",
"specified",
"depth",
"of",
"the",
"current",
"execution",
"stack",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java#L67-L73 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java | ClassLoaderUtils.getResourceAsStream | public static InputStream getResourceAsStream(String name) {
// try with caller classloader
ClassLoader loader = getClassLoaderContextAt(3);
InputStream in = (loader == null) ? null : loader.getResourceAsStream(name);
if (in == null) {
// try with context classloader if set & different
ClassLoader context... | java | public static InputStream getResourceAsStream(String name) {
// try with caller classloader
ClassLoader loader = getClassLoaderContextAt(3);
InputStream in = (loader == null) ? null : loader.getResourceAsStream(name);
if (in == null) {
// try with context classloader if set & different
ClassLoader context... | [
"public",
"static",
"InputStream",
"getResourceAsStream",
"(",
"String",
"name",
")",
"{",
"// try with caller classloader",
"ClassLoader",
"loader",
"=",
"getClassLoaderContextAt",
"(",
"3",
")",
";",
"InputStream",
"in",
"=",
"(",
"loader",
"==",
"null",
")",
"?... | Gets an InputStream to a resource of a specified name. First, the
caller's classloader is used to load the resource and if it fails the
thread's context classloader is used to load the resource. | [
"Gets",
"an",
"InputStream",
"to",
"a",
"resource",
"of",
"a",
"specified",
"name",
".",
"First",
"the",
"caller",
"s",
"classloader",
"is",
"used",
"to",
"load",
"the",
"resource",
"and",
"if",
"it",
"fails",
"the",
"thread",
"s",
"context",
"classloader"... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java#L80-L92 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java | ClassLoaderUtils.forName | public static Class forName(String name) throws ClassNotFoundException {
// try with caller classloader
ClassLoader loader = getClassLoaderContextAt(3);
try {
return Class.forName(name, true, loader);
} catch (ClassNotFoundException e) {
// try with context classloader if set & different
ClassLoader co... | java | public static Class forName(String name) throws ClassNotFoundException {
// try with caller classloader
ClassLoader loader = getClassLoaderContextAt(3);
try {
return Class.forName(name, true, loader);
} catch (ClassNotFoundException e) {
// try with context classloader if set & different
ClassLoader co... | [
"public",
"static",
"Class",
"forName",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"// try with caller classloader",
"ClassLoader",
"loader",
"=",
"getClassLoaderContextAt",
"(",
"3",
")",
";",
"try",
"{",
"return",
"Class",
".",
"forName",... | Loads a specified class. First, the caller's classloader is used to load
the class and if it fails the thread's context classloader is used to
load the specified class. | [
"Loads",
"a",
"specified",
"class",
".",
"First",
"the",
"caller",
"s",
"classloader",
"is",
"used",
"to",
"load",
"the",
"class",
"and",
"if",
"it",
"fails",
"the",
"thread",
"s",
"context",
"classloader",
"is",
"used",
"to",
"load",
"the",
"specified",
... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java#L99-L113 | train |
jglobus/JGlobus | io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java | RemoteGassServer.start | public void start(String rmc)
throws GassException {
if (rmc == null) {
throw new IllegalArgumentException("Resource manager contact not specified");
}
GassServer gassServer = null;
String error = null;
try {
gassServer = new GassServer(this.cred, 0);
String gassURL = gassServer... | java | public void start(String rmc)
throws GassException {
if (rmc == null) {
throw new IllegalArgumentException("Resource manager contact not specified");
}
GassServer gassServer = null;
String error = null;
try {
gassServer = new GassServer(this.cred, 0);
String gassURL = gassServer... | [
"public",
"void",
"start",
"(",
"String",
"rmc",
")",
"throws",
"GassException",
"{",
"if",
"(",
"rmc",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Resource manager contact not specified\"",
")",
";",
"}",
"GassServer",
"gassServer"... | Starts the gass server on the remote machine.
@param rmc resource manager contact of the remote machine.
@exception GassException if any error occurs during
remote startup. | [
"Starts",
"the",
"gass",
"server",
"on",
"the",
"remote",
"machine",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java#L148-L234 | train |
jglobus/JGlobus | io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java | RemoteGassServer.shutdown | public boolean shutdown() {
if (url != null) {
logger.debug("Trying to shutdown gass server directly...");
try {
GlobusURL u = new GlobusURL(url);
GassServer.shutdown(this.cred, u);
} catch(Exception e) {
logger.debug("gass server shutdown failed", e);
}
try {
gassJobListener.reset()... | java | public boolean shutdown() {
if (url != null) {
logger.debug("Trying to shutdown gass server directly...");
try {
GlobusURL u = new GlobusURL(url);
GassServer.shutdown(this.cred, u);
} catch(Exception e) {
logger.debug("gass server shutdown failed", e);
}
try {
gassJobListener.reset()... | [
"public",
"boolean",
"shutdown",
"(",
")",
"{",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Trying to shutdown gass server directly...\"",
")",
";",
"try",
"{",
"GlobusURL",
"u",
"=",
"new",
"GlobusURL",
"(",
"url",
")",
";",
... | Shutdowns remotely running gass server.
@return true if server was successfully killed, false
otherwise. | [
"Shutdowns",
"remotely",
"running",
"gass",
"server",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java#L242-L281 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/Util.java | Util.createFile | public static File createFile(String filename)
throws SecurityException, IOException {
File f = new File(filename);
if (!f.createNewFile()) {
if (!destroy(f)) {
throw new SecurityException(
"Could not destroy existing file");
... | java | public static File createFile(String filename)
throws SecurityException, IOException {
File f = new File(filename);
if (!f.createNewFile()) {
if (!destroy(f)) {
throw new SecurityException(
"Could not destroy existing file");
... | [
"public",
"static",
"File",
"createFile",
"(",
"String",
"filename",
")",
"throws",
"SecurityException",
",",
"IOException",
"{",
"File",
"f",
"=",
"new",
"File",
"(",
"filename",
")",
";",
"if",
"(",
"!",
"f",
".",
"createNewFile",
"(",
")",
")",
"{",
... | Attempts to create a new file in an atomic way.
If the file already exists, it if first deleted.
@param filename the name of file to create.
@return the created file.
@throws SecurityException if the existing file cannot be deleted.
@throws IOException if an I/O error occurred. | [
"Attempts",
"to",
"create",
"a",
"new",
"file",
"in",
"an",
"atomic",
"way",
".",
"If",
"the",
"file",
"already",
"exists",
"it",
"if",
"first",
"deleted",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L45-L60 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/Util.java | Util.destroy | public static boolean destroy(File file) {
if (!file.exists()) return false;
RandomAccessFile f = null;
long size = file.length();
try {
f = new RandomAccessFile(file, "rw");
long rec = size/DMSG.length();
int left = (int)(size - rec*DMSG.length());
... | java | public static boolean destroy(File file) {
if (!file.exists()) return false;
RandomAccessFile f = null;
long size = file.length();
try {
f = new RandomAccessFile(file, "rw");
long rec = size/DMSG.length();
int left = (int)(size - rec*DMSG.length());
... | [
"public",
"static",
"boolean",
"destroy",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"return",
"false",
";",
"RandomAccessFile",
"f",
"=",
"null",
";",
"long",
"size",
"=",
"file",
".",
"length",
"(",
")",
... | Overwrites the contents of the file with a random
string and then deletes the file.
@param file file to remove | [
"Overwrites",
"the",
"contents",
"of",
"the",
"file",
"with",
"a",
"random",
"string",
"and",
"then",
"deletes",
"the",
"file",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L139-L164 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/Util.java | Util.getInput | public static String getInput(String prompt) {
System.out.print(prompt);
try {
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
return in.readLine();
} catch(IOException e) {
return null;
}
} | java | public static String getInput(String prompt) {
System.out.print(prompt);
try {
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
return in.readLine();
} catch(IOException e) {
return null;
}
} | [
"public",
"static",
"String",
"getInput",
"(",
"String",
"prompt",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"prompt",
")",
";",
"try",
"{",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"System",
".",... | Displays a prompt and then reads in the input from System.in.
@param prompt the prompt to be displayed
@return <code>String</code> the input read in (entered after the prompt) | [
"Displays",
"a",
"prompt",
"and",
"then",
"reads",
"in",
"the",
"input",
"from",
"System",
".",
"in",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L172-L182 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/Util.java | Util.getPrivateInput | public static String getPrivateInput(String prompt) {
System.out.print(prompt);
PrivateInputThread privateInput = new PrivateInputThread();
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
privateInput.start();
try {
return in.re... | java | public static String getPrivateInput(String prompt) {
System.out.print(prompt);
PrivateInputThread privateInput = new PrivateInputThread();
BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
privateInput.start();
try {
return in.re... | [
"public",
"static",
"String",
"getPrivateInput",
"(",
"String",
"prompt",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"prompt",
")",
";",
"PrivateInputThread",
"privateInput",
"=",
"new",
"PrivateInputThread",
"(",
")",
";",
"BufferedReader",
"in",
"=",... | Displays a prompt and then reads in private input from System.in.
Characters typed by the user are replaced with a space on the screen.
@param prompt the prompt to be displayed
@return <code>String</code> the input read in (entered after the prompt) | [
"Displays",
"a",
"prompt",
"and",
"then",
"reads",
"in",
"private",
"input",
"from",
"System",
".",
"in",
".",
"Characters",
"typed",
"by",
"the",
"user",
"are",
"replaced",
"with",
"a",
"space",
"on",
"the",
"screen",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L191-L206 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/Util.java | Util.quote | public static String quote(String str) {
int len = str.length();
StringBuffer buf = new StringBuffer(len+2);
buf.append("\"");
char c;
for (int i=0;i<len;i++) {
c = str.charAt(i);
if (c == '"' || c == '\\') {
buf.append("\\");
}... | java | public static String quote(String str) {
int len = str.length();
StringBuffer buf = new StringBuffer(len+2);
buf.append("\"");
char c;
for (int i=0;i<len;i++) {
c = str.charAt(i);
if (c == '"' || c == '\\') {
buf.append("\\");
}... | [
"public",
"static",
"String",
"quote",
"(",
"String",
"str",
")",
"{",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"len",
"+",
"2",
")",
";",
"buf",
".",
"append",
"(",
"\"\\\"\"",
... | Quotifies a specified string.
The entire string is encompassed by double quotes and each
" is replaced with \", \ is replaced with \\.
@param str the string to quotify
@return quotified and escaped string | [
"Quotifies",
"a",
"specified",
"string",
".",
"The",
"entire",
"string",
"is",
"encompassed",
"by",
"double",
"quotes",
"and",
"each",
"is",
"replaced",
"with",
"\\",
"\\",
"is",
"replaced",
"with",
"\\\\",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L237-L251 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/Util.java | Util.unquote | public static String unquote(String str)
throws Exception {
int len = str.length();
StringBuffer buf = new StringBuffer(len);
boolean inQuotes = false;
char c;
int i = 0;
if (str.charAt(i) == '"') {
inQuotes = true;
i++;
}
... | java | public static String unquote(String str)
throws Exception {
int len = str.length();
StringBuffer buf = new StringBuffer(len);
boolean inQuotes = false;
char c;
int i = 0;
if (str.charAt(i) == '"') {
inQuotes = true;
i++;
}
... | [
"public",
"static",
"String",
"unquote",
"(",
"String",
"str",
")",
"throws",
"Exception",
"{",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"len",
")",
";",
"boolean",
"inQuotes",
"=",
... | Dequotifies a specified string.
The quotes are removed and each \" is replaced with " and
each \\ is replaced with \.
@param str the string to dequotify.
@return unquotified string. | [
"Dequotifies",
"a",
"specified",
"string",
".",
"The",
"quotes",
"are",
"removed",
"and",
"each",
"\\",
"is",
"replaced",
"with",
"and",
"each",
"\\\\",
"is",
"replaced",
"with",
"\\",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L261-L298 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCredential | public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime,
GSIConstants.CertificateType certType, X509ExtensionSet extSet, String cnValue) throws GeneralSecurityException {
X509Certificate[] bcCerts = getX509CertificateObjectChain(certs);
Key... | java | public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime,
GSIConstants.CertificateType certType, X509ExtensionSet extSet, String cnValue) throws GeneralSecurityException {
X509Certificate[] bcCerts = getX509CertificateObjectChain(certs);
Key... | [
"public",
"X509Credential",
"createCredential",
"(",
"X509Certificate",
"[",
"]",
"certs",
",",
"PrivateKey",
"privateKey",
",",
"int",
"bits",
",",
"int",
"lifetime",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
",",
"X509ExtensionSet",
"extSet",
",",
... | Creates a new proxy credential from the specified certificate chain and a private key. A set of X.509
extensions can be optionally included in the new proxy certificate. This function automatically creates
a "RSA"-based key pair.
@see #createProxyCertificate(X509Certificate, PrivateKey, PublicKey, int, int, X509Extens... | [
"Creates",
"a",
"new",
"proxy",
"credential",
"from",
"the",
"specified",
"certificate",
"chain",
"and",
"a",
"private",
"key",
".",
"A",
"set",
"of",
"X",
".",
"509",
"extensions",
"can",
"be",
"optionally",
"included",
"in",
"the",
"new",
"proxy",
"certi... | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L645-L663 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.loadCertificate | public X509Certificate loadCertificate(InputStream in) throws IOException, GeneralSecurityException {
ASN1InputStream derin = new ASN1InputStream(in);
ASN1Primitive certInfo = derin.readObject();
ASN1Sequence seq = ASN1Sequence.getInstance(certInfo);
return new X509CertificateObject(Cert... | java | public X509Certificate loadCertificate(InputStream in) throws IOException, GeneralSecurityException {
ASN1InputStream derin = new ASN1InputStream(in);
ASN1Primitive certInfo = derin.readObject();
ASN1Sequence seq = ASN1Sequence.getInstance(certInfo);
return new X509CertificateObject(Cert... | [
"public",
"X509Certificate",
"loadCertificate",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"ASN1InputStream",
"derin",
"=",
"new",
"ASN1InputStream",
"(",
"in",
")",
";",
"ASN1Primitive",
"certInfo",
"=",
"derin",
"... | Loads a X509 certificate from the specified input stream. Input stream must contain DER-encoded
certificate.
@param in
the input stream to read the certificate from.
@return <code>X509Certificate</code> the loaded certificate.
@exception GeneralSecurityException
if certificate failed to load. | [
"Loads",
"a",
"X509",
"certificate",
"from",
"the",
"specified",
"input",
"stream",
".",
"Input",
"stream",
"must",
"contain",
"DER",
"-",
"encoded",
"certificate",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L924-L929 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCertificateRequest | public byte[] createCertificateRequest(X509Name subjectDN, String sigAlgName, KeyPair keyPair)
throws GeneralSecurityException {
DERSet attrs = null;
PKCS10CertificationRequest certReq = null;
certReq = new PKCS10CertificationRequest(sigAlgName, subjectDN, keyPair.getPublic(), attrs, key... | java | public byte[] createCertificateRequest(X509Name subjectDN, String sigAlgName, KeyPair keyPair)
throws GeneralSecurityException {
DERSet attrs = null;
PKCS10CertificationRequest certReq = null;
certReq = new PKCS10CertificationRequest(sigAlgName, subjectDN, keyPair.getPublic(), attrs, key... | [
"public",
"byte",
"[",
"]",
"createCertificateRequest",
"(",
"X509Name",
"subjectDN",
",",
"String",
"sigAlgName",
",",
"KeyPair",
"keyPair",
")",
"throws",
"GeneralSecurityException",
"{",
"DERSet",
"attrs",
"=",
"null",
";",
"PKCS10CertificationRequest",
"certReq",
... | Creates a certificate request from the specified subject name, signing algorithm, and a key pair.
@param subjectDN
the subject name of the certificate request.
@param sigAlgName
the signing algorithm name.
@param keyPair
the key pair of the certificate request
@return the certificate request.
@exception GeneralSecurit... | [
"Creates",
"a",
"certificate",
"request",
"from",
"the",
"specified",
"subject",
"name",
"signing",
"algorithm",
"and",
"a",
"key",
"pair",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L983-L991 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.decideProxyType | public static GSIConstants.CertificateType decideProxyType(
X509Certificate issuerCert, GSIConstants.DelegationType delegType)
throws CertificateException {
GSIConstants.CertificateType proxyType = GSIConstants.CertificateType.UNDEFINED;
if (delegType == GSIConstants.DelegationTy... | java | public static GSIConstants.CertificateType decideProxyType(
X509Certificate issuerCert, GSIConstants.DelegationType delegType)
throws CertificateException {
GSIConstants.CertificateType proxyType = GSIConstants.CertificateType.UNDEFINED;
if (delegType == GSIConstants.DelegationTy... | [
"public",
"static",
"GSIConstants",
".",
"CertificateType",
"decideProxyType",
"(",
"X509Certificate",
"issuerCert",
",",
"GSIConstants",
".",
"DelegationType",
"delegType",
")",
"throws",
"CertificateException",
"{",
"GSIConstants",
".",
"CertificateType",
"proxyType",
"... | Given a delegation mode and an issuing certificate, decides an
appropriate certificate type to use for proxies
@param issuerCert the issuing certificate of a prospective proxy
@param delegType the desired delegation mode
@return the appropriate certificate type for proxies or
GSIConstants.CertificateType.UNDEFINED when... | [
"Given",
"a",
"delegation",
"mode",
"and",
"an",
"issuing",
"certificate",
"decides",
"an",
"appropriate",
"certificate",
"type",
"to",
"use",
"for",
"proxies"
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L1004-L1046 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslNode.java | RslNode.getParam | public NameOpValue getParam(String attribute) {
if (_relations == null || attribute == null) return null;
return (NameOpValue)_relations.get(canonicalize(attribute));
} | java | public NameOpValue getParam(String attribute) {
if (_relations == null || attribute == null) return null;
return (NameOpValue)_relations.get(canonicalize(attribute));
} | [
"public",
"NameOpValue",
"getParam",
"(",
"String",
"attribute",
")",
"{",
"if",
"(",
"_relations",
"==",
"null",
"||",
"attribute",
"==",
"null",
")",
"return",
"null",
";",
"return",
"(",
"NameOpValue",
")",
"_relations",
".",
"get",
"(",
"canonicalize",
... | Returns the relation associated with the given attribute.
@param attribute the attribute of the relation.
@return the relation for the attribute. Null, if not found. | [
"Returns",
"the",
"relation",
"associated",
"with",
"the",
"given",
"attribute",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslNode.java#L105-L108 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslNode.java | RslNode.removeBindings | public Bindings removeBindings(String attribute) {
if (_relations == null || attribute == null) return null;
return (Bindings)_bindings.remove(canonicalize(attribute));
} | java | public Bindings removeBindings(String attribute) {
if (_relations == null || attribute == null) return null;
return (Bindings)_bindings.remove(canonicalize(attribute));
} | [
"public",
"Bindings",
"removeBindings",
"(",
"String",
"attribute",
")",
"{",
"if",
"(",
"_relations",
"==",
"null",
"||",
"attribute",
"==",
"null",
")",
"return",
"null",
";",
"return",
"(",
"Bindings",
")",
"_bindings",
".",
"remove",
"(",
"canonicalize",... | Removes a bindings list for the specified attribute.
@param attribute the attribute name for the
bindings.
@return the bindings that were removed. | [
"Removes",
"a",
"bindings",
"list",
"for",
"the",
"specified",
"attribute",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslNode.java#L142-L145 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslNode.java | RslNode.toRSL | public void toRSL(StringBuffer buf, boolean explicitConcat) {
Iterator iter;
buf.append( getOperatorAsString() );
if (_bindings != null && _bindings.size() > 0) {
iter = _bindings.keySet().iterator();
Bindings binds;
while( iter.hasNext() ) {
binds = getBindings( (String)iter.next() );
binds.toR... | java | public void toRSL(StringBuffer buf, boolean explicitConcat) {
Iterator iter;
buf.append( getOperatorAsString() );
if (_bindings != null && _bindings.size() > 0) {
iter = _bindings.keySet().iterator();
Bindings binds;
while( iter.hasNext() ) {
binds = getBindings( (String)iter.next() );
binds.toR... | [
"public",
"void",
"toRSL",
"(",
"StringBuffer",
"buf",
",",
"boolean",
"explicitConcat",
")",
"{",
"Iterator",
"iter",
";",
"buf",
".",
"append",
"(",
"getOperatorAsString",
"(",
")",
")",
";",
"if",
"(",
"_bindings",
"!=",
"null",
"&&",
"_bindings",
".",
... | Produces a RSL representation of node.
@param buf buffer to add the RSL representation to.
@param explicitConcat if true explicit concatination will
be used in RSL strings. | [
"Produces",
"a",
"RSL",
"representation",
"of",
"node",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslNode.java#L226-L259 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.getSingle | public String getSingle(String attribute) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return null;
Object obj = nv.getFirstValue();
if (obj != null && obj instanceof Value) {
return ((Value)obj).getCompleteValue();
} else {
return null;
}
} | java | public String getSingle(String attribute) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return null;
Object obj = nv.getFirstValue();
if (obj != null && obj instanceof Value) {
return ((Value)obj).getCompleteValue();
} else {
return null;
}
} | [
"public",
"String",
"getSingle",
"(",
"String",
"attribute",
")",
"{",
"NameOpValue",
"nv",
"=",
"rslTree",
".",
"getParam",
"(",
"attribute",
")",
";",
"if",
"(",
"nv",
"==",
"null",
"||",
"nv",
".",
"getOperator",
"(",
")",
"!=",
"NameOpValue",
".",
... | Returns a string value of the specified attribute.
If the attribute contains multiple values the
first one is returned.
@param attribute the rsl attribute to return the value of.
@return value of the relation. Null is returned if there is
no such attribute of the attribute/value relation is
not an equality relation. | [
"Returns",
"a",
"string",
"value",
"of",
"the",
"specified",
"attribute",
".",
"If",
"the",
"attribute",
"contains",
"multiple",
"values",
"the",
"first",
"one",
"is",
"returned",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L78-L87 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.getMulti | public List getMulti(String attribute) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return null;
List values = nv.getValues();
List list = new LinkedList();
Iterator iter = values.iterator();
Object obj;
while( iter.hasNext() ) {
obj = iter.next();
... | java | public List getMulti(String attribute) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return null;
List values = nv.getValues();
List list = new LinkedList();
Iterator iter = values.iterator();
Object obj;
while( iter.hasNext() ) {
obj = iter.next();
... | [
"public",
"List",
"getMulti",
"(",
"String",
"attribute",
")",
"{",
"NameOpValue",
"nv",
"=",
"rslTree",
".",
"getParam",
"(",
"attribute",
")",
";",
"if",
"(",
"nv",
"==",
"null",
"||",
"nv",
".",
"getOperator",
"(",
")",
"!=",
"NameOpValue",
".",
"EQ... | Returns a list of strings for a specified attribute.
For example for 'arguments' attribute.
@param attribute the rsl attribute to return the values of.
@return the list of values of the relation. Each value is
a string. Null is returned if there is no such
attribute or the attribute/values relation is not
an equality ... | [
"Returns",
"a",
"list",
"of",
"strings",
"for",
"a",
"specified",
"attribute",
".",
"For",
"example",
"for",
"arguments",
"attribute",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L99-L113 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.addVariable | public void addVariable(String attribute, String varName, String value) {
Bindings binds = rslTree.getBindings(attribute);
if (binds == null) {
binds = new Bindings(attribute);
rslTree.put(binds);
}
binds.add(new Binding(varName, value));
} | java | public void addVariable(String attribute, String varName, String value) {
Bindings binds = rslTree.getBindings(attribute);
if (binds == null) {
binds = new Bindings(attribute);
rslTree.put(binds);
}
binds.add(new Binding(varName, value));
} | [
"public",
"void",
"addVariable",
"(",
"String",
"attribute",
",",
"String",
"varName",
",",
"String",
"value",
")",
"{",
"Bindings",
"binds",
"=",
"rslTree",
".",
"getBindings",
"(",
"attribute",
")",
";",
"if",
"(",
"binds",
"==",
"null",
")",
"{",
"bin... | Adds a new variable definition to the specified variable definitions
attribute.
@param attribute the variable definitions attribute - rsl_subsititution.
@param varName the variable name to add.
@param value the value of the variable to add. | [
"Adds",
"a",
"new",
"variable",
"definition",
"to",
"the",
"specified",
"variable",
"definitions",
"attribute",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L189-L196 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.removeVariable | public boolean removeVariable(String attribute, String varName) {
Bindings binds = rslTree.getBindings(attribute);
if (binds == null) return false;
return binds.removeVariable(varName);
} | java | public boolean removeVariable(String attribute, String varName) {
Bindings binds = rslTree.getBindings(attribute);
if (binds == null) return false;
return binds.removeVariable(varName);
} | [
"public",
"boolean",
"removeVariable",
"(",
"String",
"attribute",
",",
"String",
"varName",
")",
"{",
"Bindings",
"binds",
"=",
"rslTree",
".",
"getBindings",
"(",
"attribute",
")",
";",
"if",
"(",
"binds",
"==",
"null",
")",
"return",
"false",
";",
"retu... | Removes a specific variable definition given a variable name.
@param attribute the attribute that defines variable definitions.
@param varName the name of the variable to remove.
@return true if the variable was successfully removed. Otherwise,
returns false, | [
"Removes",
"a",
"specific",
"variable",
"definition",
"given",
"a",
"variable",
"name",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L206-L210 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.remove | public boolean remove(String attribute, String value) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return false;
return nv.remove(new Value(value));
} | java | public boolean remove(String attribute, String value) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return false;
return nv.remove(new Value(value));
} | [
"public",
"boolean",
"remove",
"(",
"String",
"attribute",
",",
"String",
"value",
")",
"{",
"NameOpValue",
"nv",
"=",
"rslTree",
".",
"getParam",
"(",
"attribute",
")",
";",
"if",
"(",
"nv",
"==",
"null",
"||",
"nv",
".",
"getOperator",
"(",
")",
"!="... | Removes a specific value from a list of values of the specified
attribute.
@param attribute the attribute from which to remote the value from.
@param value the specific value to remove.
@return true if the value was successfully removed. Otherwise,
returns false, | [
"Removes",
"a",
"specific",
"value",
"from",
"a",
"list",
"of",
"values",
"of",
"the",
"specified",
"attribute",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L230-L234 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.removeMap | public boolean removeMap(String attribute, String key) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return false;
List values = nv.getValues();
Iterator iter = values.iterator();
Object obj;
int i=0;
int found = -1;
while( iter.hasNext() ) {
obj = it... | java | public boolean removeMap(String attribute, String key) {
NameOpValue nv = rslTree.getParam(attribute);
if (nv == null || nv.getOperator() != NameOpValue.EQ) return false;
List values = nv.getValues();
Iterator iter = values.iterator();
Object obj;
int i=0;
int found = -1;
while( iter.hasNext() ) {
obj = it... | [
"public",
"boolean",
"removeMap",
"(",
"String",
"attribute",
",",
"String",
"key",
")",
"{",
"NameOpValue",
"nv",
"=",
"rslTree",
".",
"getParam",
"(",
"attribute",
")",
";",
"if",
"(",
"nv",
"==",
"null",
"||",
"nv",
".",
"getOperator",
"(",
")",
"!=... | Removes a specific key from a list of values of the specified
attribute. The attribute values must be in the right form. See
the 'environment' rsl attribute.
@param attribute the attribute to remove the key from.
@param key the key to remove.
@return true if the key was successfully removed. Otherwise,
returns false. | [
"Removes",
"a",
"specific",
"key",
"from",
"a",
"list",
"of",
"values",
"of",
"the",
"specified",
"attribute",
".",
"The",
"attribute",
"values",
"must",
"be",
"in",
"the",
"right",
"form",
".",
"See",
"the",
"environment",
"rsl",
"attribute",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L246-L275 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.add | public void add(String attribute, String value) {
NameOpValue nv = getRelation(attribute);
nv.add(new Value(value));
} | java | public void add(String attribute, String value) {
NameOpValue nv = getRelation(attribute);
nv.add(new Value(value));
} | [
"public",
"void",
"add",
"(",
"String",
"attribute",
",",
"String",
"value",
")",
"{",
"NameOpValue",
"nv",
"=",
"getRelation",
"(",
"attribute",
")",
";",
"nv",
".",
"add",
"(",
"new",
"Value",
"(",
"value",
")",
")",
";",
"}"
] | Adds a simple value to the list of values of a given
attribute.
@param attribute the attribute to add the value to.
@param value the value to add. | [
"Adds",
"a",
"simple",
"value",
"to",
"the",
"list",
"of",
"values",
"of",
"a",
"given",
"attribute",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L306-L309 | train |
jglobus/JGlobus | gram/src/main/java/org/globus/rsl/RslAttributes.java | RslAttributes.setMulti | public void setMulti(String attribute, String [] values) {
NameOpValue nv = getRelation(attribute);
nv.clear();
List list = new LinkedList();
for (int i=0;i<values.length;i++) {
list.add(new Value(values[i]));
}
nv.add(list);
} | java | public void setMulti(String attribute, String [] values) {
NameOpValue nv = getRelation(attribute);
nv.clear();
List list = new LinkedList();
for (int i=0;i<values.length;i++) {
list.add(new Value(values[i]));
}
nv.add(list);
} | [
"public",
"void",
"setMulti",
"(",
"String",
"attribute",
",",
"String",
"[",
"]",
"values",
")",
"{",
"NameOpValue",
"nv",
"=",
"getRelation",
"(",
"attribute",
")",
";",
"nv",
".",
"clear",
"(",
")",
";",
"List",
"list",
"=",
"new",
"LinkedList",
"("... | Sets the attribute value to the given list of values.
The list of values is added as a single value.
@param attribute the attribute to set the value of.
@param values the list of values to add. | [
"Sets",
"the",
"attribute",
"value",
"to",
"the",
"given",
"list",
"of",
"values",
".",
"The",
"list",
"of",
"values",
"is",
"added",
"as",
"a",
"single",
"value",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L318-L326 | train |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/IdentityChecker.java | IdentityChecker.invoke | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
if (proxyCertValidator.getIdentityCertificate() == null) {
// check if limited
if (ProxyCertificateUtil.isLimitedProxy(certType)) {
proxyCertValidator.setLi... | java | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
if (proxyCertValidator.getIdentityCertificate() == null) {
// check if limited
if (ProxyCertificateUtil.isLimitedProxy(certType)) {
proxyCertValidator.setLi... | [
"public",
"void",
"invoke",
"(",
"X509Certificate",
"cert",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"CertPathValidatorException",
"{",
"if",
"(",
"proxyCertValidator",
".",
"getIdentityCertificate",
"(",
")",
"==",
"null",
")",
"{",
... | Method that sets the identity of the certificate path. Also checks if
limited proxy is acceptable.
@throws CertPathValidatorException If limited proxies are not accepted
and the chain has a limited proxy. | [
"Method",
"that",
"sets",
"the",
"identity",
"of",
"the",
"certificate",
"path",
".",
"Also",
"checks",
"if",
"limited",
"proxy",
"is",
"acceptable",
"."
] | e14f6f6636544fd84298f9cec749d626ea971930 | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/IdentityChecker.java#L45-L62 | train |
korpling/ANNIS | annis-service/src/main/java/annis/sqlgen/DefaultWhereClauseGenerator.java | DefaultWhereClauseGenerator.notReflexive | private void notReflexive(List<String> conditions,
QueryNode node, QueryNode target)
{
Validate.isTrue(node != target, "notReflexive(...) implies that source "
+ "and target node are not the same, but someone is violating this constraint!");
Validate.notNull(node);
Validate.notNull(target);
... | java | private void notReflexive(List<String> conditions,
QueryNode node, QueryNode target)
{
Validate.isTrue(node != target, "notReflexive(...) implies that source "
+ "and target node are not the same, but someone is violating this constraint!");
Validate.notNull(node);
Validate.notNull(target);
... | [
"private",
"void",
"notReflexive",
"(",
"List",
"<",
"String",
">",
"conditions",
",",
"QueryNode",
"node",
",",
"QueryNode",
"target",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"node",
"!=",
"target",
",",
"\"notReflexive(...) implies that source \"",
"+",
"\"a... | Explicitly disallow reflexivity.
Can be used if the other conditions allow reflexivity but the operator not.
It depends on the search conditions if two results are not equal.
<p>
<b>For two nodes (including searches for token):</b> <br />
node IDs are different
</p>
<p>
<b>If both nodes are an annotation:</b> <br /... | [
"Explicitly",
"disallow",
"reflexivity",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/DefaultWhereClauseGenerator.java#L146-L176 | train |
korpling/ANNIS | annis-service/src/main/java/annis/dao/AbstractDao.java | AbstractDao.executeSql | protected PreparedStatement executeSql(String sql,
MapSqlParameterSource args)
{
// XXX: uses raw type, what are the parameters to Map in MapSqlParameterSource?
Map<String, Object> parameters = args != null ? args.getValues()
: new HashMap<String, Object>();
for (Map.Entry<String, Object> place... | java | protected PreparedStatement executeSql(String sql,
MapSqlParameterSource args)
{
// XXX: uses raw type, what are the parameters to Map in MapSqlParameterSource?
Map<String, Object> parameters = args != null ? args.getValues()
: new HashMap<String, Object>();
for (Map.Entry<String, Object> place... | [
"protected",
"PreparedStatement",
"executeSql",
"(",
"String",
"sql",
",",
"MapSqlParameterSource",
"args",
")",
"{",
"// XXX: uses raw type, what are the parameters to Map in MapSqlParameterSource?",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"args",
"!="... | executes an SQL string, substituting the
parameters found in args
@param sql
@param args
@return | [
"executes",
"an",
"SQL",
"string",
"substituting",
"the",
"parameters",
"found",
"in",
"args"
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/AbstractDao.java#L65-L99 | train |
korpling/ANNIS | annis-service/src/main/java/annis/dao/AbstractDao.java | AbstractDao.readSqlFromResource | private String readSqlFromResource(Resource resource)
{
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(
resource.
getFile()), "UTF-8"));)
{
StringBuilder sqlBuf = new StringBuilder();
for (String line = reader.readLine(); line != ... | java | private String readSqlFromResource(Resource resource)
{
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(
resource.
getFile()), "UTF-8"));)
{
StringBuilder sqlBuf = new StringBuilder();
for (String line = reader.readLine(); line != ... | [
"private",
"String",
"readSqlFromResource",
"(",
"Resource",
"resource",
")",
"{",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"new",
"FileInputStream",
"(",
"resource",
".",
"getFile",
"(",
")",
")... | Reads the content from a resource into a string.
@param resource
@return | [
"Reads",
"the",
"content",
"from",
"a",
"resource",
"into",
"a",
"string",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/AbstractDao.java#L132-L155 | train |
korpling/ANNIS | annis-service/src/main/java/annis/ql/parser/DNFTransformer.java | DNFTransformer.toDNF | public static void toDNF(LogicClause topNode)
{
while(makeDNF(topNode) == false)
{
// do nothing, just repeat
}
cleanEmptyLeafs(topNode);
flattenDNF(topNode);
} | java | public static void toDNF(LogicClause topNode)
{
while(makeDNF(topNode) == false)
{
// do nothing, just repeat
}
cleanEmptyLeafs(topNode);
flattenDNF(topNode);
} | [
"public",
"static",
"void",
"toDNF",
"(",
"LogicClause",
"topNode",
")",
"{",
"while",
"(",
"makeDNF",
"(",
"topNode",
")",
"==",
"false",
")",
"{",
"// do nothing, just repeat",
"}",
"cleanEmptyLeafs",
"(",
"topNode",
")",
";",
"flattenDNF",
"(",
"topNode",
... | Transforms an AQL query to the Disjunctive Normal Form.
@param topNode
@return | [
"Transforms",
"an",
"AQL",
"query",
"to",
"the",
"Disjunctive",
"Normal",
"Form",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/ql/parser/DNFTransformer.java#L36-L45 | train |
korpling/ANNIS | annis-service/src/main/java/annis/ql/parser/DNFTransformer.java | DNFTransformer.flattenDNF | private static void flattenDNF(LogicClause top)
{
if(top.getOp() == LogicClause.Operator.LEAF || top.getOp() == LogicClause.Operator.AND)
{
List<LogicClause> children = new ArrayList<>();
findAllChildrenForOp(top, children, LogicClause.Operator.AND);
List<? extends Token> orginalAndCo... | java | private static void flattenDNF(LogicClause top)
{
if(top.getOp() == LogicClause.Operator.LEAF || top.getOp() == LogicClause.Operator.AND)
{
List<LogicClause> children = new ArrayList<>();
findAllChildrenForOp(top, children, LogicClause.Operator.AND);
List<? extends Token> orginalAndCo... | [
"private",
"static",
"void",
"flattenDNF",
"(",
"LogicClause",
"top",
")",
"{",
"if",
"(",
"top",
".",
"getOp",
"(",
")",
"==",
"LogicClause",
".",
"Operator",
".",
"LEAF",
"||",
"top",
".",
"getOp",
"(",
")",
"==",
"LogicClause",
".",
"Operator",
".",... | Flatten the clause in the sense that there is only one toplevel OR layer
and one layer of AND-clauses.
@param top | [
"Flatten",
"the",
"clause",
"in",
"the",
"sense",
"that",
"there",
"is",
"only",
"one",
"toplevel",
"OR",
"layer",
"and",
"one",
"layer",
"of",
"AND",
"-",
"clauses",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/ql/parser/DNFTransformer.java#L198-L266 | train |
korpling/ANNIS | annis-service/src/main/java/annis/dao/MetaDataFilter.java | MetaDataFilter.getDocumentsForMetadata | public List<Long> getDocumentsForMetadata(QueryData queryData)
{
List<Long> corpusList = queryData.getCorpusList();
if (!corpusList.isEmpty())
{
List<QueryAnnotation> metaData = queryData.getMetaData();
if (!metaData.isEmpty())
{
String documentsWithMetaDataSql = subQueryCo... | java | public List<Long> getDocumentsForMetadata(QueryData queryData)
{
List<Long> corpusList = queryData.getCorpusList();
if (!corpusList.isEmpty())
{
List<QueryAnnotation> metaData = queryData.getMetaData();
if (!metaData.isEmpty())
{
String documentsWithMetaDataSql = subQueryCo... | [
"public",
"List",
"<",
"Long",
">",
"getDocumentsForMetadata",
"(",
"QueryData",
"queryData",
")",
"{",
"List",
"<",
"Long",
">",
"corpusList",
"=",
"queryData",
".",
"getCorpusList",
"(",
")",
";",
"if",
"(",
"!",
"corpusList",
".",
"isEmpty",
"(",
")",
... | Will query the database which documents are matching according to the
given metadata
@param queryData QueryData from which the meta data will be extracted
@return The list of documents matching the meta data or null if no
constraints need to be applied (all documents are matching) | [
"Will",
"query",
"the",
"database",
"which",
"documents",
"are",
"matching",
"according",
"to",
"the",
"given",
"metadata"
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/MetaDataFilter.java#L42-L61 | train |
korpling/ANNIS | annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java | ResultViewPanel.setQueryResultQueue | public void setQueryResultQueue(BlockingQueue<SaltProject> queue,
PagedResultQuery q, ArrayList<Match> allMatches)
{
this.projectQueue = queue;
this.currentQuery = q;
this.numberOfResults = allMatches.size();
this.allMatches = allMatches;
paging.setPageSize(q.getLimit(), false);
paging.se... | java | public void setQueryResultQueue(BlockingQueue<SaltProject> queue,
PagedResultQuery q, ArrayList<Match> allMatches)
{
this.projectQueue = queue;
this.currentQuery = q;
this.numberOfResults = allMatches.size();
this.allMatches = allMatches;
paging.setPageSize(q.getLimit(), false);
paging.se... | [
"public",
"void",
"setQueryResultQueue",
"(",
"BlockingQueue",
"<",
"SaltProject",
">",
"queue",
",",
"PagedResultQuery",
"q",
",",
"ArrayList",
"<",
"Match",
">",
"allMatches",
")",
"{",
"this",
".",
"projectQueue",
"=",
"queue",
";",
"this",
".",
"currentQue... | Set a new querys in result panel.
@param queue holds the salt graph
@param q holds the ordinary query
@param allMatches All matches. | [
"Set",
"a",
"new",
"querys",
"in",
"result",
"panel",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java#L230-L250 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.createRESTClient | public static Client createRESTClient(String userName, String password)
{
DefaultApacheHttpClient4Config rc = new DefaultApacheHttpClient4Config();
rc.getClasses().add(SaltProjectProvider.class);
ThreadSafeClientConnManager clientConnMgr = new ThreadSafeClientConnManager();
clientConnMgr.setDefaultM... | java | public static Client createRESTClient(String userName, String password)
{
DefaultApacheHttpClient4Config rc = new DefaultApacheHttpClient4Config();
rc.getClasses().add(SaltProjectProvider.class);
ThreadSafeClientConnManager clientConnMgr = new ThreadSafeClientConnManager();
clientConnMgr.setDefaultM... | [
"public",
"static",
"Client",
"createRESTClient",
"(",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"DefaultApacheHttpClient4Config",
"rc",
"=",
"new",
"DefaultApacheHttpClient4Config",
"(",
")",
";",
"rc",
".",
"getClasses",
"(",
")",
".",
"add",
... | Creates an authentificiated REST client
@param userName
@param password
@return A newly created client. | [
"Creates",
"an",
"authentificiated",
"REST",
"client"
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L153-L181 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.getMetaDataDoc | public static List<Annotation> getMetaDataDoc(String toplevelCorpusName,
String documentName)
{
List<Annotation> result = new ArrayList<Annotation>();
WebResource res = Helper.getAnnisWebResource();
try
{
res = res.path("meta").path("doc")
.path(urlPathEscape.escape(toplevelCorpusNam... | java | public static List<Annotation> getMetaDataDoc(String toplevelCorpusName,
String documentName)
{
List<Annotation> result = new ArrayList<Annotation>();
WebResource res = Helper.getAnnisWebResource();
try
{
res = res.path("meta").path("doc")
.path(urlPathEscape.escape(toplevelCorpusNam... | [
"public",
"static",
"List",
"<",
"Annotation",
">",
"getMetaDataDoc",
"(",
"String",
"toplevelCorpusName",
",",
"String",
"documentName",
")",
"{",
"List",
"<",
"Annotation",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Annotation",
">",
"(",
")",
";",
"Web... | Retrieve the meta data for a given document of a corpus.
@param toplevelCorpusName specifies the toplevel corpus
@param documentName specifies the document.
@return returns only the meta data for a single document. | [
"Retrieve",
"the",
"meta",
"data",
"for",
"a",
"given",
"document",
"of",
"a",
"corpus",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L527-L553 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.getCorpusConfig | public static CorpusConfig getCorpusConfig(String corpus)
{
if (corpus == null || corpus.isEmpty())
{
Notification.show("no corpus is selected",
"please select at leas one corpus and execute query again",
Notification.Type.WARNING_MESSAGE);
return null;
}
CorpusConfig cor... | java | public static CorpusConfig getCorpusConfig(String corpus)
{
if (corpus == null || corpus.isEmpty())
{
Notification.show("no corpus is selected",
"please select at leas one corpus and execute query again",
Notification.Type.WARNING_MESSAGE);
return null;
}
CorpusConfig cor... | [
"public",
"static",
"CorpusConfig",
"getCorpusConfig",
"(",
"String",
"corpus",
")",
"{",
"if",
"(",
"corpus",
"==",
"null",
"||",
"corpus",
".",
"isEmpty",
"(",
")",
")",
"{",
"Notification",
".",
"show",
"(",
"\"no corpus is selected\"",
",",
"\"please selec... | Loads the corpus config of a specific corpus.
@param corpus The name of the corpus, for which the config is fetched.
@return A {@link CorpusConfig} object, which wraps a {@link Properties}
object. This Properties object stores the corpus configuration as simple
key-value pairs. | [
"Loads",
"the",
"corpus",
"config",
"of",
"a",
"specific",
"corpus",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L635-L665 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.getCorpusConfigs | public static CorpusConfigMap getCorpusConfigs()
{
CorpusConfigMap corpusConfigurations = null;
try
{
corpusConfigurations = Helper.getAnnisWebResource().path(
"query").path("corpora").path("config").get(CorpusConfigMap.class);
}
catch (UniformInterfaceException | ClientHandlerExce... | java | public static CorpusConfigMap getCorpusConfigs()
{
CorpusConfigMap corpusConfigurations = null;
try
{
corpusConfigurations = Helper.getAnnisWebResource().path(
"query").path("corpora").path("config").get(CorpusConfigMap.class);
}
catch (UniformInterfaceException | ClientHandlerExce... | [
"public",
"static",
"CorpusConfigMap",
"getCorpusConfigs",
"(",
")",
"{",
"CorpusConfigMap",
"corpusConfigurations",
"=",
"null",
";",
"try",
"{",
"corpusConfigurations",
"=",
"Helper",
".",
"getAnnisWebResource",
"(",
")",
".",
"path",
"(",
"\"query\"",
")",
".",... | Loads the all available corpus configurations.
@return A {@link CorpusConfigMap} object, which wraps a Map of
{@link Properties} objects. The keys to the properties are the corpus
names. A Properties object stores the corpus configuration as simple
key-value pairs. The Map includes also the default corpus configurati... | [
"Loads",
"the",
"all",
"available",
"corpus",
"configurations",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L699-L735 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.getCorpusConfigs | public static CorpusConfigMap getCorpusConfigs(Set<String> corpora)
{
CorpusConfigMap corpusConfigurations = new CorpusConfigMap();
for (String corpus : corpora)
{
corpusConfigurations.put(corpus, getCorpusConfig(corpus));
}
corpusConfigurations.put(DEFAULT_CONFIG, getDefaultCorpusConfig(... | java | public static CorpusConfigMap getCorpusConfigs(Set<String> corpora)
{
CorpusConfigMap corpusConfigurations = new CorpusConfigMap();
for (String corpus : corpora)
{
corpusConfigurations.put(corpus, getCorpusConfig(corpus));
}
corpusConfigurations.put(DEFAULT_CONFIG, getDefaultCorpusConfig(... | [
"public",
"static",
"CorpusConfigMap",
"getCorpusConfigs",
"(",
"Set",
"<",
"String",
">",
"corpora",
")",
"{",
"CorpusConfigMap",
"corpusConfigurations",
"=",
"new",
"CorpusConfigMap",
"(",
")",
";",
"for",
"(",
"String",
"corpus",
":",
"corpora",
")",
"{",
"... | Loads the available corpus configurations for a list of specific corpora.
@param corpora A Set of corpora names.
@return A {@link CorpusConfigMap} object, which wraps a Map of
{@link Properties} objects. The keys to the properties are the corpus
names. A Properties object stores the corpus configuration as simple
key... | [
"Loads",
"the",
"available",
"corpus",
"configurations",
"for",
"a",
"list",
"of",
"specific",
"corpora",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L747-L759 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.parseFragment | public static Map<String, String> parseFragment(String fragment)
{
Map<String, String> result = new TreeMap<String, String>();
fragment = StringUtils.removeStart(fragment, "!");
String[] split = StringUtils.split(fragment, "&");
for (String s : split)
{
String[] parts = s.split("=", 2);
... | java | public static Map<String, String> parseFragment(String fragment)
{
Map<String, String> result = new TreeMap<String, String>();
fragment = StringUtils.removeStart(fragment, "!");
String[] split = StringUtils.split(fragment, "&");
for (String s : split)
{
String[] parts = s.split("=", 2);
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"parseFragment",
"(",
"String",
"fragment",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"result",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"fragment",... | Parses the fragment.
Fragments have the form key1=value&key2=test ...
@param fragment
@return | [
"Parses",
"the",
"fragment",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L769-L805 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.convertExceptionToMessage | public static String convertExceptionToMessage(Throwable ex)
{
StringBuilder sb = new StringBuilder();
if(ex != null)
{
sb.append("Exception type: ").append(ex.getClass().getName()).append("\n");
sb.append("Message: ").append(ex.getLocalizedMessage()).append("\n");
sb.append("Stacktrace:... | java | public static String convertExceptionToMessage(Throwable ex)
{
StringBuilder sb = new StringBuilder();
if(ex != null)
{
sb.append("Exception type: ").append(ex.getClass().getName()).append("\n");
sb.append("Message: ").append(ex.getLocalizedMessage()).append("\n");
sb.append("Stacktrace:... | [
"public",
"static",
"String",
"convertExceptionToMessage",
"(",
"Throwable",
"ex",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"ex",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"\"Exception type: \"",
")",
... | Returns a formatted string containing the type of the exception, the
message and the stacktrace.
@param ex
@return | [
"Returns",
"a",
"formatted",
"string",
"containing",
"the",
"type",
"of",
"the",
"exception",
"the",
"message",
"and",
"the",
"stacktrace",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L814-L830 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.encodePath | public static String encodePath(String v)
{
String encoded = urlPathEscape.escape(v);
return encoded;
} | java | public static String encodePath(String v)
{
String encoded = urlPathEscape.escape(v);
return encoded;
} | [
"public",
"static",
"String",
"encodePath",
"(",
"String",
"v",
")",
"{",
"String",
"encoded",
"=",
"urlPathEscape",
".",
"escape",
"(",
"v",
")",
";",
"return",
"encoded",
";",
"}"
] | Encodes a String so it can be used as path param.
@param v
@return | [
"Encodes",
"a",
"String",
"so",
"it",
"can",
"be",
"used",
"as",
"path",
"param",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L911-L915 | train |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Helper.java | Helper.encodeQueryParam | public static String encodeQueryParam(String v)
{
String encoded = UrlEscapers.urlFormParameterEscaper().escape(v);
return encoded;
} | java | public static String encodeQueryParam(String v)
{
String encoded = UrlEscapers.urlFormParameterEscaper().escape(v);
return encoded;
} | [
"public",
"static",
"String",
"encodeQueryParam",
"(",
"String",
"v",
")",
"{",
"String",
"encoded",
"=",
"UrlEscapers",
".",
"urlFormParameterEscaper",
"(",
")",
".",
"escape",
"(",
"v",
")",
";",
"return",
"encoded",
";",
"}"
] | Encodes a String so it can be used as query param.
@param v
@return | [
"Encodes",
"a",
"String",
"so",
"it",
"can",
"be",
"used",
"as",
"query",
"param",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L923-L927 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/iframe/WriterVisualizer.java | WriterVisualizer.writeOutput | @Override
public void writeOutput(VisualizerInput input, OutputStream outstream)
{
try
{
OutputStreamWriter writer = new OutputStreamWriter(outstream, getCharacterEncoding());
writeOutput(input, writer);
writer.flush();
}
catch(IOException ex)
{
log.error("Exception when ... | java | @Override
public void writeOutput(VisualizerInput input, OutputStream outstream)
{
try
{
OutputStreamWriter writer = new OutputStreamWriter(outstream, getCharacterEncoding());
writeOutput(input, writer);
writer.flush();
}
catch(IOException ex)
{
log.error("Exception when ... | [
"@",
"Override",
"public",
"void",
"writeOutput",
"(",
"VisualizerInput",
"input",
",",
"OutputStream",
"outstream",
")",
"{",
"try",
"{",
"OutputStreamWriter",
"writer",
"=",
"new",
"OutputStreamWriter",
"(",
"outstream",
",",
"getCharacterEncoding",
"(",
")",
")... | Will create a Writer of the outstream.
@param outstream | [
"Will",
"create",
"a",
"Writer",
"of",
"the",
"outstream",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/WriterVisualizer.java#L41-L64 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java | SentStructureJsComponent.getRelationLevelSet | private static Set<String> getRelationLevelSet(SDocumentGraph graph, String namespace,
Class<? extends SRelation> type) {
Set<String> result = new TreeSet<>();
if (graph != null) {
List<? extends SRelation> edges = null;
if (type == SDominanceRelation.class) {
edges = graph.getDominanceRelations();
... | java | private static Set<String> getRelationLevelSet(SDocumentGraph graph, String namespace,
Class<? extends SRelation> type) {
Set<String> result = new TreeSet<>();
if (graph != null) {
List<? extends SRelation> edges = null;
if (type == SDominanceRelation.class) {
edges = graph.getDominanceRelations();
... | [
"private",
"static",
"Set",
"<",
"String",
">",
"getRelationLevelSet",
"(",
"SDocumentGraph",
"graph",
",",
"String",
"namespace",
",",
"Class",
"<",
"?",
"extends",
"SRelation",
">",
"type",
")",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"Tree... | Get the qualified name of all annotations belonging to relations having a
specific namespace.
@param graph
The graph.
@param namespace
The namespace of the relation (not the annotation) to search for.
If namespace is null all namespaces will be considered.
@param type
Which type of relation to include
@return | [
"Get",
"the",
"qualified",
"name",
"of",
"all",
"annotations",
"belonging",
"to",
"relations",
"having",
"a",
"specific",
"namespace",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java#L385-L415 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java | SentStructureJsComponent.includeNode | @Override
public boolean includeNode(SNode node) {
// if node is a token or no configuration set, output the node
if (node instanceof SToken || configurations.get(0) == null) {
return true;
}
Set<SAnnotation> nodeAnnotations = node.getAnnotations();
return includeObject(nodeAnnotations, displayedNodeAnn... | java | @Override
public boolean includeNode(SNode node) {
// if node is a token or no configuration set, output the node
if (node instanceof SToken || configurations.get(0) == null) {
return true;
}
Set<SAnnotation> nodeAnnotations = node.getAnnotations();
return includeObject(nodeAnnotations, displayedNodeAnn... | [
"@",
"Override",
"public",
"boolean",
"includeNode",
"(",
"SNode",
"node",
")",
"{",
"// if node is a token or no configuration set, output the node",
"if",
"(",
"node",
"instanceof",
"SToken",
"||",
"configurations",
".",
"get",
"(",
"0",
")",
"==",
"null",
")",
... | Implements the includeNode method of the
org.corpus_tools.salt.util.ExportFilter interface. | [
"Implements",
"the",
"includeNode",
"method",
"of",
"the",
"org",
".",
"corpus_tools",
".",
"salt",
".",
"util",
".",
"ExportFilter",
"interface",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java#L421-L431 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java | SentStructureJsComponent.includeRelation | @Override
public boolean includeRelation(SRelation relation) {
Map<String, Set<String>> displayedRelAnnotations = new HashMap<String, Set<String>>();
// if no configuration set output the relation
if (relation instanceof SPointingRelation) {
if (configurations.get(1) == null) {
return true;
} else {
... | java | @Override
public boolean includeRelation(SRelation relation) {
Map<String, Set<String>> displayedRelAnnotations = new HashMap<String, Set<String>>();
// if no configuration set output the relation
if (relation instanceof SPointingRelation) {
if (configurations.get(1) == null) {
return true;
} else {
... | [
"@",
"Override",
"public",
"boolean",
"includeRelation",
"(",
"SRelation",
"relation",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"displayedRelAnnotations",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">"... | Implements the includeRelation method of the
org.corpus_tools.salt.util.ExportFilter interface. | [
"Implements",
"the",
"includeRelation",
"method",
"of",
"the",
"org",
".",
"corpus_tools",
".",
"salt",
".",
"util",
".",
"ExportFilter",
"interface",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java#L438-L470 | train |
korpling/ANNIS | annis-interfaces/src/main/java/annis/CommonHelper.java | CommonHelper.containsRTLText | public static boolean containsRTLText(String str)
{
if (str != null)
{
for (int i = 0; i < str.length(); i++)
{
char cc = str.charAt(i);
// hebrew extended and basic, arabic basic and extendend
if (cc >= 1425 && cc <= 1785)
{
return true;
}
... | java | public static boolean containsRTLText(String str)
{
if (str != null)
{
for (int i = 0; i < str.length(); i++)
{
char cc = str.charAt(i);
// hebrew extended and basic, arabic basic and extendend
if (cc >= 1425 && cc <= 1785)
{
return true;
}
... | [
"public",
"static",
"boolean",
"containsRTLText",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"char",
"cc",... | Detects arabic characters in a string.
<p>
Every character is checked, if its bit representation lies between:
<code>[1425, 1785] | [64286, 65019] | [65136, 65276]</code>
</p>
@param str The string to be checked.
@return returns true, if arabic characters are detected. | [
"Detects",
"arabic",
"characters",
"in",
"a",
"string",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L81-L106 | train |
korpling/ANNIS | annis-interfaces/src/main/java/annis/CommonHelper.java | CommonHelper.getSafeFileName | public static String getSafeFileName(String orig)
{
if (orig != null)
{
return orig.replaceAll("[^0-9A-Za-z-]", "_");
}
else
{
return UUID.randomUUID().toString();
}
} | java | public static String getSafeFileName(String orig)
{
if (orig != null)
{
return orig.replaceAll("[^0-9A-Za-z-]", "_");
}
else
{
return UUID.randomUUID().toString();
}
} | [
"public",
"static",
"String",
"getSafeFileName",
"(",
"String",
"orig",
")",
"{",
"if",
"(",
"orig",
"!=",
"null",
")",
"{",
"return",
"orig",
".",
"replaceAll",
"(",
"\"[^0-9A-Za-z-]\"",
",",
"\"_\"",
")",
";",
"}",
"else",
"{",
"return",
"UUID",
".",
... | Returns a file name that is safe to use and does not have any invalid
characters.
@param orig
@return | [
"Returns",
"a",
"file",
"name",
"that",
"is",
"safe",
"to",
"use",
"and",
"does",
"not",
"have",
"any",
"invalid",
"characters",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L388-L398 | train |
korpling/ANNIS | annis-interfaces/src/main/java/annis/CommonHelper.java | CommonHelper.getToplevelCorpusNames | public static Set<String> getToplevelCorpusNames(SaltProject p)
{
Set<String> names = new HashSet<>();
if (p != null && p.getCorpusGraphs() != null)
{
for (SCorpusGraph g : p.getCorpusGraphs())
{
if (g.getRoots() != null)
{
for (SNode c : g.getRoots())
{
... | java | public static Set<String> getToplevelCorpusNames(SaltProject p)
{
Set<String> names = new HashSet<>();
if (p != null && p.getCorpusGraphs() != null)
{
for (SCorpusGraph g : p.getCorpusGraphs())
{
if (g.getRoots() != null)
{
for (SNode c : g.getRoots())
{
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getToplevelCorpusNames",
"(",
"SaltProject",
"p",
")",
"{",
"Set",
"<",
"String",
">",
"names",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"p",
"!=",
"null",
"&&",
"p",
".",
"getCorpusGraphs",... | Gets all names of a corpus from a salt project.
@param p
@return returns an empty list if project is empty or null. | [
"Gets",
"all",
"names",
"of",
"a",
"corpus",
"from",
"a",
"salt",
"project",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L406-L425 | train |
korpling/ANNIS | annis-interfaces/src/main/java/annis/CommonHelper.java | CommonHelper.createSNodeMapFromIDs | public static <V> Map<SNode, V> createSNodeMapFromIDs(Map<String, V> map,
SDocumentGraph graph)
{
HashMap<SNode, V> result = new LinkedHashMap<>();
if (map != null && graph != null)
{
for (Map.Entry<String, V> e : map.entrySet())
{
SNode n = graph.getNode(e.getKey());
if (... | java | public static <V> Map<SNode, V> createSNodeMapFromIDs(Map<String, V> map,
SDocumentGraph graph)
{
HashMap<SNode, V> result = new LinkedHashMap<>();
if (map != null && graph != null)
{
for (Map.Entry<String, V> e : map.entrySet())
{
SNode n = graph.getNode(e.getKey());
if (... | [
"public",
"static",
"<",
"V",
">",
"Map",
"<",
"SNode",
",",
"V",
">",
"createSNodeMapFromIDs",
"(",
"Map",
"<",
"String",
",",
"V",
">",
"map",
",",
"SDocumentGraph",
"graph",
")",
"{",
"HashMap",
"<",
"SNode",
",",
"V",
">",
"result",
"=",
"new",
... | Takes a map of salt node IDs to a value and return a new map that uses the
SNodes as keys instead of the IDs.
@param <V>
@param map
@param graph
@return | [
"Takes",
"a",
"map",
"of",
"salt",
"node",
"IDs",
"to",
"a",
"value",
"and",
"return",
"a",
"new",
"map",
"that",
"uses",
"the",
"SNodes",
"as",
"keys",
"instead",
"of",
"the",
"IDs",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L436-L454 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java | EventExtractor.parseSalt | public static LinkedHashMap<String, ArrayList<Row>> parseSalt(
VisualizerInput input, boolean showSpanAnnos, boolean showTokenAnnos,
List<String> annotationNames,
Set<String> mediaLayer, boolean replaceValueWithMediaIcon,
long startTokenIndex, long endTokenIndex,
PDFCo... | java | public static LinkedHashMap<String, ArrayList<Row>> parseSalt(
VisualizerInput input, boolean showSpanAnnos, boolean showTokenAnnos,
List<String> annotationNames,
Set<String> mediaLayer, boolean replaceValueWithMediaIcon,
long startTokenIndex, long endTokenIndex,
PDFCo... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"ArrayList",
"<",
"Row",
">",
">",
"parseSalt",
"(",
"VisualizerInput",
"input",
",",
"boolean",
"showSpanAnnos",
",",
"boolean",
"showTokenAnnos",
",",
"List",
"<",
"String",
">",
"annotationNames",
",",
... | Converts Salt document graph to rows.
@param input
@param showSpanAnnos
@param showTokenAnnos
@param mediaLayer A set of all annotation layers which should be treated as special media layer.
@param annotationNames
@param replaceValueWithMediaIcon If true the actual value is removed and an icon for playing the media f... | [
"Converts",
"Salt",
"document",
"graph",
"to",
"rows",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L92-L167 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java | EventExtractor.computeDisplayedNamespace | public static Set<String> computeDisplayedNamespace(VisualizerInput input,
List<Class<? extends SNode>> types) {
if (input == null) {
return new HashSet<>();
}
String showNamespaceConfig = input.getMappings().getProperty(
GridComponent.MAPPING_SHOW_NAMESPACE);
if (s... | java | public static Set<String> computeDisplayedNamespace(VisualizerInput input,
List<Class<? extends SNode>> types) {
if (input == null) {
return new HashSet<>();
}
String showNamespaceConfig = input.getMappings().getProperty(
GridComponent.MAPPING_SHOW_NAMESPACE);
if (s... | [
"public",
"static",
"Set",
"<",
"String",
">",
"computeDisplayedNamespace",
"(",
"VisualizerInput",
"input",
",",
"List",
"<",
"Class",
"<",
"?",
"extends",
"SNode",
">",
">",
"types",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"new"... | Returns the annotations to which should be displayed together with their namespace.
This will check the "show_ns" paramter for determining.
the annotations to display. It also iterates over all nodes of the graph
matching the type.
@param input The input for the visualizer.
@param types Which types of nodes to includ... | [
"Returns",
"the",
"annotations",
"to",
"which",
"should",
"be",
"displayed",
"together",
"with",
"their",
"namespace",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L521-L593 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java | EventExtractor.getAnnotationLevelSet | private static Set<String> getAnnotationLevelSet(SDocumentGraph graph,
String namespace, Class<? extends SNode> type) {
Set<String> result = new TreeSet<>();
if (graph != null) {
List<? extends SNode> nodes;
// catch most common cases directly
if (SSpan.class == type) {
node... | java | private static Set<String> getAnnotationLevelSet(SDocumentGraph graph,
String namespace, Class<? extends SNode> type) {
Set<String> result = new TreeSet<>();
if (graph != null) {
List<? extends SNode> nodes;
// catch most common cases directly
if (SSpan.class == type) {
node... | [
"private",
"static",
"Set",
"<",
"String",
">",
"getAnnotationLevelSet",
"(",
"SDocumentGraph",
"graph",
",",
"String",
"namespace",
",",
"Class",
"<",
"?",
"extends",
"SNode",
">",
"type",
")",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"TreeSe... | Get the qualified name of all annotations belonging to spans having a
specific namespace.
@param graph The graph.
@param namespace The namespace of the node (not the annotation) to search
for.
@param type Which type of nodes to include
@return | [
"Get",
"the",
"qualified",
"name",
"of",
"all",
"annotations",
"belonging",
"to",
"spans",
"having",
"a",
"specific",
"namespace",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L606-L638 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java | EventExtractor.sortEventsByTokenIndex | private static void sortEventsByTokenIndex(Row row) {
Collections.sort(row.getEvents(), new Comparator<GridEvent>() {
@Override
public int compare(GridEvent o1, GridEvent o2) {
if (o1 == o2) {
return 0;
}
if (o1 == null) {
return -1;
}
if (o2 =... | java | private static void sortEventsByTokenIndex(Row row) {
Collections.sort(row.getEvents(), new Comparator<GridEvent>() {
@Override
public int compare(GridEvent o1, GridEvent o2) {
if (o1 == o2) {
return 0;
}
if (o1 == null) {
return -1;
}
if (o2 =... | [
"private",
"static",
"void",
"sortEventsByTokenIndex",
"(",
"Row",
"row",
")",
"{",
"Collections",
".",
"sort",
"(",
"row",
".",
"getEvents",
"(",
")",
",",
"new",
"Comparator",
"<",
"GridEvent",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"com... | Sort events of a row. The sorting is depending on the left value of the
event
@param row | [
"Sort",
"events",
"of",
"a",
"row",
".",
"The",
"sorting",
"is",
"depending",
"on",
"the",
"left",
"value",
"of",
"the",
"event"
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L690-L707 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java | EventExtractor.splitRowsOnIslands | private static void splitRowsOnIslands(Row row,
final SDocumentGraph graph,
STextualDS text,
long startTokenIndex, long endTokenIndex)
{
BitSet tokenCoverage = new BitSet();
// get the sorted token
List<SToken> sortedTokenList = graph.getSortedTokenByText();
// add all token belongin... | java | private static void splitRowsOnIslands(Row row,
final SDocumentGraph graph,
STextualDS text,
long startTokenIndex, long endTokenIndex)
{
BitSet tokenCoverage = new BitSet();
// get the sorted token
List<SToken> sortedTokenList = graph.getSortedTokenByText();
// add all token belongin... | [
"private",
"static",
"void",
"splitRowsOnIslands",
"(",
"Row",
"row",
",",
"final",
"SDocumentGraph",
"graph",
",",
"STextualDS",
"text",
",",
"long",
"startTokenIndex",
",",
"long",
"endTokenIndex",
")",
"{",
"BitSet",
"tokenCoverage",
"=",
"new",
"BitSet",
"("... | Splits events of a row if they overlap an island. Islands are areas between
the token which are included in the result.
@param row
@param graph
@param text
@param startTokenIndex token index of the first token in the match
@param endTokenIndex token index of the last token in the match | [
"Splits",
"events",
"of",
"a",
"row",
"if",
"they",
"overlap",
"an",
"island",
".",
"Islands",
"are",
"areas",
"between",
"the",
"token",
"which",
"are",
"included",
"in",
"the",
"result",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L719-L784 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/iframe/dependency/VakyarthaDependencyTree.java | VakyarthaDependencyTree.getText | private String getText(SNode node, VisualizerInput input)
{
SDocumentGraph sDocumentGraph = input.getSResult().getDocumentGraph();
List<DataSourceSequence> sequences = sDocumentGraph.
getOverlappedDataSourceSequence(node, SALT_TYPE.STEXT_OVERLAPPING_RELATION);
if (sequences != null && sequences.si... | java | private String getText(SNode node, VisualizerInput input)
{
SDocumentGraph sDocumentGraph = input.getSResult().getDocumentGraph();
List<DataSourceSequence> sequences = sDocumentGraph.
getOverlappedDataSourceSequence(node, SALT_TYPE.STEXT_OVERLAPPING_RELATION);
if (sequences != null && sequences.si... | [
"private",
"String",
"getText",
"(",
"SNode",
"node",
",",
"VisualizerInput",
"input",
")",
"{",
"SDocumentGraph",
"sDocumentGraph",
"=",
"input",
".",
"getSResult",
"(",
")",
".",
"getDocumentGraph",
"(",
")",
";",
"List",
"<",
"DataSourceSequence",
">",
"seq... | Get the text which is overlapped by the SNode.
@return Empty string, if there are no token overlapped by the node. | [
"Get",
"the",
"text",
"which",
"is",
"overlapped",
"by",
"the",
"SNode",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/dependency/VakyarthaDependencyTree.java#L388-L402 | train |
korpling/ANNIS | annis-gui/src/main/java/annis/gui/MainToolbar.java | MainToolbar.addLoginButton | private void addLoginButton()
{
VaadinSession session = VaadinSession.getCurrent();
if (session != null)
{
boolean kickstarter = Helper.isKickstarter(session);
if (!kickstarter)
{
addComponent(lblUserName);
setComponentAlignment(lblUserName, Alignment.MIDDLE_RIGHT);
... | java | private void addLoginButton()
{
VaadinSession session = VaadinSession.getCurrent();
if (session != null)
{
boolean kickstarter = Helper.isKickstarter(session);
if (!kickstarter)
{
addComponent(lblUserName);
setComponentAlignment(lblUserName, Alignment.MIDDLE_RIGHT);
... | [
"private",
"void",
"addLoginButton",
"(",
")",
"{",
"VaadinSession",
"session",
"=",
"VaadinSession",
".",
"getCurrent",
"(",
")",
";",
"if",
"(",
"session",
"!=",
"null",
")",
"{",
"boolean",
"kickstarter",
"=",
"Helper",
".",
"isKickstarter",
"(",
"session... | Adds the login button + login text to the toolbar. This is only happened,
when the gui is not started via the kickstarter.
<p>
The Kickstarter overrides the "kickstarterEnvironment" context parameter
and set it to "true", so the gui can detect, that is not necessary to offer
a login button.</p>
component. | [
"Adds",
"the",
"login",
"button",
"+",
"login",
"text",
"to",
"the",
"toolbar",
".",
"This",
"is",
"only",
"happened",
"when",
"the",
"gui",
"is",
"not",
"started",
"via",
"the",
"kickstarter",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/MainToolbar.java#L435-L451 | train |
korpling/ANNIS | annis-service/src/main/java/annis/sqlgen/AnnotationConditionProvider.java | AnnotationConditionProvider.addAnnotationConditions | public void addAnnotationConditions(Collection<String> conditions,
int index, QueryAnnotation annotation, String table,
TableAccessStrategy tas)
{
TextMatching tm = annotation.getTextMatching();
String column = annotation.getNamespace() == null
? "annotext" : "qannotext";
Escaper escaper =... | java | public void addAnnotationConditions(Collection<String> conditions,
int index, QueryAnnotation annotation, String table,
TableAccessStrategy tas)
{
TextMatching tm = annotation.getTextMatching();
String column = annotation.getNamespace() == null
? "annotext" : "qannotext";
Escaper escaper =... | [
"public",
"void",
"addAnnotationConditions",
"(",
"Collection",
"<",
"String",
">",
"conditions",
",",
"int",
"index",
",",
"QueryAnnotation",
"annotation",
",",
"String",
"table",
",",
"TableAccessStrategy",
"tas",
")",
"{",
"TextMatching",
"tm",
"=",
"annotation... | Adds annotation conditions for a single node.
@param conditions Condition list where the conditions should be added to
@param index Index for a specific annotation
@param annotation The annotation to add
@param table Table to operate on
@param tas {@link TableAccessStrategy} for the given node. | [
"Adds",
"annotation",
"conditions",
"for",
"a",
"single",
"node",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/AnnotationConditionProvider.java#L56-L112 | train |
korpling/ANNIS | annis-interfaces/src/main/java/annis/service/objects/FrequencyTableEntry.java | FrequencyTableEntry.parse | public static FrequencyTableEntry parse(String definition)
{
List<String> splitted
= Splitter.on(':').trimResults().omitEmptyStrings().limit(2).
splitToList(definition);
if (splitted.size() == 2)
{
FrequencyTableEntry entry = new FrequencyTableEntry();
if ("meta".equals(splitted.g... | java | public static FrequencyTableEntry parse(String definition)
{
List<String> splitted
= Splitter.on(':').trimResults().omitEmptyStrings().limit(2).
splitToList(definition);
if (splitted.size() == 2)
{
FrequencyTableEntry entry = new FrequencyTableEntry();
if ("meta".equals(splitted.g... | [
"public",
"static",
"FrequencyTableEntry",
"parse",
"(",
"String",
"definition",
")",
"{",
"List",
"<",
"String",
">",
"splitted",
"=",
"Splitter",
".",
"on",
"(",
"'",
"'",
")",
".",
"trimResults",
"(",
")",
".",
"omitEmptyStrings",
"(",
")",
".",
"limi... | A constructor that takes the raw definition as argument.
A definition consists of two parts: the referenced node and the annotation
name or "tok" separated by ":"
@param definition
@return | [
"A",
"constructor",
"that",
"takes",
"the",
"raw",
"definition",
"as",
"argument",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/service/objects/FrequencyTableEntry.java#L47-L78 | train |
korpling/ANNIS | annis-gui/src/main/java/annis/gui/controlpanel/CorpusListPanel.java | CorpusListPanel.updateAutoGeneratedQueriesPanel | private void updateAutoGeneratedQueriesPanel()
{
// make sure to make a copy since we are adding items to this set
Set<String> corpora = new HashSet<>(ui.getQueryState().getSelectedCorpora().
getValue());
if (corpora.isEmpty())
{
corpora.addAll(ui.getQueryState().getAvailableCorpora().get... | java | private void updateAutoGeneratedQueriesPanel()
{
// make sure to make a copy since we are adding items to this set
Set<String> corpora = new HashSet<>(ui.getQueryState().getSelectedCorpora().
getValue());
if (corpora.isEmpty())
{
corpora.addAll(ui.getQueryState().getAvailableCorpora().get... | [
"private",
"void",
"updateAutoGeneratedQueriesPanel",
"(",
")",
"{",
"// make sure to make a copy since we are adding items to this set",
"Set",
"<",
"String",
">",
"corpora",
"=",
"new",
"HashSet",
"<>",
"(",
"ui",
".",
"getQueryState",
"(",
")",
".",
"getSelectedCorpo... | Updates or initializes the panel, which holds the automatic generated
queries. | [
"Updates",
"or",
"initializes",
"the",
"panel",
"which",
"holds",
"the",
"automatic",
"generated",
"queries",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/controlpanel/CorpusListPanel.java#L392-L403 | train |
korpling/ANNIS | annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java | AbstractAdminstrationDao.existConflictingTopLevelCorpus | protected boolean existConflictingTopLevelCorpus(String topLevelCorpusName)
{
String sql = "SELECT count(name) as amount FROM corpus WHERE top_level=true AND name='"
+ topLevelCorpusName + "'";
Integer numberOfCorpora = getJdbcTemplate().query(sql,
new ResultSetExtractor<Integer>()
{
... | java | protected boolean existConflictingTopLevelCorpus(String topLevelCorpusName)
{
String sql = "SELECT count(name) as amount FROM corpus WHERE top_level=true AND name='"
+ topLevelCorpusName + "'";
Integer numberOfCorpora = getJdbcTemplate().query(sql,
new ResultSetExtractor<Integer>()
{
... | [
"protected",
"boolean",
"existConflictingTopLevelCorpus",
"(",
"String",
"topLevelCorpusName",
")",
"{",
"String",
"sql",
"=",
"\"SELECT count(name) as amount FROM corpus WHERE top_level=true AND name='\"",
"+",
"topLevelCorpusName",
"+",
"\"'\"",
";",
"Integer",
"numberOfCorpora... | Checks, if there already exists a top level corpus.
@param topLevelCorpusName The name of the corpus, which is checked.
@return Is false, if the no top level coprpus exists. | [
"Checks",
"if",
"there",
"already",
"exists",
"a",
"top",
"level",
"corpus",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java#L84-L107 | train |
korpling/ANNIS | annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java | AbstractAdminstrationDao.closeAllConnections | protected void closeAllConnections(String databasename)
{
String sql
= "SELECT pg_terminate_backend(pg_stat_activity.pid)\n"
+ "FROM pg_stat_activity\n"
+ "WHERE pg_stat_activity.datname = ?\n"
+ " AND pid <> pg_backend_pid();";
try(Connection conn = getDataSource().getConnection())
... | java | protected void closeAllConnections(String databasename)
{
String sql
= "SELECT pg_terminate_backend(pg_stat_activity.pid)\n"
+ "FROM pg_stat_activity\n"
+ "WHERE pg_stat_activity.datname = ?\n"
+ " AND pid <> pg_backend_pid();";
try(Connection conn = getDataSource().getConnection())
... | [
"protected",
"void",
"closeAllConnections",
"(",
"String",
"databasename",
")",
"{",
"String",
"sql",
"=",
"\"SELECT pg_terminate_backend(pg_stat_activity.pid)\\n\"",
"+",
"\"FROM pg_stat_activity\\n\"",
"+",
"\"WHERE pg_stat_activity.datname = ?\\n\"",
"+",
"\" AND pid <> pg_back... | Closes all open idle connections. The current data source
must have superuser rights.
This can be used if a another database action needs full access to a database,
e.g. when deleting and then creating it
@param databasename | [
"Closes",
"all",
"open",
"idle",
"connections",
".",
"The",
"current",
"data",
"source",
"must",
"have",
"superuser",
"rights",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java#L134-L162 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java | RSTImpl.getText | private String getText(SToken currNode) {
List<DataSourceSequence> sSequences = ((SDocumentGraph) currNode.getGraph()).
getOverlappedDataSourceSequence(currNode, SALT_TYPE.STEXT_OVERLAPPING_RELATION);
// only support one text for spanns
if (sSequences == null || sSequences.size() != 1) {
... | java | private String getText(SToken currNode) {
List<DataSourceSequence> sSequences = ((SDocumentGraph) currNode.getGraph()).
getOverlappedDataSourceSequence(currNode, SALT_TYPE.STEXT_OVERLAPPING_RELATION);
// only support one text for spanns
if (sSequences == null || sSequences.size() != 1) {
... | [
"private",
"String",
"getText",
"(",
"SToken",
"currNode",
")",
"{",
"List",
"<",
"DataSourceSequence",
">",
"sSequences",
"=",
"(",
"(",
"SDocumentGraph",
")",
"currNode",
".",
"getGraph",
"(",
")",
")",
".",
"getOverlappedDataSourceSequence",
"(",
"currNode",
... | Gets the overlapping token as string from a node, which are direct
dominated by this node.
@param currNode
@return is null, if there is no relation to a token, or there is more then
one STEXT is overlapped by this node | [
"Gets",
"the",
"overlapping",
"token",
"as",
"string",
"from",
"a",
"node",
"which",
"are",
"direct",
"dominated",
"by",
"this",
"node",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L492-L527 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java | RSTImpl.getHTMLColor | private String getHTMLColor(SToken token) {
if (!markedAndCovered.containsKey(token)) {
return null;
}
/**
* Since the range in markedAndCovered is from 1 up to 8, we have to
* decrease the value, for matching the colors in KWIC.
*/
int color = (int) (long) markedAndCovered.get(to... | java | private String getHTMLColor(SToken token) {
if (!markedAndCovered.containsKey(token)) {
return null;
}
/**
* Since the range in markedAndCovered is from 1 up to 8, we have to
* decrease the value, for matching the colors in KWIC.
*/
int color = (int) (long) markedAndCovered.get(to... | [
"private",
"String",
"getHTMLColor",
"(",
"SToken",
"token",
")",
"{",
"if",
"(",
"!",
"markedAndCovered",
".",
"containsKey",
"(",
"token",
")",
")",
"{",
"return",
"null",
";",
"}",
"/**\n * Since the range in markedAndCovered is from 1 up to 8, we have to\n *... | Checks, if a specific token is marked as matching token and returns a HTML
color string.
@return is null when token is not marked | [
"Checks",
"if",
"a",
"specific",
"token",
"is",
"marked",
"as",
"matching",
"token",
"and",
"returns",
"a",
"HTML",
"color",
"string",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L603-L618 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java | RSTImpl.isSegment | private boolean isSegment(SNode currNode) {
List<SRelation<SNode, SNode>> edges = currNode.getGraph().getOutRelations(currNode.getId());
if (edges != null && edges.size() > 0) {
for (SRelation<SNode, SNode> edge : edges) {
if (edge.getTarget() instanceof SToken) {
return true;
... | java | private boolean isSegment(SNode currNode) {
List<SRelation<SNode, SNode>> edges = currNode.getGraph().getOutRelations(currNode.getId());
if (edges != null && edges.size() > 0) {
for (SRelation<SNode, SNode> edge : edges) {
if (edge.getTarget() instanceof SToken) {
return true;
... | [
"private",
"boolean",
"isSegment",
"(",
"SNode",
"currNode",
")",
"{",
"List",
"<",
"SRelation",
"<",
"SNode",
",",
"SNode",
">",
">",
"edges",
"=",
"currNode",
".",
"getGraph",
"(",
")",
".",
"getOutRelations",
"(",
"currNode",
".",
"getId",
"(",
")",
... | Checks, if there exists an SRelation which targets a SToken. | [
"Checks",
"if",
"there",
"exists",
"an",
"SRelation",
"which",
"targets",
"a",
"SToken",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L623-L636 | train |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java | RSTImpl.sortChildren | private void sortChildren(JSONObject root) throws JSONException {
JSONArray children = root.getJSONArray("children");
List<JSONObject> childrenSorted = new ArrayList<JSONObject>(children.
length());
for (int i = 0; i < children.length(); i++) {
childrenSorted.add(children.getJSONObject(i)... | java | private void sortChildren(JSONObject root) throws JSONException {
JSONArray children = root.getJSONArray("children");
List<JSONObject> childrenSorted = new ArrayList<JSONObject>(children.
length());
for (int i = 0; i < children.length(); i++) {
childrenSorted.add(children.getJSONObject(i)... | [
"private",
"void",
"sortChildren",
"(",
"JSONObject",
"root",
")",
"throws",
"JSONException",
"{",
"JSONArray",
"children",
"=",
"root",
".",
"getJSONArray",
"(",
"\"children\"",
")",
";",
"List",
"<",
"JSONObject",
">",
"childrenSorted",
"=",
"new",
"ArrayList"... | Sorts the children of root by the the sentence indizes. Since the sentence
indizes are based on the token indizes, some sentences have no sentences
indizes, because sometimes token nodes are out of context.
A kind of insertion sort would be better than the used mergesort.
And it is a pity that the {@link JSONArray} h... | [
"Sorts",
"the",
"children",
"of",
"root",
"by",
"the",
"the",
"sentence",
"indizes",
".",
"Since",
"the",
"sentence",
"indizes",
"are",
"based",
"on",
"the",
"token",
"indizes",
"some",
"sentences",
"have",
"no",
"sentences",
"indizes",
"because",
"sometimes",... | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L679-L722 | train |
korpling/ANNIS | annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java | AnnisServiceRunner.shutdown | public void shutdown()
{
log.info("Shutting down...");
isShutdownRequested = true;
try
{
mainThread.join();
}
catch (InterruptedException e)
{
log.error(
"Interrupted which waiting on main daemon thread to complete.");
}
} | java | public void shutdown()
{
log.info("Shutting down...");
isShutdownRequested = true;
try
{
mainThread.join();
}
catch (InterruptedException e)
{
log.error(
"Interrupted which waiting on main daemon thread to complete.");
}
} | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"log",
".",
"info",
"(",
"\"Shutting down...\"",
")",
";",
"isShutdownRequested",
"=",
"true",
";",
"try",
"{",
"mainThread",
".",
"join",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{... | shutdown the AnnisService - ensure that current work load finishes | [
"shutdown",
"the",
"AnnisService",
"-",
"ensure",
"that",
"current",
"work",
"load",
"finishes"
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java#L152-L166 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.