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
centic9/commons-dost
src/main/java/org/dstadler/commons/svn/SVNCommands.java
SVNCommands.mergeRevision
public static MergeResult mergeRevision(long revision, File directory, String branch, String baseUrl) throws IOException { // svn merge -r 1288:1351 http://svn.example.com/myrepos/branch CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument(CMD_MERGE); addDefaultArguments(c...
java
public static MergeResult mergeRevision(long revision, File directory, String branch, String baseUrl) throws IOException { // svn merge -r 1288:1351 http://svn.example.com/myrepos/branch CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument(CMD_MERGE); addDefaultArguments(c...
[ "public", "static", "MergeResult", "mergeRevision", "(", "long", "revision", ",", "File", "directory", ",", "String", "branch", ",", "String", "baseUrl", ")", "throws", "IOException", "{", "// svn merge -r 1288:1351 http://svn.example.com/myrepos/branch", "CommandLine", "...
Merge the given revision and return true if only mergeinfo changes were done on trunk. @param revision The revision to merge, this should be on a different branch @param directory The local working directory @param branch The name of the branch to merge @param baseUrl The SVN url to connect to @return true if on...
[ "Merge", "the", "given", "revision", "and", "return", "true", "if", "only", "mergeinfo", "changes", "were", "done", "on", "trunk", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L561-L609
train
centic9/commons-dost
src/main/java/org/dstadler/commons/svn/SVNCommands.java
SVNCommands.getMergedRevisions
public static String getMergedRevisions(File directory, String... branches) throws IOException { // we could also use svn mergeinfo --show-revs merged ^/trunk ^/branches/test CommandLine cmdLine; cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument("propget"); addDefaultArgume...
java
public static String getMergedRevisions(File directory, String... branches) throws IOException { // we could also use svn mergeinfo --show-revs merged ^/trunk ^/branches/test CommandLine cmdLine; cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument("propget"); addDefaultArgume...
[ "public", "static", "String", "getMergedRevisions", "(", "File", "directory", ",", "String", "...", "branches", ")", "throws", "IOException", "{", "// we could also use svn mergeinfo --show-revs merged ^/trunk ^/branches/test", "CommandLine", "cmdLine", ";", "cmdLine", "=", ...
Retrieve a list of all merged revisions. @param directory The local working directory @param branches The list of branches to fetch logs for @return A string listing all SVN revision numbers that were merged, formatted via List.toString() @throws IOException Execution of the SVN sub-process failed or the sub-process r...
[ "Retrieve", "a", "list", "of", "all", "merged", "revisions", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L620-L671
train
centic9/commons-dost
src/main/java/org/dstadler/commons/svn/SVNCommands.java
SVNCommands.revertAll
public static void revertAll(File directory) throws IOException { log.info("Reverting SVN Working copy at " + directory); CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument(CMD_REVERT); addDefaultArguments(cmdLine, null, null); cmdLine.addArgument(OPT_DEPTH); ...
java
public static void revertAll(File directory) throws IOException { log.info("Reverting SVN Working copy at " + directory); CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument(CMD_REVERT); addDefaultArguments(cmdLine, null, null); cmdLine.addArgument(OPT_DEPTH); ...
[ "public", "static", "void", "revertAll", "(", "File", "directory", ")", "throws", "IOException", "{", "log", ".", "info", "(", "\"Reverting SVN Working copy at \"", "+", "directory", ")", ";", "CommandLine", "cmdLine", "=", "new", "CommandLine", "(", "SVN_CMD", ...
Revert all changes pending in the given SVN Working Copy. @param directory The local working directory @throws IOException Execution of the SVN sub-process failed or the sub-process returned a exit value indicating a failure
[ "Revert", "all", "changes", "pending", "in", "the", "given", "SVN", "Working", "Copy", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L680-L693
train
centic9/commons-dost
src/main/java/org/dstadler/commons/svn/SVNCommands.java
SVNCommands.cleanup
public static void cleanup(File directory) throws IOException { log.info("Cleaning SVN Working copy at " + directory); CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument("cleanup"); addDefaultArguments(cmdLine, null, null); try (InputStream result = ExecutionHe...
java
public static void cleanup(File directory) throws IOException { log.info("Cleaning SVN Working copy at " + directory); CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument("cleanup"); addDefaultArguments(cmdLine, null, null); try (InputStream result = ExecutionHe...
[ "public", "static", "void", "cleanup", "(", "File", "directory", ")", "throws", "IOException", "{", "log", ".", "info", "(", "\"Cleaning SVN Working copy at \"", "+", "directory", ")", ";", "CommandLine", "cmdLine", "=", "new", "CommandLine", "(", "SVN_CMD", ")"...
Run "svn cleanup" on the given working copy. @param directory The local working directory @throws IOException Execution of the SVN sub-process failed or the sub-process returned a exit value indicating a failure
[ "Run", "svn", "cleanup", "on", "the", "given", "working", "copy", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L702-L712
train
centic9/commons-dost
src/main/java/org/dstadler/commons/svn/SVNCommands.java
SVNCommands.checkout
public static InputStream checkout(String url, File directory, String user, String pwd) throws IOException { if (!directory.exists() && !directory.mkdirs()) { throw new IOException("Could not create new working copy directory at " + directory); } CommandLine cmdLine = new CommandLin...
java
public static InputStream checkout(String url, File directory, String user, String pwd) throws IOException { if (!directory.exists() && !directory.mkdirs()) { throw new IOException("Could not create new working copy directory at " + directory); } CommandLine cmdLine = new CommandLin...
[ "public", "static", "InputStream", "checkout", "(", "String", "url", ",", "File", "directory", ",", "String", "user", ",", "String", "pwd", ")", "throws", "IOException", "{", "if", "(", "!", "directory", ".", "exists", "(", ")", "&&", "!", "directory", "...
Performs a SVN Checkout of the given URL to the given directory @param url The SVN URL that should be checked out @param directory The location where the working copy is created. @param user The SVN user or null if the default user from the machine should be used @param pwd The SVN password or null if the defau...
[ "Performs", "a", "SVN", "Checkout", "of", "the", "given", "URL", "to", "the", "given", "directory" ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L725-L738
train
centic9/commons-dost
src/main/java/org/dstadler/commons/svn/SVNCommands.java
SVNCommands.copyBranch
public static void copyBranch(String base, String branch, long revision, String baseUrl) throws IOException { log.info("Copying branch " + base + AT_REVISION + revision + " to branch " + branch); CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument("cp"); addDefaultArgume...
java
public static void copyBranch(String base, String branch, long revision, String baseUrl) throws IOException { log.info("Copying branch " + base + AT_REVISION + revision + " to branch " + branch); CommandLine cmdLine = new CommandLine(SVN_CMD); cmdLine.addArgument("cp"); addDefaultArgume...
[ "public", "static", "void", "copyBranch", "(", "String", "base", ",", "String", "branch", ",", "long", "revision", ",", "String", "baseUrl", ")", "throws", "IOException", "{", "log", ".", "info", "(", "\"Copying branch \"", "+", "base", "+", "AT_REVISION", "...
Make a branch by calling the "svn cp" operation. @param base The source of the SVN copy operation @param branch The name and location of the new branch @param revision The revision to base the branch off @param baseUrl The SVN url to connect to @throws IOException Execution of the SVN sub-process failed or the s...
[ "Make", "a", "branch", "by", "calling", "the", "svn", "cp", "operation", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L756-L778
train
Bedework/bw-util
bw-util-jmx/src/main/java/org/bedework/util/jmx/ConfBase.java
ConfBase.getStore
public ConfigurationStore getStore() throws ConfigException { if (store != null) { return store; } String uriStr = getConfigUri(); if (uriStr == null) { getPfile(); String configPname = getConfigPname(); if (configPname == null) { throw new ConfigException("Either a u...
java
public ConfigurationStore getStore() throws ConfigException { if (store != null) { return store; } String uriStr = getConfigUri(); if (uriStr == null) { getPfile(); String configPname = getConfigPname(); if (configPname == null) { throw new ConfigException("Either a u...
[ "public", "ConfigurationStore", "getStore", "(", ")", "throws", "ConfigException", "{", "if", "(", "store", "!=", "null", ")", "{", "return", "store", ";", "}", "String", "uriStr", "=", "getConfigUri", "(", ")", ";", "if", "(", "uriStr", "==", "null", ")...
Get a ConfigurationStore based on the uri or property value. @return store @throws ConfigException
[ "Get", "a", "ConfigurationStore", "based", "on", "the", "uri", "or", "property", "value", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-jmx/src/main/java/org/bedework/util/jmx/ConfBase.java#L271-L345
train
Bedework/bw-util
bw-util-jmx/src/main/java/org/bedework/util/jmx/ConfBase.java
ConfBase.loadOnlyConfig
protected String loadOnlyConfig(final Class<T> cl) { try { /* Load up the config */ ConfigurationStore cs = getStore(); List<String> configNames = cs.getConfigs(); if (configNames.isEmpty()) { error("No configuration on path " + cs.getLocation()); return "No configuration ...
java
protected String loadOnlyConfig(final Class<T> cl) { try { /* Load up the config */ ConfigurationStore cs = getStore(); List<String> configNames = cs.getConfigs(); if (configNames.isEmpty()) { error("No configuration on path " + cs.getLocation()); return "No configuration ...
[ "protected", "String", "loadOnlyConfig", "(", "final", "Class", "<", "T", ">", "cl", ")", "{", "try", "{", "/* Load up the config */", "ConfigurationStore", "cs", "=", "getStore", "(", ")", ";", "List", "<", "String", ">", "configNames", "=", "cs", ".", "g...
Load the configuration if we only expect one and we don't care or know what it's called. @param cl @return null for success or an error message (logged already)
[ "Load", "the", "configuration", "if", "we", "only", "expect", "one", "and", "we", "don", "t", "care", "or", "know", "what", "it", "s", "called", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-jmx/src/main/java/org/bedework/util/jmx/ConfBase.java#L597-L632
train
sebastiangraf/treetank
coremodules/core/src/main/java/org/treetank/access/conf/StorageConfiguration.java
StorageConfiguration.deserialize
public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); ...
java
public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); ...
[ "public", "static", "StorageConfiguration", "deserialize", "(", "final", "File", "pFile", ")", "throws", "TTIOException", "{", "try", "{", "FileReader", "fileReader", "=", "new", "FileReader", "(", "new", "File", "(", "pFile", ",", "Paths", ".", "ConfigBinary", ...
Generate a StorageConfiguration out of a file. @param pFile where the StorageConfiguration lies in as json @return a new {@link StorageConfiguration} class @throws TTIOException
[ "Generate", "a", "StorageConfiguration", "out", "of", "a", "file", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/core/src/main/java/org/treetank/access/conf/StorageConfiguration.java#L172-L186
train
Bedework/bw-util
bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java
ConfigBase.getProperty
@ConfInfo(dontSave = true) public String getProperty(final Collection<String> col, final String name) { String key = name + "="; for (String p: col) { if (p.startsWith(key)) { return p.substring(key.length()); } } return null; }
java
@ConfInfo(dontSave = true) public String getProperty(final Collection<String> col, final String name) { String key = name + "="; for (String p: col) { if (p.startsWith(key)) { return p.substring(key.length()); } } return null; }
[ "@", "ConfInfo", "(", "dontSave", "=", "true", ")", "public", "String", "getProperty", "(", "final", "Collection", "<", "String", ">", "col", ",", "final", "String", "name", ")", "{", "String", "key", "=", "name", "+", "\"=\"", ";", "for", "(", "String...
Get a property stored as a String name = val @param col of property name+val @param name @return value or null
[ "Get", "a", "property", "stored", "as", "a", "String", "name", "=", "val" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java#L206-L217
train
Bedework/bw-util
bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java
ConfigBase.removeProperty
public void removeProperty(final Collection<String> col, final String name) { try { String v = getProperty(col, name); if (v == null) { return; } col.remove(name + "=" + v); } catch (Throwable t) { throw new RuntimeException(t); } }
java
public void removeProperty(final Collection<String> col, final String name) { try { String v = getProperty(col, name); if (v == null) { return; } col.remove(name + "=" + v); } catch (Throwable t) { throw new RuntimeException(t); } }
[ "public", "void", "removeProperty", "(", "final", "Collection", "<", "String", ">", "col", ",", "final", "String", "name", ")", "{", "try", "{", "String", "v", "=", "getProperty", "(", "col", ",", "name", ")", ";", "if", "(", "v", "==", "null", ")", ...
Remove a property stored as a String name = val @param col @param name
[ "Remove", "a", "property", "stored", "as", "a", "String", "name", "=", "val" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java#L224-L237
train
Bedework/bw-util
bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java
ConfigBase.setListProperty
@SuppressWarnings("unchecked") public <L extends List> L setListProperty(final L list, final String name, final String val) { removeProperty(list, name); return addListProperty(list, name, val); }
java
@SuppressWarnings("unchecked") public <L extends List> L setListProperty(final L list, final String name, final String val) { removeProperty(list, name); return addListProperty(list, name, val); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "L", "extends", "List", ">", "L", "setListProperty", "(", "final", "L", "list", ",", "final", "String", "name", ",", "final", "String", "val", ")", "{", "removeProperty", "(", "list", ",", ...
Set a property @param list the list - possibly null @param name of property @param val of property @return possibly newly created list
[ "Set", "a", "property" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java#L246-L252
train
Bedework/bw-util
bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java
ConfigBase.toXml
public void toXml(final Writer wtr) throws ConfigException { try { XmlEmit xml = new XmlEmit(); xml.addNs(new NameSpace(ns, "BW"), true); xml.startEmit(wtr); dump(xml, false); xml.flush(); } catch (ConfigException cfe) { throw cfe; } catch (Throwable t) { throw new...
java
public void toXml(final Writer wtr) throws ConfigException { try { XmlEmit xml = new XmlEmit(); xml.addNs(new NameSpace(ns, "BW"), true); xml.startEmit(wtr); dump(xml, false); xml.flush(); } catch (ConfigException cfe) { throw cfe; } catch (Throwable t) { throw new...
[ "public", "void", "toXml", "(", "final", "Writer", "wtr", ")", "throws", "ConfigException", "{", "try", "{", "XmlEmit", "xml", "=", "new", "XmlEmit", "(", ")", ";", "xml", ".", "addNs", "(", "new", "NameSpace", "(", "ns", ",", "\"BW\"", ")", ",", "tr...
Output to a writer @param wtr @throws ConfigException
[ "Output", "to", "a", "writer" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java#L287-L300
train
Bedework/bw-util
bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java
ConfigBase.fromXml
public ConfigBase fromXml(final InputStream is, final Class cl) throws ConfigException { try { return fromXml(parseXml(is), cl); } catch (final ConfigException ce) { throw ce; } catch (final Throwable t) { throw new ConfigException(t); } }
java
public ConfigBase fromXml(final InputStream is, final Class cl) throws ConfigException { try { return fromXml(parseXml(is), cl); } catch (final ConfigException ce) { throw ce; } catch (final Throwable t) { throw new ConfigException(t); } }
[ "public", "ConfigBase", "fromXml", "(", "final", "InputStream", "is", ",", "final", "Class", "cl", ")", "throws", "ConfigException", "{", "try", "{", "return", "fromXml", "(", "parseXml", "(", "is", ")", ",", "cl", ")", ";", "}", "catch", "(", "final", ...
XML root element must have type attribute if cl is null @param is an input stream @param cl class of object or null @return parsed notification or null @throws ConfigException on error
[ "XML", "root", "element", "must", "have", "type", "attribute", "if", "cl", "is", "null" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java#L319-L328
train
Bedework/bw-util
bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java
ConfigBase.fromXml
public ConfigBase fromXml(final Element rootEl, final Class cl) throws ConfigException { try { final ConfigBase cb = (ConfigBase)getObject(rootEl, cl); if (cb == null) { // Can't do this return null; } for (final Element el: XmlUtil.getElementsAr...
java
public ConfigBase fromXml(final Element rootEl, final Class cl) throws ConfigException { try { final ConfigBase cb = (ConfigBase)getObject(rootEl, cl); if (cb == null) { // Can't do this return null; } for (final Element el: XmlUtil.getElementsAr...
[ "public", "ConfigBase", "fromXml", "(", "final", "Element", "rootEl", ",", "final", "Class", "cl", ")", "throws", "ConfigException", "{", "try", "{", "final", "ConfigBase", "cb", "=", "(", "ConfigBase", ")", "getObject", "(", "rootEl", ",", "cl", ")", ";",...
XML root element must have type attribute @param rootEl - root of parsed document @param cl class of object or null @return parsed notification or null @throws ConfigException on error
[ "XML", "root", "element", "must", "have", "type", "attribute" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java#L337-L357
train
Bedework/bw-util
bw-util-servlet-filters/src/main/java/org/bedework/util/servlet/filters/XSLTFilter.java
XSLTFilter.setPath
public void setPath(final String ideal, final String actual) { synchronized (transformers) { pathMap.put(ideal, actual); } }
java
public void setPath(final String ideal, final String actual) { synchronized (transformers) { pathMap.put(ideal, actual); } }
[ "public", "void", "setPath", "(", "final", "String", "ideal", ",", "final", "String", "actual", ")", "{", "synchronized", "(", "transformers", ")", "{", "pathMap", ".", "put", "(", "ideal", ",", "actual", ")", ";", "}", "}" ]
Set ideal to actual mapping. @param ideal @param actual
[ "Set", "ideal", "to", "actual", "mapping", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet-filters/src/main/java/org/bedework/util/servlet/filters/XSLTFilter.java#L126-L130
train
centic9/commons-dost
src/main/java/org/dstadler/commons/logging/jdk/LoggerFactory.java
LoggerFactory.initLogging
public static void initLogging() throws IOException { sendCommonsLogToJDKLog(); try (InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream("logging.properties")) { // apply configuration if(resource != null) { try { LogManager.getLogManager().readConfiguration(res...
java
public static void initLogging() throws IOException { sendCommonsLogToJDKLog(); try (InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream("logging.properties")) { // apply configuration if(resource != null) { try { LogManager.getLogManager().readConfiguration(res...
[ "public", "static", "void", "initLogging", "(", ")", "throws", "IOException", "{", "sendCommonsLogToJDKLog", "(", ")", ";", "try", "(", "InputStream", "resource", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "getR...
Initialize Logging from a file "logging.properties" which needs to be found in the classpath. It also applies a default format to make JDK Logging use a more useful format for log messages. Note: Call this method at the very first after main @throws IOException If the file "logging.properties" is not found in the cl...
[ "Initialize", "Logging", "from", "a", "file", "logging", ".", "properties", "which", "needs", "to", "be", "found", "in", "the", "classpath", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/logging/jdk/LoggerFactory.java#L55-L78
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Matching.java
Matching.add
public void add(final ITreeData paramNodeX, final ITreeData paramNodeY) throws TTIOException { mMapping.put(paramNodeX, paramNodeY); mReverseMapping.put(paramNodeY, paramNodeX); updateSubtreeMap(paramNodeX, mRtxNew); updateSubtreeMap(paramNodeY, mRtxOld); }
java
public void add(final ITreeData paramNodeX, final ITreeData paramNodeY) throws TTIOException { mMapping.put(paramNodeX, paramNodeY); mReverseMapping.put(paramNodeY, paramNodeX); updateSubtreeMap(paramNodeX, mRtxNew); updateSubtreeMap(paramNodeY, mRtxOld); }
[ "public", "void", "add", "(", "final", "ITreeData", "paramNodeX", ",", "final", "ITreeData", "paramNodeY", ")", "throws", "TTIOException", "{", "mMapping", ".", "put", "(", "paramNodeX", ",", "paramNodeY", ")", ";", "mReverseMapping", ".", "put", "(", "paramNo...
Adds the matching x -> y. @param paramNodeX source node @param paramNodeY partner of paramNodeX @throws TTIOException
[ "Adds", "the", "matching", "x", "-", ">", "y", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Matching.java#L106-L111
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Matching.java
Matching.containedChildren
public long containedChildren(final ITreeData paramNodeX, final ITreeData paramNodeY) throws TTIOException { assert paramNodeX != null; assert paramNodeY != null; long retVal = 0; mRtxOld.moveTo(paramNodeX.getDataKey()); for (final AbsAxis axis = new DescendantAxis(mRtxOld, true...
java
public long containedChildren(final ITreeData paramNodeX, final ITreeData paramNodeY) throws TTIOException { assert paramNodeX != null; assert paramNodeY != null; long retVal = 0; mRtxOld.moveTo(paramNodeX.getDataKey()); for (final AbsAxis axis = new DescendantAxis(mRtxOld, true...
[ "public", "long", "containedChildren", "(", "final", "ITreeData", "paramNodeX", ",", "final", "ITreeData", "paramNodeY", ")", "throws", "TTIOException", "{", "assert", "paramNodeX", "!=", "null", ";", "assert", "paramNodeY", "!=", "null", ";", "long", "retVal", ...
Counts the number of child nodes in the subtrees of x and y that are also in the matching. @param paramNodeX first subtree root node @param paramNodeY second subtree root node @return number of children which have been matched @throws TTIOException
[ "Counts", "the", "number", "of", "child", "nodes", "in", "the", "subtrees", "of", "x", "and", "y", "that", "are", "also", "in", "the", "matching", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Matching.java#L160-L171
train
Bedework/bw-util
bw-util-servlet/src/main/java/org/bedework/util/servlet/MethodBase.java
MethodBase.fixPath
public static List<String> fixPath(final String path) throws ServletException { if (path == null) { return null; } String decoded; try { decoded = URLDecoder.decode(path, "UTF8"); } catch (Throwable t) { throw new ServletException("bad path: " + path); } if (decoded == nu...
java
public static List<String> fixPath(final String path) throws ServletException { if (path == null) { return null; } String decoded; try { decoded = URLDecoder.decode(path, "UTF8"); } catch (Throwable t) { throw new ServletException("bad path: " + path); } if (decoded == nu...
[ "public", "static", "List", "<", "String", ">", "fixPath", "(", "final", "String", "path", ")", "throws", "ServletException", "{", "if", "(", "path", "==", "null", ")", "{", "return", "null", ";", "}", "String", "decoded", ";", "try", "{", "decoded", "...
Return a path, broken into its elements, after "." and ".." are removed. If the parameter path attempts to go above the root we return null. Other than the backslash thing why not use URI? @param path String path to be fixed @return String[] fixed path broken into elements @throws ServletException
[ "Return", "a", "path", "broken", "into", "its", "elements", "after", ".", "and", "..", "are", "removed", ".", "If", "the", "parameter", "path", "attempts", "to", "go", "above", "the", "root", "we", "return", "null", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet/src/main/java/org/bedework/util/servlet/MethodBase.java#L192-L251
train
Bedework/bw-util
bw-util-servlet/src/main/java/org/bedework/util/servlet/MethodBase.java
MethodBase.readJson
protected Object readJson(final InputStream is, final Class cl, final HttpServletResponse resp) throws ServletException { if (is == null) { return null; } try { return getMapper().readValue(is, cl); } catch (Throwable t) { resp.s...
java
protected Object readJson(final InputStream is, final Class cl, final HttpServletResponse resp) throws ServletException { if (is == null) { return null; } try { return getMapper().readValue(is, cl); } catch (Throwable t) { resp.s...
[ "protected", "Object", "readJson", "(", "final", "InputStream", "is", ",", "final", "Class", "cl", ",", "final", "HttpServletResponse", "resp", ")", "throws", "ServletException", "{", "if", "(", "is", "==", "null", ")", "{", "return", "null", ";", "}", "tr...
Parse the request body, and return the object. @param is Input stream for content @param cl The class we expect @param resp for status @return Object Parsed body or null for no body @exception ServletException Some error occurred.
[ "Parse", "the", "request", "body", "and", "return", "the", "object", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet/src/main/java/org/bedework/util/servlet/MethodBase.java#L295-L311
train
centic9/commons-dost
src/main/java/org/dstadler/commons/date/DateParser.java
DateParser.timeToReadable
public static String timeToReadable(long millis, String suffix) { StringBuilder builder = new StringBuilder(); boolean haveDays = false; if(millis > ONE_DAY) { millis = handleTime(builder, millis, ONE_DAY, "day", "s"); haveDays = true; } boolean haveHours...
java
public static String timeToReadable(long millis, String suffix) { StringBuilder builder = new StringBuilder(); boolean haveDays = false; if(millis > ONE_DAY) { millis = handleTime(builder, millis, ONE_DAY, "day", "s"); haveDays = true; } boolean haveHours...
[ "public", "static", "String", "timeToReadable", "(", "long", "millis", ",", "String", "suffix", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "haveDays", "=", "false", ";", "if", "(", "millis", ">", "ONE_DAY", ...
Format the given number of milliseconds as readable string, optionally appending a suffix. @param millis The number of milliseconds to print. @param suffix A suffix that is appended if the millis is &gt; 0, specify "" if not needed. @return The readable string
[ "Format", "the", "given", "number", "of", "milliseconds", "as", "readable", "string", "optionally", "appending", "a", "suffix", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/date/DateParser.java#L199-L228
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/shredder/XMLShredder.java
XMLShredder.createFileReader
public static synchronized XMLEventReader createFileReader(final File paramFile) throws IOException, XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); final InputStream in = new FileInputStream(par...
java
public static synchronized XMLEventReader createFileReader(final File paramFile) throws IOException, XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); final InputStream in = new FileInputStream(par...
[ "public", "static", "synchronized", "XMLEventReader", "createFileReader", "(", "final", "File", "paramFile", ")", "throws", "IOException", ",", "XMLStreamException", "{", "final", "XMLInputFactory", "factory", "=", "XMLInputFactory", ".", "newInstance", "(", ")", ";",...
Create a new StAX reader on a file. @param paramFile the XML file to parse @return an {@link XMLEventReader} @throws IOException if I/O operation fails @throws XMLStreamException if any parsing error occurs
[ "Create", "a", "new", "StAX", "reader", "on", "a", "file", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/shredder/XMLShredder.java#L397-L403
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/shredder/XMLShredder.java
XMLShredder.createStringReader
public static synchronized XMLEventReader createStringReader(final String paramString) throws IOException, XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); final InputStream in = new ByteArrayInpu...
java
public static synchronized XMLEventReader createStringReader(final String paramString) throws IOException, XMLStreamException { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); final InputStream in = new ByteArrayInpu...
[ "public", "static", "synchronized", "XMLEventReader", "createStringReader", "(", "final", "String", "paramString", ")", "throws", "IOException", ",", "XMLStreamException", "{", "final", "XMLInputFactory", "factory", "=", "XMLInputFactory", ".", "newInstance", "(", ")", ...
Create a new StAX reader on a string. @param paramString the XML file as a string to parse @return an {@link XMLEventReader} @throws IOException if I/O operation fails @throws XMLStreamException if any parsing error occurs
[ "Create", "a", "new", "StAX", "reader", "on", "a", "string", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/shredder/XMLShredder.java#L416-L422
train
centic9/commons-dost
src/main/java/org/dstadler/commons/http/HttpClientWrapper.java
HttpClientWrapper.simpleGet
public String simpleGet(String url) throws IOException { final AtomicReference<String> str = new AtomicReference<>(); simpleGetInternal(url, inputStream -> { try { str.set(IOUtils.toString(inputStream, "UTF-8")); } catch (IOException e) { throw new IllegalStat...
java
public String simpleGet(String url) throws IOException { final AtomicReference<String> str = new AtomicReference<>(); simpleGetInternal(url, inputStream -> { try { str.set(IOUtils.toString(inputStream, "UTF-8")); } catch (IOException e) { throw new IllegalStat...
[ "public", "String", "simpleGet", "(", "String", "url", ")", "throws", "IOException", "{", "final", "AtomicReference", "<", "String", ">", "str", "=", "new", "AtomicReference", "<>", "(", ")", ";", "simpleGetInternal", "(", "url", ",", "inputStream", "->", "{...
Perform a simple get-operation and return the resulting String. @param url The URL to query @return The data returned when retrieving the data from the given url, converted to a String. @throws IOException if the HTTP status code is not 200.
[ "Perform", "a", "simple", "get", "-", "operation", "and", "return", "the", "resulting", "String", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/HttpClientWrapper.java#L145-L156
train
centic9/commons-dost
src/main/java/org/dstadler/commons/http/HttpClientWrapper.java
HttpClientWrapper.simpleGetBytes
public byte[] simpleGetBytes(String url) throws IOException { final AtomicReference<byte[]> bytes = new AtomicReference<>(); simpleGetInternal(url, inputStream -> { try { bytes.set(IOUtils.toByteArray(inputStream)); } catch (IOException e) { throw new IllegalS...
java
public byte[] simpleGetBytes(String url) throws IOException { final AtomicReference<byte[]> bytes = new AtomicReference<>(); simpleGetInternal(url, inputStream -> { try { bytes.set(IOUtils.toByteArray(inputStream)); } catch (IOException e) { throw new IllegalS...
[ "public", "byte", "[", "]", "simpleGetBytes", "(", "String", "url", ")", "throws", "IOException", "{", "final", "AtomicReference", "<", "byte", "[", "]", ">", "bytes", "=", "new", "AtomicReference", "<>", "(", ")", ";", "simpleGetInternal", "(", "url", ","...
Perform a simple get-operation and return the resulting byte-array. @param url The URL to query @return The data returned when retrieving the data from the given url. @throws IOException if the HTTP status code is not 200.
[ "Perform", "a", "simple", "get", "-", "operation", "and", "return", "the", "resulting", "byte", "-", "array", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/HttpClientWrapper.java#L186-L197
train
centic9/commons-dost
src/main/java/org/dstadler/commons/http/HttpClientWrapper.java
HttpClientWrapper.simpleGet
public void simpleGet(String url, Consumer<InputStream> consumer) throws IOException { simpleGetInternal(url, consumer, null); }
java
public void simpleGet(String url, Consumer<InputStream> consumer) throws IOException { simpleGetInternal(url, consumer, null); }
[ "public", "void", "simpleGet", "(", "String", "url", ",", "Consumer", "<", "InputStream", ">", "consumer", ")", "throws", "IOException", "{", "simpleGetInternal", "(", "url", ",", "consumer", ",", "null", ")", ";", "}" ]
Perform a simple get-operation and passes the resulting InputStream to the given Consumer @param url The URL to query @param consumer A Consumer which receives the InputStream and can process the data on-the-fly in streaming fashion without retrieving all of the data into memory at once. @throws IOException if the HT...
[ "Perform", "a", "simple", "get", "-", "operation", "and", "passes", "the", "resulting", "InputStream", "to", "the", "given", "Consumer" ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/HttpClientWrapper.java#L209-L211
train
centic9/commons-dost
src/main/java/org/dstadler/commons/http/HttpClientWrapper.java
HttpClientWrapper.retrieveData
public static String retrieveData(String url, String user, String password, int timeoutMs) throws IOException { try (HttpClientWrapper wrapper = new HttpClientWrapper(user, password, timeoutMs)) { return wrapper.simpleGet(url); } }
java
public static String retrieveData(String url, String user, String password, int timeoutMs) throws IOException { try (HttpClientWrapper wrapper = new HttpClientWrapper(user, password, timeoutMs)) { return wrapper.simpleGet(url); } }
[ "public", "static", "String", "retrieveData", "(", "String", "url", ",", "String", "user", ",", "String", "password", ",", "int", "timeoutMs", ")", "throws", "IOException", "{", "try", "(", "HttpClientWrapper", "wrapper", "=", "new", "HttpClientWrapper", "(", ...
Small helper method to simply query the URL without password and return the resulting data. @param url The URL to query data from. @param user The username to send @param password The password to send @param timeoutMs How long in milliseconds to wait for the request @return The resulting data read from the URL @throws...
[ "Small", "helper", "method", "to", "simply", "query", "the", "URL", "without", "password", "and", "return", "the", "resulting", "data", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/HttpClientWrapper.java#L336-L340
train
centic9/commons-dost
src/main/java/org/dstadler/commons/http/HttpClientWrapper.java
HttpClientWrapper.checkAndFetch
public static HttpEntity checkAndFetch(HttpResponse response, String url) throws IOException { int statusCode = response.getStatusLine().getStatusCode(); if(statusCode > 206) { String msg = "Had HTTP StatusCode " + statusCode + " for request: " + url + ", response: " + response.getStatusLine().g...
java
public static HttpEntity checkAndFetch(HttpResponse response, String url) throws IOException { int statusCode = response.getStatusLine().getStatusCode(); if(statusCode > 206) { String msg = "Had HTTP StatusCode " + statusCode + " for request: " + url + ", response: " + response.getStatusLine().g...
[ "public", "static", "HttpEntity", "checkAndFetch", "(", "HttpResponse", "response", ",", "String", "url", ")", "throws", "IOException", "{", "int", "statusCode", "=", "response", ".", "getStatusLine", "(", ")", ".", "getStatusCode", "(", ")", ";", "if", "(", ...
Helper method to check the status code of the response and throw an IOException if it is an error or moved state. @param response A HttpResponse that is resulting from executing a HttpMethod. @param url The url, only used for building the error message of the exception. @return The {@link HttpEntity} returned from re...
[ "Helper", "method", "to", "check", "the", "status", "code", "of", "the", "response", "and", "throw", "an", "IOException", "if", "it", "is", "an", "error", "or", "moved", "state", "." ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/HttpClientWrapper.java#L353-L365
train
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java
DatabaseRepresentation.createResource
public void createResource(final InputStream inputStream, final String resourceName) throws JaxRxException { synchronized (resourceName) { if (inputStream == null) { throw new JaxRxException(400, "Bad user request"); } else { try { ...
java
public void createResource(final InputStream inputStream, final String resourceName) throws JaxRxException { synchronized (resourceName) { if (inputStream == null) { throw new JaxRxException(400, "Bad user request"); } else { try { ...
[ "public", "void", "createResource", "(", "final", "InputStream", "inputStream", ",", "final", "String", "resourceName", ")", "throws", "JaxRxException", "{", "synchronized", "(", "resourceName", ")", "{", "if", "(", "inputStream", "==", "null", ")", "{", "throw"...
This method is responsible to create a new database. @param inputStream The stream containing the XML document that has to be stored. @param resourceName The name of the new database. @throws JaxRxException The exception occurred.
[ "This", "method", "is", "responsible", "to", "create", "a", "new", "database", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L136-L149
train
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java
DatabaseRepresentation.add
public void add(final InputStream input, final String resource) throws JaxRxException { synchronized (resource) { try { shred(input, resource); } catch (final TTException exce) { throw new JaxRxException(exce); } } }
java
public void add(final InputStream input, final String resource) throws JaxRxException { synchronized (resource) { try { shred(input, resource); } catch (final TTException exce) { throw new JaxRxException(exce); } } }
[ "public", "void", "add", "(", "final", "InputStream", "input", ",", "final", "String", "resource", ")", "throws", "JaxRxException", "{", "synchronized", "(", "resource", ")", "{", "try", "{", "shred", "(", "input", ",", "resource", ")", ";", "}", "catch", ...
This method is responsible to add a new XML document to a collection. @param input The new XML document packed in an {@link InputStream}. @param resource The name of the collection. @throws JaxRxException The exception occurred.
[ "This", "method", "is", "responsible", "to", "add", "a", "new", "XML", "document", "to", "a", "collection", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L257-L266
train
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java
DatabaseRepresentation.deleteResource
public void deleteResource(final String resourceName) throws WebApplicationException { synchronized (resourceName) { try { mDatabase.truncateResource(new SessionConfiguration(resourceName, null)); } catch (TTException e) { throw new WebApplicationException...
java
public void deleteResource(final String resourceName) throws WebApplicationException { synchronized (resourceName) { try { mDatabase.truncateResource(new SessionConfiguration(resourceName, null)); } catch (TTException e) { throw new WebApplicationException...
[ "public", "void", "deleteResource", "(", "final", "String", "resourceName", ")", "throws", "WebApplicationException", "{", "synchronized", "(", "resourceName", ")", "{", "try", "{", "mDatabase", ".", "truncateResource", "(", "new", "SessionConfiguration", "(", "reso...
This method is responsible to delete an existing database. @param resourceName The name of the database. @throws WebApplicationException The exception occurred.
[ "This", "method", "is", "responsible", "to", "delete", "an", "existing", "database", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L276-L284
train
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java
DatabaseRepresentation.getLastRevision
public long getLastRevision(final String resourceName) throws JaxRxException, TTException { long lastRevision; if (mDatabase.existsResource(resourceName)) { ISession session = null; try { session = mDatabase.getSession(new SessionConfiguration(resourceName, Stand...
java
public long getLastRevision(final String resourceName) throws JaxRxException, TTException { long lastRevision; if (mDatabase.existsResource(resourceName)) { ISession session = null; try { session = mDatabase.getSession(new SessionConfiguration(resourceName, Stand...
[ "public", "long", "getLastRevision", "(", "final", "String", "resourceName", ")", "throws", "JaxRxException", ",", "TTException", "{", "long", "lastRevision", ";", "if", "(", "mDatabase", ".", "existsResource", "(", "resourceName", ")", ")", "{", "ISession", "se...
This method reads the existing database, and offers the last revision id of the database @param resourceName The name of the existing database. @return The {@link OutputStream} containing the result @throws WebApplicationException The Exception occurred. @throws TTException
[ "This", "method", "reads", "the", "existing", "database", "and", "offers", "the", "last", "revision", "id", "of", "the", "database" ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L379-L397
train
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java
DatabaseRepresentation.serializIt
private void serializIt(final String resource, final Long revision, final OutputStream output, final boolean nodeid) throws JaxRxException, TTException { // Connection to treetank, creating a session ISession session = null; // INodeReadTrx rtx = null; try { session =...
java
private void serializIt(final String resource, final Long revision, final OutputStream output, final boolean nodeid) throws JaxRxException, TTException { // Connection to treetank, creating a session ISession session = null; // INodeReadTrx rtx = null; try { session =...
[ "private", "void", "serializIt", "(", "final", "String", "resource", ",", "final", "Long", "revision", ",", "final", "OutputStream", "output", ",", "final", "boolean", "nodeid", ")", "throws", "JaxRxException", ",", "TTException", "{", "// Connection to treetank, cr...
The XML serializer to a given tnk file. @param resource The resource that has to be serialized. @param revision The revision of the document. @param output The output stream where we write the XML file. @param nodeid <code>true</code> when you want the result nodes with node id's. <code>false</code> otherwise. @throws...
[ "The", "XML", "serializer", "to", "a", "given", "tnk", "file", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L568-L597
train
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java
DatabaseRepresentation.revertToRevision
public void revertToRevision(final String resourceName, final long backToRevision) throws JaxRxException, TTException { ISession session = null; INodeWriteTrx wtx = null; boolean abort = false; try { session = mDatabase.getSession(new SessionConfiguration(resourceName...
java
public void revertToRevision(final String resourceName, final long backToRevision) throws JaxRxException, TTException { ISession session = null; INodeWriteTrx wtx = null; boolean abort = false; try { session = mDatabase.getSession(new SessionConfiguration(resourceName...
[ "public", "void", "revertToRevision", "(", "final", "String", "resourceName", ",", "final", "long", "backToRevision", ")", "throws", "JaxRxException", ",", "TTException", "{", "ISession", "session", "=", "null", ";", "INodeWriteTrx", "wtx", "=", "null", ";", "bo...
This method reverts the latest revision data to the requested. @param resourceName The name of the XML resource. @param backToRevision The revision value, which has to be set as the latest. @throws WebApplicationException @throws TTException
[ "This", "method", "reverts", "the", "latest", "revision", "data", "to", "the", "requested", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L609-L625
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/TzServer.java
TzServer.discover
private String discover(final String url) throws TimezonesException { /* For the moment we'll try to find it via .well-known. We may have to * use DNS SRV lookups */ // String domain = hi.getHostname(); // int lpos = domain.lastIndexOf("."); //int lpos2 = domain.lastIndexOf(".", lpos - 1); // ...
java
private String discover(final String url) throws TimezonesException { /* For the moment we'll try to find it via .well-known. We may have to * use DNS SRV lookups */ // String domain = hi.getHostname(); // int lpos = domain.lastIndexOf("."); //int lpos2 = domain.lastIndexOf(".", lpos - 1); // ...
[ "private", "String", "discover", "(", "final", "String", "url", ")", "throws", "TimezonesException", "{", "/* For the moment we'll try to find it via .well-known. We may have to\n * use DNS SRV lookups\n */", "// String domain = hi.getHostname();", "// int lpos = domain.lastInd...
See if we have a url for the service. If not discover the real one. <p>If the uri is parseable we won't even attempt the /.well-known approach. It implies we have a scheme etc. <p>Otherwise we will assume it's a host attempt to discover it through /.well-known @param url the service url @return discovered url @throw...
[ "See", "if", "we", "have", "a", "url", "for", "the", "service", ".", "If", "not", "discover", "the", "real", "one", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/TzServer.java#L190-L292
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/XMLSerializer.java
XMLSerializer.emitEndElement
@Override protected void emitEndElement(final INodeReadTrx paramRTX) { try { indent(); mOut.write(ECharsForSerializing.OPEN_SLASH.getBytes()); mOut.write(paramRTX.nameForKey(((ITreeNameData)paramRTX.getNode()).getNameKey()).getBytes()); mOut.write(ECharsForSer...
java
@Override protected void emitEndElement(final INodeReadTrx paramRTX) { try { indent(); mOut.write(ECharsForSerializing.OPEN_SLASH.getBytes()); mOut.write(paramRTX.nameForKey(((ITreeNameData)paramRTX.getNode()).getNameKey()).getBytes()); mOut.write(ECharsForSer...
[ "@", "Override", "protected", "void", "emitEndElement", "(", "final", "INodeReadTrx", "paramRTX", ")", "{", "try", "{", "indent", "(", ")", ";", "mOut", ".", "write", "(", "ECharsForSerializing", ".", "OPEN_SLASH", ".", "getBytes", "(", ")", ")", ";", "mOu...
Emit end element. @param paramRTX Read Transaction
[ "Emit", "end", "element", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/XMLSerializer.java#L319-L332
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/XMLSerializer.java
XMLSerializer.indent
private void indent() throws IOException { if (mIndent) { for (int i = 0; i < mStack.size() * mIndentSpaces; i++) { mOut.write(" ".getBytes()); } } }
java
private void indent() throws IOException { if (mIndent) { for (int i = 0; i < mStack.size() * mIndentSpaces; i++) { mOut.write(" ".getBytes()); } } }
[ "private", "void", "indent", "(", ")", "throws", "IOException", "{", "if", "(", "mIndent", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mStack", ".", "size", "(", ")", "*", "mIndentSpaces", ";", "i", "++", ")", "{", "mOut", ".", ...
Indentation of output. @throws IOException if can't indent output
[ "Indentation", "of", "output", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/XMLSerializer.java#L392-L398
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/XMLSerializer.java
XMLSerializer.write
private void write(final long mValue) throws IOException { final int length = (int)Math.log10((double)mValue); int digit = 0; long remainder = mValue; for (int i = length; i >= 0; i--) { digit = (byte)(remainder / LONG_POWERS[i]); mOut.write((byte)(digit + ASCII_O...
java
private void write(final long mValue) throws IOException { final int length = (int)Math.log10((double)mValue); int digit = 0; long remainder = mValue; for (int i = length; i >= 0; i--) { digit = (byte)(remainder / LONG_POWERS[i]); mOut.write((byte)(digit + ASCII_O...
[ "private", "void", "write", "(", "final", "long", "mValue", ")", "throws", "IOException", "{", "final", "int", "length", "=", "(", "int", ")", "Math", ".", "log10", "(", "(", "double", ")", "mValue", ")", ";", "int", "digit", "=", "0", ";", "long", ...
Write non-negative non-zero long as UTF-8 bytes. @param mValue Value to write @throws IOException if can't write to string
[ "Write", "non", "-", "negative", "non", "-", "zero", "long", "as", "UTF", "-", "8", "bytes", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/XMLSerializer.java#L422-L431
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.isoDate
public static String isoDate(final Date val) { synchronized (isoDateFormat) { try { isoDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return isoDateFormat.format(val); } }
java
public static String isoDate(final Date val) { synchronized (isoDateFormat) { try { isoDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return isoDateFormat.format(val); } }
[ "public", "static", "String", "isoDate", "(", "final", "Date", "val", ")", "{", "synchronized", "(", "isoDateFormat", ")", "{", "try", "{", "isoDateFormat", ".", "setTimeZone", "(", "Timezones", ".", "getDefaultTz", "(", ")", ")", ";", "}", "catch", "(", ...
Turn Date into "yyyyMMdd" @param val date @return String "yyyyMMdd"
[ "Turn", "Date", "into", "yyyyMMdd" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L114-L123
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.rfcDate
public static String rfcDate(final Date val) { synchronized (rfcDateFormat) { try { rfcDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return rfcDateFormat.format(val); } }
java
public static String rfcDate(final Date val) { synchronized (rfcDateFormat) { try { rfcDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return rfcDateFormat.format(val); } }
[ "public", "static", "String", "rfcDate", "(", "final", "Date", "val", ")", "{", "synchronized", "(", "rfcDateFormat", ")", "{", "try", "{", "rfcDateFormat", ".", "setTimeZone", "(", "Timezones", ".", "getDefaultTz", "(", ")", ")", ";", "}", "catch", "(", ...
Turn Date into "yyyy-MM-dd" @param val date @return String "yyyy-MM-dd"
[ "Turn", "Date", "into", "yyyy", "-", "MM", "-", "dd" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L138-L147
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.isoDateTime
public static String isoDateTime(final Date val) { synchronized (isoDateTimeFormat) { try { isoDateTimeFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return isoDateTimeFormat.format(val); } }
java
public static String isoDateTime(final Date val) { synchronized (isoDateTimeFormat) { try { isoDateTimeFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return isoDateTimeFormat.format(val); } }
[ "public", "static", "String", "isoDateTime", "(", "final", "Date", "val", ")", "{", "synchronized", "(", "isoDateTimeFormat", ")", "{", "try", "{", "isoDateTimeFormat", ".", "setTimeZone", "(", "Timezones", ".", "getDefaultTz", "(", ")", ")", ";", "}", "catc...
Turn Date into "yyyyMMddTHHmmss" @param val date @return String "yyyyMMddTHHmmss"
[ "Turn", "Date", "into", "yyyyMMddTHHmmss" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L163-L172
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.isoDateTime
public static String isoDateTime(final Date val, final TimeZone tz) { synchronized (isoDateTimeTZFormat) { isoDateTimeTZFormat.setTimeZone(tz); return isoDateTimeTZFormat.format(val); } }
java
public static String isoDateTime(final Date val, final TimeZone tz) { synchronized (isoDateTimeTZFormat) { isoDateTimeTZFormat.setTimeZone(tz); return isoDateTimeTZFormat.format(val); } }
[ "public", "static", "String", "isoDateTime", "(", "final", "Date", "val", ",", "final", "TimeZone", "tz", ")", "{", "synchronized", "(", "isoDateTimeTZFormat", ")", "{", "isoDateTimeTZFormat", ".", "setTimeZone", "(", "tz", ")", ";", "return", "isoDateTimeTZForm...
Turn Date into "yyyyMMddTHHmmss" for a given timezone @param val date @param tz TimeZone @return String "yyyyMMddTHHmmss"
[ "Turn", "Date", "into", "yyyyMMddTHHmmss", "for", "a", "given", "timezone" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L188-L193
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromISODate
public static Date fromISODate(final String val) throws BadDateException { try { synchronized (isoDateFormat) { try { isoDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return isoDateFor...
java
public static Date fromISODate(final String val) throws BadDateException { try { synchronized (isoDateFormat) { try { isoDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return isoDateFor...
[ "public", "static", "Date", "fromISODate", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "synchronized", "(", "isoDateFormat", ")", "{", "try", "{", "isoDateFormat", ".", "setTimeZone", "(", "Timezones", ".", "getDefaultTz", ...
Get Date from "yyyyMMdd" @param val String "yyyyMMdd" @return Date @throws BadDateException on format error
[ "Get", "Date", "from", "yyyyMMdd" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L272-L285
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromRfcDate
public static Date fromRfcDate(final String val) throws BadDateException { try { synchronized (rfcDateFormat) { try { rfcDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return rfcDateFor...
java
public static Date fromRfcDate(final String val) throws BadDateException { try { synchronized (rfcDateFormat) { try { rfcDateFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } return rfcDateFor...
[ "public", "static", "Date", "fromRfcDate", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "synchronized", "(", "rfcDateFormat", ")", "{", "try", "{", "rfcDateFormat", ".", "setTimeZone", "(", "Timezones", ".", "getDefaultTz", ...
Get Date from "yyyy-MM-dd" @param val String "yyyy-MM-dd" @return Date @throws BadDateException on format error
[ "Get", "Date", "from", "yyyy", "-", "MM", "-", "dd" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L293-L306
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromISODateTime
public static Date fromISODateTime(final String val) throws BadDateException { try { synchronized (isoDateTimeFormat) { try { isoDateTimeFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } retur...
java
public static Date fromISODateTime(final String val) throws BadDateException { try { synchronized (isoDateTimeFormat) { try { isoDateTimeFormat.setTimeZone(Timezones.getDefaultTz()); } catch (TimezonesException tze) { throw new RuntimeException(tze); } retur...
[ "public", "static", "Date", "fromISODateTime", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "synchronized", "(", "isoDateTimeFormat", ")", "{", "try", "{", "isoDateTimeFormat", ".", "setTimeZone", "(", "Timezones", ".", "get...
Get Date from "yyyyMMddThhmmss" @param val String "yyyyMMddThhmmss" @return Date @throws BadDateException on format error
[ "Get", "Date", "from", "yyyyMMddThhmmss" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L314-L327
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromISODateTime
public static Date fromISODateTime(final String val, final TimeZone tz) throws BadDateException { try { synchronized (isoDateTimeTZFormat) { isoDateTimeTZFormat.setTimeZone(tz); return isoDateTimeTZFormat.parse(val); } } catch (Throwable t) { ...
java
public static Date fromISODateTime(final String val, final TimeZone tz) throws BadDateException { try { synchronized (isoDateTimeTZFormat) { isoDateTimeTZFormat.setTimeZone(tz); return isoDateTimeTZFormat.parse(val); } } catch (Throwable t) { ...
[ "public", "static", "Date", "fromISODateTime", "(", "final", "String", "val", ",", "final", "TimeZone", "tz", ")", "throws", "BadDateException", "{", "try", "{", "synchronized", "(", "isoDateTimeTZFormat", ")", "{", "isoDateTimeTZFormat", ".", "setTimeZone", "(", ...
Get Date from "yyyyMMddThhmmss" with timezone @param val String "yyyyMMddThhmmss" @param tz TimeZone @return Date @throws BadDateException on format error
[ "Get", "Date", "from", "yyyyMMddThhmmss", "with", "timezone" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L372-L382
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromISODateTimeUTC
@SuppressWarnings("unused") public static Date fromISODateTimeUTC(final String val, final TimeZone tz) throws BadDateException { try { synchronized (isoDateTimeUTCTZFormat) { isoDateTimeUTCTZFormat.setTimeZone(tz); return isoDateTimeUTCTZFormat.parse(v...
java
@SuppressWarnings("unused") public static Date fromISODateTimeUTC(final String val, final TimeZone tz) throws BadDateException { try { synchronized (isoDateTimeUTCTZFormat) { isoDateTimeUTCTZFormat.setTimeZone(tz); return isoDateTimeUTCTZFormat.parse(v...
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "static", "Date", "fromISODateTimeUTC", "(", "final", "String", "val", ",", "final", "TimeZone", "tz", ")", "throws", "BadDateException", "{", "try", "{", "synchronized", "(", "isoDateTimeUTCTZFormat", ")"...
Get Date from "yyyyMMddThhmmssZ" with timezone @param val String "yyyyMMddThhmmssZ" @param tz TimeZone @return Date @throws BadDateException on format error
[ "Get", "Date", "from", "yyyyMMddThhmmssZ", "with", "timezone" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L391-L402
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromISODateTimeUTC
public static Date fromISODateTimeUTC(final String val) throws BadDateException { try { synchronized (isoDateTimeUTCFormat) { return isoDateTimeUTCFormat.parse(val); } } catch (Throwable t) { throw new BadDateException(); } }
java
public static Date fromISODateTimeUTC(final String val) throws BadDateException { try { synchronized (isoDateTimeUTCFormat) { return isoDateTimeUTCFormat.parse(val); } } catch (Throwable t) { throw new BadDateException(); } }
[ "public", "static", "Date", "fromISODateTimeUTC", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "synchronized", "(", "isoDateTimeUTCFormat", ")", "{", "return", "isoDateTimeUTCFormat", ".", "parse", "(", "val", ")", ";", "}",...
Get Date from "yyyyMMddThhmmssZ" @param val String "yyyyMMddThhmmssZ" @return Date @throws BadDateException on format error
[ "Get", "Date", "from", "yyyyMMddThhmmssZ" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L410-L418
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromISODateTimeUTCtoRfc822
public static String fromISODateTimeUTCtoRfc822(final String val) throws BadDateException { try { synchronized (isoDateTimeUTCFormat) { return rfc822Date(isoDateTimeUTCFormat.parse(val)); } } catch (Throwable t) { throw new BadDateException(); } }
java
public static String fromISODateTimeUTCtoRfc822(final String val) throws BadDateException { try { synchronized (isoDateTimeUTCFormat) { return rfc822Date(isoDateTimeUTCFormat.parse(val)); } } catch (Throwable t) { throw new BadDateException(); } }
[ "public", "static", "String", "fromISODateTimeUTCtoRfc822", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "synchronized", "(", "isoDateTimeUTCFormat", ")", "{", "return", "rfc822Date", "(", "isoDateTimeUTCFormat", ".", "parse", "...
Get RFC822 form from "yyyyMMddThhmmssZ" @param val String "yyyyMMddThhmmssZ" @return Date @throws BadDateException on format error
[ "Get", "RFC822", "form", "from", "yyyyMMddThhmmssZ" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L442-L450
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.isISODate
public static boolean isISODate(final String val) throws BadDateException { try { if (val.length() != 8) { return false; } fromISODate(val); return true; } catch (Throwable t) { return false; } }
java
public static boolean isISODate(final String val) throws BadDateException { try { if (val.length() != 8) { return false; } fromISODate(val); return true; } catch (Throwable t) { return false; } }
[ "public", "static", "boolean", "isISODate", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "if", "(", "val", ".", "length", "(", ")", "!=", "8", ")", "{", "return", "false", ";", "}", "fromISODate", "(", "val", ")", ...
Check Date is "yyyyMMdd" @param val String to check @return boolean @throws BadDateException on format error
[ "Check", "Date", "is", "yyyyMMdd" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L458-L468
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.isISODateTimeUTC
public static boolean isISODateTimeUTC(final String val) throws BadDateException { try { if (val.length() != 16) { return false; } fromISODateTimeUTC(val); return true; } catch (Throwable t) { return false; } }
java
public static boolean isISODateTimeUTC(final String val) throws BadDateException { try { if (val.length() != 16) { return false; } fromISODateTimeUTC(val); return true; } catch (Throwable t) { return false; } }
[ "public", "static", "boolean", "isISODateTimeUTC", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "if", "(", "val", ".", "length", "(", ")", "!=", "16", ")", "{", "return", "false", ";", "}", "fromISODateTimeUTC", "(", ...
Check Date is "yyyyMMddThhmmddZ" @param val String to check @return boolean @throws BadDateException on format error
[ "Check", "Date", "is", "yyyyMMddThhmmddZ" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L476-L486
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.isISODateTime
public static boolean isISODateTime(final String val) throws BadDateException { try { if (val.length() != 15) { return false; } fromISODateTime(val); return true; } catch (Throwable t) { return false; } }
java
public static boolean isISODateTime(final String val) throws BadDateException { try { if (val.length() != 15) { return false; } fromISODateTime(val); return true; } catch (Throwable t) { return false; } }
[ "public", "static", "boolean", "isISODateTime", "(", "final", "String", "val", ")", "throws", "BadDateException", "{", "try", "{", "if", "(", "val", ".", "length", "(", ")", "!=", "15", ")", "{", "return", "false", ";", "}", "fromISODateTime", "(", "val"...
Check Date is "yyyyMMddThhmmdd" @param val String to check @return boolean @throws BadDateException on format error
[ "Check", "Date", "is", "yyyyMMddThhmmdd" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L494-L504
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromDate
public static Date fromDate(final String dt) throws BadDateException { try { if (dt == null) { return null; } if (dt.indexOf("T") > 0) { return fromDateTime(dt); } if (!dt.contains("-")) { return fromISODate(dt); } return fromRfcDate(dt); } ca...
java
public static Date fromDate(final String dt) throws BadDateException { try { if (dt == null) { return null; } if (dt.indexOf("T") > 0) { return fromDateTime(dt); } if (!dt.contains("-")) { return fromISODate(dt); } return fromRfcDate(dt); } ca...
[ "public", "static", "Date", "fromDate", "(", "final", "String", "dt", ")", "throws", "BadDateException", "{", "try", "{", "if", "(", "dt", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "dt", ".", "indexOf", "(", "\"T\"", ")", ">", ...
Return rfc or iso String date or datetime as java Date @param dt string format date @return Date @throws BadDateException on format error
[ "Return", "rfc", "or", "iso", "String", "date", "or", "datetime", "as", "java", "Date" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L512-L530
train
Bedework/bw-util
bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java
DateTimeUtil.fromDateTime
public static Date fromDateTime(final String dt) throws BadDateException { try { if (dt == null) { return null; } if (!dt.contains("-")) { return fromISODateTimeUTC(dt); } return fromRfcDateTimeUTC(dt); } catch (Throwable t) { throw new BadDateException(); ...
java
public static Date fromDateTime(final String dt) throws BadDateException { try { if (dt == null) { return null; } if (!dt.contains("-")) { return fromISODateTimeUTC(dt); } return fromRfcDateTimeUTC(dt); } catch (Throwable t) { throw new BadDateException(); ...
[ "public", "static", "Date", "fromDateTime", "(", "final", "String", "dt", ")", "throws", "BadDateException", "{", "try", "{", "if", "(", "dt", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "!", "dt", ".", "contains", "(", "\"-\"", ")...
Return rfc or iso String datetime as java Date @param dt string date @return Date @throws BadDateException on format error
[ "Return", "rfc", "or", "iso", "String", "datetime", "as", "java", "Date" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L538-L552
train
sebastiangraf/treetank
coremodules/core/src/main/java/org/treetank/access/conf/ModuleSetter.java
ModuleSetter.createModule
public AbstractModule createModule() { return new AbstractModule() { @Override protected void configure() { bind(IDataFactory.class).to(mDataFacClass); bind(IMetaEntryFactory.class).to(mMetaFacClass); bind(IRevisioning.class).to(mRevisionin...
java
public AbstractModule createModule() { return new AbstractModule() { @Override protected void configure() { bind(IDataFactory.class).to(mDataFacClass); bind(IMetaEntryFactory.class).to(mMetaFacClass); bind(IRevisioning.class).to(mRevisionin...
[ "public", "AbstractModule", "createModule", "(", ")", "{", "return", "new", "AbstractModule", "(", ")", "{", "@", "Override", "protected", "void", "configure", "(", ")", "{", "bind", "(", "IDataFactory", ".", "class", ")", ".", "to", "(", "mDataFacClass", ...
Creating an Guice Module based on the parameters set. @return the {@link AbstractModule} to be set
[ "Creating", "an", "Guice", "Module", "based", "on", "the", "parameters", "set", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/core/src/main/java/org/treetank/access/conf/ModuleSetter.java#L120-L135
train
Bedework/bw-util
bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java
XmlEmit.setProperty
public void setProperty(final String name, final String val) { if (props == null) { props = new Properties(); } props.setProperty(name, val); }
java
public void setProperty(final String name, final String val) { if (props == null) { props = new Properties(); } props.setProperty(name, val); }
[ "public", "void", "setProperty", "(", "final", "String", "name", ",", "final", "String", "val", ")", "{", "if", "(", "props", "==", "null", ")", "{", "props", "=", "new", "Properties", "(", ")", ";", "}", "props", ".", "setProperty", "(", "name", ","...
Allows applications to provide parameters to methods using this object class, <p>For example, a parameter "full" with value "true" might indicate a full XML dump is required. @param name @param val
[ "Allows", "applications", "to", "provide", "parameters", "to", "methods", "using", "this", "object", "class" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java#L141-L147
train
Bedework/bw-util
bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java
XmlEmit.startEmit
public void startEmit(final Writer wtr, final String dtd) throws IOException { this.wtr = wtr; this.dtd = dtd; }
java
public void startEmit(final Writer wtr, final String dtd) throws IOException { this.wtr = wtr; this.dtd = dtd; }
[ "public", "void", "startEmit", "(", "final", "Writer", "wtr", ",", "final", "String", "dtd", ")", "throws", "IOException", "{", "this", ".", "wtr", "=", "wtr", ";", "this", ".", "dtd", "=", "dtd", ";", "}" ]
Emit any headers, dtd and namespace declarations @param wtr @param dtd @throws IOException
[ "Emit", "any", "headers", "dtd", "and", "namespace", "declarations" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java#L176-L179
train
Bedework/bw-util
bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java
XmlEmit.openTag
public void openTag(final QName tag, final String attrName, final String attrVal) throws IOException { blanks(); openTagSameLine(tag, attrName, attrVal); newline(); indent += 2; }
java
public void openTag(final QName tag, final String attrName, final String attrVal) throws IOException { blanks(); openTagSameLine(tag, attrName, attrVal); newline(); indent += 2; }
[ "public", "void", "openTag", "(", "final", "QName", "tag", ",", "final", "String", "attrName", ",", "final", "String", "attrVal", ")", "throws", "IOException", "{", "blanks", "(", ")", ";", "openTagSameLine", "(", "tag", ",", "attrName", ",", "attrVal", ")...
open with attribute @param tag @param attrName @param attrVal @throws IOException
[ "open", "with", "attribute" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java#L208-L215
train
Bedework/bw-util
bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java
XmlEmit.openTagSameLine
public void openTagSameLine(final QName tag, final String attrName, final String attrVal) throws IOException { lb(); emitQName(tag); attribute(attrName, attrVal); endOpeningTag(); }
java
public void openTagSameLine(final QName tag, final String attrName, final String attrVal) throws IOException { lb(); emitQName(tag); attribute(attrName, attrVal); endOpeningTag(); }
[ "public", "void", "openTagSameLine", "(", "final", "QName", "tag", ",", "final", "String", "attrName", ",", "final", "String", "attrVal", ")", "throws", "IOException", "{", "lb", "(", ")", ";", "emitQName", "(", "tag", ")", ";", "attribute", "(", "attrName...
Emit an opening tag ready for nested values. No new line @param tag @param attrName @param attrVal @throws IOException
[ "Emit", "an", "opening", "tag", "ready", "for", "nested", "values", ".", "No", "new", "line" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java#L258-L265
train
Bedework/bw-util
bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java
XmlEmit.value
private void value(final String val, final String quoteChar) throws IOException { if (val == null) { return; } String q = quoteChar; if (q == null) { q = ""; } if ((val.indexOf('&') >= 0) || (val.indexOf('<') >= 0)) { out("<![CDATA["); out(q...
java
private void value(final String val, final String quoteChar) throws IOException { if (val == null) { return; } String q = quoteChar; if (q == null) { q = ""; } if ((val.indexOf('&') >= 0) || (val.indexOf('<') >= 0)) { out("<![CDATA["); out(q...
[ "private", "void", "value", "(", "final", "String", "val", ",", "final", "String", "quoteChar", ")", "throws", "IOException", "{", "if", "(", "val", "==", "null", ")", "{", "return", ";", "}", "String", "q", "=", "quoteChar", ";", "if", "(", "q", "==...
Write out a value @param val @param quoteChar @throws IOException
[ "Write", "out", "a", "value" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java#L545-L568
train
Bedework/bw-util
bw-util-options/src/main/java/org/bedework/util/options/Options.java
Options.parseOptions
public OptionElement parseOptions(final InputStream is) throws OptionsException{ Reader rdr = null; try { rdr = new InputStreamReader(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(false); DocumentBuilder builder = factory.newDocu...
java
public OptionElement parseOptions(final InputStream is) throws OptionsException{ Reader rdr = null; try { rdr = new InputStreamReader(is); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(false); DocumentBuilder builder = factory.newDocu...
[ "public", "OptionElement", "parseOptions", "(", "final", "InputStream", "is", ")", "throws", "OptionsException", "{", "Reader", "rdr", "=", "null", ";", "try", "{", "rdr", "=", "new", "InputStreamReader", "(", "is", ")", ";", "DocumentBuilderFactory", "factory",...
Parse the input stream and return the internal representation. @param is InputStream @return OptionElement root of parsed options. @exception OptionsException Some error occurred.
[ "Parse", "the", "input", "stream", "and", "return", "the", "internal", "representation", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-options/src/main/java/org/bedework/util/options/Options.java#L156-L194
train
Bedework/bw-util
bw-util-options/src/main/java/org/bedework/util/options/Options.java
Options.toXml
public void toXml(final OptionElement root, final OutputStream str) throws OptionsException { Writer wtr = null; try { XmlEmit xml = new XmlEmit(true); wtr = new OutputStreamWriter(str); xml.startEmit(wtr); xml.openTag(outerTag); for (OptionElement oe: root.getChildren()) { ...
java
public void toXml(final OptionElement root, final OutputStream str) throws OptionsException { Writer wtr = null; try { XmlEmit xml = new XmlEmit(true); wtr = new OutputStreamWriter(str); xml.startEmit(wtr); xml.openTag(outerTag); for (OptionElement oe: root.getChildren()) { ...
[ "public", "void", "toXml", "(", "final", "OptionElement", "root", ",", "final", "OutputStream", "str", ")", "throws", "OptionsException", "{", "Writer", "wtr", "=", "null", ";", "try", "{", "XmlEmit", "xml", "=", "new", "XmlEmit", "(", "true", ")", ";", ...
Emit the options as xml. @param root @param str @throws OptionsException
[ "Emit", "the", "options", "as", "xml", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-options/src/main/java/org/bedework/util/options/Options.java#L202-L229
train
Bedework/bw-util
bw-util-options/src/main/java/org/bedework/util/options/Options.java
Options.getProperty
@Override public Object getProperty(final String name) throws OptionsException { Object val = getOptProperty(name); if (val == null) { throw new OptionsException("Missing property " + name); } return val; }
java
@Override public Object getProperty(final String name) throws OptionsException { Object val = getOptProperty(name); if (val == null) { throw new OptionsException("Missing property " + name); } return val; }
[ "@", "Override", "public", "Object", "getProperty", "(", "final", "String", "name", ")", "throws", "OptionsException", "{", "Object", "val", "=", "getOptProperty", "(", "name", ")", ";", "if", "(", "val", "==", "null", ")", "{", "throw", "new", "OptionsExc...
Get required property, throw exception if absent @param name String property name @return Object value @throws OptionsException
[ "Get", "required", "property", "throw", "exception", "if", "absent" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-options/src/main/java/org/bedework/util/options/Options.java#L321-L330
train
Bedework/bw-util
bw-util-options/src/main/java/org/bedework/util/options/Options.java
Options.getStringProperty
@Override public String getStringProperty(final String name) throws OptionsException { Object val = getProperty(name); if (!(val instanceof String)) { throw new OptionsException("org.bedework.calenv.bad.option.value"); } return (String)val; }
java
@Override public String getStringProperty(final String name) throws OptionsException { Object val = getProperty(name); if (!(val instanceof String)) { throw new OptionsException("org.bedework.calenv.bad.option.value"); } return (String)val; }
[ "@", "Override", "public", "String", "getStringProperty", "(", "final", "String", "name", ")", "throws", "OptionsException", "{", "Object", "val", "=", "getProperty", "(", "name", ")", ";", "if", "(", "!", "(", "val", "instanceof", "String", ")", ")", "{",...
Return the String value of the named property. @param name String property name @return String value of property @throws OptionsException
[ "Return", "the", "String", "value", "of", "the", "named", "property", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-options/src/main/java/org/bedework/util/options/Options.java#L353-L362
train
Bedework/bw-util
bw-util-options/src/main/java/org/bedework/util/options/Options.java
Options.match
public Collection match(final String name) throws OptionsException { if (useSystemwideValues) { return match(optionsRoot, makePathElements(name), -1); } return match(localOptionsRoot, makePathElements(name), -1); }
java
public Collection match(final String name) throws OptionsException { if (useSystemwideValues) { return match(optionsRoot, makePathElements(name), -1); } return match(localOptionsRoot, makePathElements(name), -1); }
[ "public", "Collection", "match", "(", "final", "String", "name", ")", "throws", "OptionsException", "{", "if", "(", "useSystemwideValues", ")", "{", "return", "match", "(", "optionsRoot", ",", "makePathElements", "(", "name", ")", ",", "-", "1", ")", ";", ...
Match for values. @param name String property name prefix @return Collection @throws OptionsException
[ "Match", "for", "values", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-options/src/main/java/org/bedework/util/options/Options.java#L594-L600
train
Bedework/bw-util
bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java
StrutsUtil.getProperty
public static String getProperty(final MessageResources msg, final String pname, final String def) throws Throwable { String p = msg.getMessage(pname); if (p == null) { return def; } return p; }
java
public static String getProperty(final MessageResources msg, final String pname, final String def) throws Throwable { String p = msg.getMessage(pname); if (p == null) { return def; } return p; }
[ "public", "static", "String", "getProperty", "(", "final", "MessageResources", "msg", ",", "final", "String", "pname", ",", "final", "String", "def", ")", "throws", "Throwable", "{", "String", "p", "=", "msg", ".", "getMessage", "(", "pname", ")", ";", "if...
Return a property value or the default @param msg MessageResources object @param pname String name of the property @param def String default value @return String property value or default (may be null) @throws Throwable on error
[ "Return", "a", "property", "value", "or", "the", "default" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java#L54-L63
train
Bedework/bw-util
bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java
StrutsUtil.getReqProperty
public static String getReqProperty(final MessageResources msg, final String pname) throws Throwable { String p = getProperty(msg, pname, null); if (p == null) { logger.error("No definition for property " + pname); throw new Exception(": No definition for prope...
java
public static String getReqProperty(final MessageResources msg, final String pname) throws Throwable { String p = getProperty(msg, pname, null); if (p == null) { logger.error("No definition for property " + pname); throw new Exception(": No definition for prope...
[ "public", "static", "String", "getReqProperty", "(", "final", "MessageResources", "msg", ",", "final", "String", "pname", ")", "throws", "Throwable", "{", "String", "p", "=", "getProperty", "(", "msg", ",", "pname", ",", "null", ")", ";", "if", "(", "p", ...
Return a required property value @param msg MessageResources object @param pname name of the property @return String property value @throws Throwable on error
[ "Return", "a", "required", "property", "value" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java#L72-L82
train
Bedework/bw-util
bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java
StrutsUtil.getBoolProperty
public static boolean getBoolProperty(final MessageResources msg, final String pname, final boolean def) throws Throwable { String p = msg.getMessage(pname); if (p == null) { return def; } return Boolean.valueOf(p); ...
java
public static boolean getBoolProperty(final MessageResources msg, final String pname, final boolean def) throws Throwable { String p = msg.getMessage(pname); if (p == null) { return def; } return Boolean.valueOf(p); ...
[ "public", "static", "boolean", "getBoolProperty", "(", "final", "MessageResources", "msg", ",", "final", "String", "pname", ",", "final", "boolean", "def", ")", "throws", "Throwable", "{", "String", "p", "=", "msg", ".", "getMessage", "(", "pname", ")", ";",...
Return a boolean property value or the default @param msg MessageResources object @param pname String name of the property @param def boolean default value @return boolean property value or default @throws Throwable on error
[ "Return", "a", "boolean", "property", "value", "or", "the", "default" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java#L92-L101
train
Bedework/bw-util
bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java
StrutsUtil.getIntProperty
public static int getIntProperty(final MessageResources msg, final String pname, final int def) throws Throwable { String p = msg.getMessage(pname); if (p == null) { return def; } return Integer.valueOf(p); }
java
public static int getIntProperty(final MessageResources msg, final String pname, final int def) throws Throwable { String p = msg.getMessage(pname); if (p == null) { return def; } return Integer.valueOf(p); }
[ "public", "static", "int", "getIntProperty", "(", "final", "MessageResources", "msg", ",", "final", "String", "pname", ",", "final", "int", "def", ")", "throws", "Throwable", "{", "String", "p", "=", "msg", ".", "getMessage", "(", "pname", ")", ";", "if", ...
Return an int property value or the default @param msg MessageResources object @param pname String name of the property @param def int default value @return int property value or default @throws Throwable on error
[ "Return", "an", "int", "property", "value", "or", "the", "default" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java#L111-L120
train
Bedework/bw-util
bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java
StrutsUtil.getErrorObj
public static MessageEmit getErrorObj(final HttpServletRequest request, final String errorObjAttrName) { if (errorObjAttrName == null) { // don't set return null; } HttpSession sess = request.getSession(false); if (sess == null) { logger.error(...
java
public static MessageEmit getErrorObj(final HttpServletRequest request, final String errorObjAttrName) { if (errorObjAttrName == null) { // don't set return null; } HttpSession sess = request.getSession(false); if (sess == null) { logger.error(...
[ "public", "static", "MessageEmit", "getErrorObj", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "errorObjAttrName", ")", "{", "if", "(", "errorObjAttrName", "==", "null", ")", "{", "// don't set", "return", "null", ";", "}", "HttpSession",...
Get the existing error object from the session or null. @param request Needed to locate session @param errorObjAttrName name of session attribute @return MessageEmit null on none found
[ "Get", "the", "existing", "error", "object", "from", "the", "session", "or", "null", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java#L194-L214
train
Bedework/bw-util
bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java
StrutsUtil.getMessageObj
public static MessageEmit getMessageObj(final HttpServletRequest request, final String messageObjAttrName) { if (messageObjAttrName == null) { // don't set return null; } HttpSession sess = request.getSession(false); if (sess == null) { logge...
java
public static MessageEmit getMessageObj(final HttpServletRequest request, final String messageObjAttrName) { if (messageObjAttrName == null) { // don't set return null; } HttpSession sess = request.getSession(false); if (sess == null) { logge...
[ "public", "static", "MessageEmit", "getMessageObj", "(", "final", "HttpServletRequest", "request", ",", "final", "String", "messageObjAttrName", ")", "{", "if", "(", "messageObjAttrName", "==", "null", ")", "{", "// don't set", "return", "null", ";", "}", "HttpSes...
Get the existing message object from the session or null. @param request Needed to locate session @param messageObjAttrName name of session attribute @return MessageEmit null on none found
[ "Get", "the", "existing", "message", "object", "from", "the", "session", "or", "null", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-struts/src/main/java/org/bedework/util/struts/StrutsUtil.java#L282-L302
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Util.java
Util.quickRatio
public static double quickRatio(final String paramFirst, final String paramSecond) { if (paramFirst == null || paramSecond == null) { return 1; } double matches = 0; // Use a sparse array to reduce the memory usage // for unicode characters. final int x[][] =...
java
public static double quickRatio(final String paramFirst, final String paramSecond) { if (paramFirst == null || paramSecond == null) { return 1; } double matches = 0; // Use a sparse array to reduce the memory usage // for unicode characters. final int x[][] =...
[ "public", "static", "double", "quickRatio", "(", "final", "String", "paramFirst", ",", "final", "String", "paramSecond", ")", "{", "if", "(", "paramFirst", "==", "null", "||", "paramSecond", "==", "null", ")", "{", "return", "1", ";", "}", "double", "match...
Calculates the similarity of two strings. This is done by comparing the frequency each character occures in both strings. @param paramFirst first string @param paramSecond second string @return similarity of a and b, a value in [0, 1]
[ "Calculates", "the", "similarity", "of", "two", "strings", ".", "This", "is", "done", "by", "comparing", "the", "frequency", "each", "character", "occures", "in", "both", "strings", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Util.java#L119-L143
train
Bedework/bw-util
bw-util-jmx/src/main/java/org/bedework/util/jmx/ManagementContext.java
ManagementContext.createCustomComponentMBeanName
public ObjectName createCustomComponentMBeanName(final String type, final String name) { ObjectName result = null; String tmp = jmxDomainName + ":" + "type=" + sanitizeString(type) + ",name=" + sanitizeString(name); try { result = new ObjectName(tmp); } catch (Mal...
java
public ObjectName createCustomComponentMBeanName(final String type, final String name) { ObjectName result = null; String tmp = jmxDomainName + ":" + "type=" + sanitizeString(type) + ",name=" + sanitizeString(name); try { result = new ObjectName(tmp); } catch (Mal...
[ "public", "ObjectName", "createCustomComponentMBeanName", "(", "final", "String", "type", ",", "final", "String", "name", ")", "{", "ObjectName", "result", "=", "null", ";", "String", "tmp", "=", "jmxDomainName", "+", "\":\"", "+", "\"type=\"", "+", "sanitizeStr...
Formulate and return the MBean ObjectName of a custom control MBean @param type @param name @return the JMX ObjectName of the MBean, or <code>null</code> if <code>customName</code> is invalid.
[ "Formulate", "and", "return", "the", "MBean", "ObjectName", "of", "a", "custom", "control", "MBean" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-jmx/src/main/java/org/bedework/util/jmx/ManagementContext.java#L203-L214
train
Bedework/bw-util
bw-util-jmx/src/main/java/org/bedework/util/jmx/ManagementContext.java
ManagementContext.getSystemObjectName
public static ObjectName getSystemObjectName(final String domainName, final String containerName, final Class theClass) throws MalformedObjectNameException { String tmp = domainName + ":" + "type=" + theCl...
java
public static ObjectName getSystemObjectName(final String domainName, final String containerName, final Class theClass) throws MalformedObjectNameException { String tmp = domainName + ":" + "type=" + theCl...
[ "public", "static", "ObjectName", "getSystemObjectName", "(", "final", "String", "domainName", ",", "final", "String", "containerName", ",", "final", "Class", "theClass", ")", "throws", "MalformedObjectNameException", "{", "String", "tmp", "=", "domainName", "+", "\...
Retrieve a System ObjectName @param domainName @param containerName @param theClass @return the ObjectName @throws MalformedObjectNameException
[ "Retrieve", "a", "System", "ObjectName" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-jmx/src/main/java/org/bedework/util/jmx/ManagementContext.java#L254-L261
train
Bedework/bw-util
bw-util-jmx/src/main/java/org/bedework/util/jmx/ManagementContext.java
ManagementContext.unregisterMBean
public void unregisterMBean(final ObjectName name) throws JMException { if ((beanServer != null) && beanServer.isRegistered(name) && registeredMBeanNames.remove(name)) { beanServer.unregisterMBean(name); } }
java
public void unregisterMBean(final ObjectName name) throws JMException { if ((beanServer != null) && beanServer.isRegistered(name) && registeredMBeanNames.remove(name)) { beanServer.unregisterMBean(name); } }
[ "public", "void", "unregisterMBean", "(", "final", "ObjectName", "name", ")", "throws", "JMException", "{", "if", "(", "(", "beanServer", "!=", "null", ")", "&&", "beanServer", ".", "isRegistered", "(", "name", ")", "&&", "registeredMBeanNames", ".", "remove",...
Unregister an MBean @param name of mbean @throws JMException
[ "Unregister", "an", "MBean" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-jmx/src/main/java/org/bedework/util/jmx/ManagementContext.java#L363-L369
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java
ConnectionMap.set
public void set(final T paramOrigin, final T paramDestination, final boolean paramBool) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { mMap.put(paramOrigin, new IdentityHashMap<T, Boolean>()); } mMap.get(paramOrig...
java
public void set(final T paramOrigin, final T paramDestination, final boolean paramBool) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { mMap.put(paramOrigin, new IdentityHashMap<T, Boolean>()); } mMap.get(paramOrig...
[ "public", "void", "set", "(", "final", "T", "paramOrigin", ",", "final", "T", "paramDestination", ",", "final", "boolean", "paramBool", ")", "{", "assert", "paramOrigin", "!=", "null", ";", "assert", "paramDestination", "!=", "null", ";", "if", "(", "!", "...
Sets the connection between a and b. @param paramOrigin origin object @param paramDestination destination object @param paramBool if connection is established or not
[ "Sets", "the", "connection", "between", "a", "and", "b", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java#L74-L82
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java
ConnectionMap.get
public boolean get(final T paramOrigin, final T paramDestination) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { return false; } final Boolean bool = mMap.get(paramOrigin).get(paramDestination); return boo...
java
public boolean get(final T paramOrigin, final T paramDestination) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { return false; } final Boolean bool = mMap.get(paramOrigin).get(paramDestination); return boo...
[ "public", "boolean", "get", "(", "final", "T", "paramOrigin", ",", "final", "T", "paramDestination", ")", "{", "assert", "paramOrigin", "!=", "null", ";", "assert", "paramDestination", "!=", "null", ";", "if", "(", "!", "mMap", ".", "containsKey", "(", "pa...
Returns whether there is a connection between a and b. Unknown objects do never have a connection. @param paramOrigin origin object @param paramDestination destination object @return true, iff there is a connection from a to b
[ "Returns", "whether", "there", "is", "a", "connection", "between", "a", "and", "b", ".", "Unknown", "objects", "do", "never", "have", "a", "connection", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java#L94-L103
train
Bedework/bw-util
bw-util-jms/src/main/java/org/bedework/util/jms/events/SysEvent.java
SysEvent.toStringSegment
public void toStringSegment(final ToString ts) { ts.append("sysCode", String.valueOf(getSysCode())); ts.append("dtstamp", getDtstamp()); ts.append("sequence", getSequence()); }
java
public void toStringSegment(final ToString ts) { ts.append("sysCode", String.valueOf(getSysCode())); ts.append("dtstamp", getDtstamp()); ts.append("sequence", getSequence()); }
[ "public", "void", "toStringSegment", "(", "final", "ToString", "ts", ")", "{", "ts", ".", "append", "(", "\"sysCode\"", ",", "String", ".", "valueOf", "(", "getSysCode", "(", ")", ")", ")", ";", "ts", ".", "append", "(", "\"dtstamp\"", ",", "getDtstamp",...
Add our stuff to the ToString object @param ts ToString for result
[ "Add", "our", "stuff", "to", "the", "ToString", "object" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-jms/src/main/java/org/bedework/util/jms/events/SysEvent.java#L248-L252
train
Bedework/bw-util
bw-util-servlet/src/main/java/org/bedework/util/servlet/io/PooledBufferedOutputStream.java
PooledBufferedOutputStream.toByteArray
public synchronized byte[] toByteArray() { byte[] outBuff = new byte[count]; int pos = 0; for (BufferPool.Buffer b: buffers) { System.arraycopy(b.buf, 0, outBuff, pos, b.pos); pos += b.pos; } return outBuff; }
java
public synchronized byte[] toByteArray() { byte[] outBuff = new byte[count]; int pos = 0; for (BufferPool.Buffer b: buffers) { System.arraycopy(b.buf, 0, outBuff, pos, b.pos); pos += b.pos; } return outBuff; }
[ "public", "synchronized", "byte", "[", "]", "toByteArray", "(", ")", "{", "byte", "[", "]", "outBuff", "=", "new", "byte", "[", "count", "]", ";", "int", "pos", "=", "0", ";", "for", "(", "BufferPool", ".", "Buffer", "b", ":", "buffers", ")", "{", ...
Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it. @return the current contents of this output stream, as a byte array. @see java.io.ByteArrayOutputStream#size()
[ "Creates", "a", "newly", "allocated", "byte", "array", ".", "Its", "size", "is", "the", "current", "size", "of", "this", "output", "stream", "and", "the", "valid", "contents", "of", "the", "buffer", "have", "been", "copied", "into", "it", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet/src/main/java/org/bedework/util/servlet/io/PooledBufferedOutputStream.java#L162-L172
train
Bedework/bw-util
bw-util-servlet/src/main/java/org/bedework/util/servlet/io/PooledBufferedOutputStream.java
PooledBufferedOutputStream.release
public void release() throws IOException { for (BufferPool.Buffer b: buffers) { PooledBuffers.release(b); } buffers.clear(); count = 0; }
java
public void release() throws IOException { for (BufferPool.Buffer b: buffers) { PooledBuffers.release(b); } buffers.clear(); count = 0; }
[ "public", "void", "release", "(", ")", "throws", "IOException", "{", "for", "(", "BufferPool", ".", "Buffer", "b", ":", "buffers", ")", "{", "PooledBuffers", ".", "release", "(", "b", ")", ";", "}", "buffers", ".", "clear", "(", ")", ";", "count", "=...
This really release buffers back to the pool. MUST be called to gain the benefit of pooling. @throws IOException
[ "This", "really", "release", "buffers", "back", "to", "the", "pool", ".", "MUST", "be", "called", "to", "gain", "the", "benefit", "of", "pooling", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet/src/main/java/org/bedework/util/servlet/io/PooledBufferedOutputStream.java#L245-L252
train
sebastiangraf/treetank
coremodules/core/src/main/java/org/treetank/io/IOUtils.java
IOUtils.createFolderStructure
public static boolean createFolderStructure(final File pFile, IConfigurationPath[] pPaths) throws TTIOException { boolean returnVal = true; pFile.mkdirs(); // creation of folder structure for (IConfigurationPath paths : pPaths) { final File toCreate = new File(pFile, ...
java
public static boolean createFolderStructure(final File pFile, IConfigurationPath[] pPaths) throws TTIOException { boolean returnVal = true; pFile.mkdirs(); // creation of folder structure for (IConfigurationPath paths : pPaths) { final File toCreate = new File(pFile, ...
[ "public", "static", "boolean", "createFolderStructure", "(", "final", "File", "pFile", ",", "IConfigurationPath", "[", "]", "pPaths", ")", "throws", "TTIOException", "{", "boolean", "returnVal", "=", "true", ";", "pFile", ".", "mkdirs", "(", ")", ";", "// crea...
Creating a folder structure based on a set of paths given as parameter and returning a boolean determining the success. @param pFile the root folder where the configuration should be created to. @param pPaths to be created @return true if creations was successful, false otherwise. @throws TTIOException
[ "Creating", "a", "folder", "structure", "based", "on", "a", "set", "of", "paths", "given", "as", "parameter", "and", "returning", "a", "boolean", "determining", "the", "success", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/core/src/main/java/org/treetank/io/IOUtils.java#L32-L53
train
sebastiangraf/treetank
coremodules/core/src/main/java/org/treetank/io/IOUtils.java
IOUtils.compareStructure
public static int compareStructure(final File pFile, IConfigurationPath[] pPaths) { int existing = 0; for (final IConfigurationPath path : pPaths) { final File currentFile = new File(pFile, path.getFile().getName()); if (currentFile.exists()) { existing++; ...
java
public static int compareStructure(final File pFile, IConfigurationPath[] pPaths) { int existing = 0; for (final IConfigurationPath path : pPaths) { final File currentFile = new File(pFile, path.getFile().getName()); if (currentFile.exists()) { existing++; ...
[ "public", "static", "int", "compareStructure", "(", "final", "File", "pFile", ",", "IConfigurationPath", "[", "]", "pPaths", ")", "{", "int", "existing", "=", "0", ";", "for", "(", "final", "IConfigurationPath", "path", ":", "pPaths", ")", "{", "final", "F...
Checking a structure in a folder to be equal with the data in this enum. @param pFile to be checked @param pPaths containing the elements to be checked against @return -1 if less folders are there, 0 if the structure is equal to the one expected, 1 if the structure has more folders
[ "Checking", "a", "structure", "in", "a", "folder", "to", "be", "equal", "with", "the", "data", "in", "this", "enum", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/core/src/main/java/org/treetank/io/IOUtils.java#L66-L75
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/DiffFactory.java
DiffFactory.invokeFullDiff
public static synchronized void invokeFullDiff(final Builder paramBuilder) throws TTException { checkParams(paramBuilder); DiffKind.FULL.invoke(paramBuilder); }
java
public static synchronized void invokeFullDiff(final Builder paramBuilder) throws TTException { checkParams(paramBuilder); DiffKind.FULL.invoke(paramBuilder); }
[ "public", "static", "synchronized", "void", "invokeFullDiff", "(", "final", "Builder", "paramBuilder", ")", "throws", "TTException", "{", "checkParams", "(", "paramBuilder", ")", ";", "DiffKind", ".", "FULL", ".", "invoke", "(", "paramBuilder", ")", ";", "}" ]
Do a full diff. @param paramBuilder {@link Builder} reference @throws TTException
[ "Do", "a", "full", "diff", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/DiffFactory.java#L186-L189
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/DiffFactory.java
DiffFactory.invokeStructuralDiff
public static synchronized void invokeStructuralDiff(final Builder paramBuilder) throws TTException { checkParams(paramBuilder); DiffKind.STRUCTURAL.invoke(paramBuilder); }
java
public static synchronized void invokeStructuralDiff(final Builder paramBuilder) throws TTException { checkParams(paramBuilder); DiffKind.STRUCTURAL.invoke(paramBuilder); }
[ "public", "static", "synchronized", "void", "invokeStructuralDiff", "(", "final", "Builder", "paramBuilder", ")", "throws", "TTException", "{", "checkParams", "(", "paramBuilder", ")", ";", "DiffKind", ".", "STRUCTURAL", ".", "invoke", "(", "paramBuilder", ")", ";...
Do a structural diff. @param paramBuilder {@link Builder} reference @throws TTException
[ "Do", "a", "structural", "diff", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/DiffFactory.java#L198-L201
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/DiffFactory.java
DiffFactory.checkParams
private static void checkParams(final Builder paramBuilder) { checkState(paramBuilder.mSession != null && paramBuilder.mKey >= 0 && paramBuilder.mNewRev >= 0 && paramBuilder.mOldRev >= 0 && paramBuilder.mObservers != null && paramBuilder.mKind != null, "No valid arguments specified!"); ...
java
private static void checkParams(final Builder paramBuilder) { checkState(paramBuilder.mSession != null && paramBuilder.mKey >= 0 && paramBuilder.mNewRev >= 0 && paramBuilder.mOldRev >= 0 && paramBuilder.mObservers != null && paramBuilder.mKind != null, "No valid arguments specified!"); ...
[ "private", "static", "void", "checkParams", "(", "final", "Builder", "paramBuilder", ")", "{", "checkState", "(", "paramBuilder", ".", "mSession", "!=", "null", "&&", "paramBuilder", ".", "mKey", ">=", "0", "&&", "paramBuilder", ".", "mNewRev", ">=", "0", "&...
Check parameters for validity and assign global static variables. @param paramBuilder {@link Builder} reference
[ "Check", "parameters", "for", "validity", "and", "assign", "global", "static", "variables", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/DiffFactory.java#L209-L216
train
Bedework/bw-util
bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java
DirRecord.equalsAllBut
public boolean equalsAllBut(DirRecord that, String[] attrIDs) throws NamingException { if (attrIDs == null) throw new NamingException("DirectoryRecord: null attrID list"); if (!dnEquals(that)) { return false; } int n = attrIDs.length; if (n == 0) return true; Attributes thisAttrs...
java
public boolean equalsAllBut(DirRecord that, String[] attrIDs) throws NamingException { if (attrIDs == null) throw new NamingException("DirectoryRecord: null attrID list"); if (!dnEquals(that)) { return false; } int n = attrIDs.length; if (n == 0) return true; Attributes thisAttrs...
[ "public", "boolean", "equalsAllBut", "(", "DirRecord", "that", ",", "String", "[", "]", "attrIDs", ")", "throws", "NamingException", "{", "if", "(", "attrIDs", "==", "null", ")", "throw", "new", "NamingException", "(", "\"DirectoryRecord: null attrID list\"", ")",...
This compares all but the named attributes allbut true => All must be equal except those on the list @param that @param attrIDs @return boolean @throws NamingException
[ "This", "compares", "all", "but", "the", "named", "attributes", "allbut", "true", "=", ">", "All", "must", "be", "equal", "except", "those", "on", "the", "list" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java#L251-L322
train
Bedework/bw-util
bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java
DirRecord.dnEquals
public boolean dnEquals(DirRecord that) throws NamingException { if (that == null) { throw new NamingException("Null record for dnEquals"); } String thisDn = getDn(); if (thisDn == null) { throw new NamingException("No dn for this record"); } String thatDn = that.getDn(); if (t...
java
public boolean dnEquals(DirRecord that) throws NamingException { if (that == null) { throw new NamingException("Null record for dnEquals"); } String thisDn = getDn(); if (thisDn == null) { throw new NamingException("No dn for this record"); } String thatDn = that.getDn(); if (t...
[ "public", "boolean", "dnEquals", "(", "DirRecord", "that", ")", "throws", "NamingException", "{", "if", "(", "that", "==", "null", ")", "{", "throw", "new", "NamingException", "(", "\"Null record for dnEquals\"", ")", ";", "}", "String", "thisDn", "=", "getDn"...
Check dns for equality @param that @return boolean @throws NamingException
[ "Check", "dns", "for", "equality" ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java#L454-L470
train
Bedework/bw-util
bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java
DirRecord.addAttr
public void addAttr(String attr, Object val) throws NamingException { // System.out.println("addAttr " + attr); Attribute a = findAttr(attr); if (a == null) { setAttr(attr, val); } else { a.add(val); } }
java
public void addAttr(String attr, Object val) throws NamingException { // System.out.println("addAttr " + attr); Attribute a = findAttr(attr); if (a == null) { setAttr(attr, val); } else { a.add(val); } }
[ "public", "void", "addAttr", "(", "String", "attr", ",", "Object", "val", ")", "throws", "NamingException", "{", "// System.out.println(\"addAttr \" + attr);", "Attribute", "a", "=", "findAttr", "(", "attr", ")", ";", "if", "(", "a", "==", "null", ")", "{", ...
Add the attribute value to the table. If an attribute already exists add it to the end of its values. @param attr String attribute name @param val Object value @throws NamingException
[ "Add", "the", "attribute", "value", "to", "the", "table", ".", "If", "an", "attribute", "already", "exists", "add", "it", "to", "the", "end", "of", "its", "values", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java#L479-L489
train
Bedework/bw-util
bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java
DirRecord.contains
public boolean contains(Attribute attr) throws NamingException { if (attr == null) { return false; // protect } Attribute recAttr = getAttributes().get(attr.getID()); if (recAttr == null) { return false; } NamingEnumeration ne = attr.getAll(); while (ne.hasMore()) { if ...
java
public boolean contains(Attribute attr) throws NamingException { if (attr == null) { return false; // protect } Attribute recAttr = getAttributes().get(attr.getID()); if (recAttr == null) { return false; } NamingEnumeration ne = attr.getAll(); while (ne.hasMore()) { if ...
[ "public", "boolean", "contains", "(", "Attribute", "attr", ")", "throws", "NamingException", "{", "if", "(", "attr", "==", "null", ")", "{", "return", "false", ";", "// protect", "}", "Attribute", "recAttr", "=", "getAttributes", "(", ")", ".", "get", "(",...
Return true if the record contains all of the values of the given attribute. @param attr Attribute we're looking for @return boolean true if we found it @throws NamingException
[ "Return", "true", "if", "the", "record", "contains", "all", "of", "the", "values", "of", "the", "given", "attribute", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java#L519-L539
train
Bedework/bw-util
bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java
DirRecord.attrElements
public NamingEnumeration attrElements(String attr) throws NamingException { Attribute a = findAttr(attr); if (a == null) { return null; } return a.getAll(); }
java
public NamingEnumeration attrElements(String attr) throws NamingException { Attribute a = findAttr(attr); if (a == null) { return null; } return a.getAll(); }
[ "public", "NamingEnumeration", "attrElements", "(", "String", "attr", ")", "throws", "NamingException", "{", "Attribute", "a", "=", "findAttr", "(", "attr", ")", ";", "if", "(", "a", "==", "null", ")", "{", "return", "null", ";", "}", "return", "a", ".",...
Retrieve an enumeration of the named attribute's values. The behaviour of this enumeration is unspecified if the the attribute's values are added, changed, or removed while the enumeration is in progress. If the attribute values are ordered, the enumeration's items will be ordered. Each element of the enumeration is a...
[ "Retrieve", "an", "enumeration", "of", "the", "named", "attribute", "s", "values", ".", "The", "behaviour", "of", "this", "enumeration", "is", "unspecified", "if", "the", "the", "attribute", "s", "values", "are", "added", "changed", "or", "removed", "while", ...
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java#L559-L567
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/StAXSerializer.java
StAXSerializer.emitEndTag
private void emitEndTag() throws TTIOException { final long nodeKey = mRtx.getNode().getDataKey(); mEvent = mFac.createEndElement(mRtx.getQNameOfCurrentNode(), new NamespaceIterator(mRtx)); mRtx.moveTo(nodeKey); }
java
private void emitEndTag() throws TTIOException { final long nodeKey = mRtx.getNode().getDataKey(); mEvent = mFac.createEndElement(mRtx.getQNameOfCurrentNode(), new NamespaceIterator(mRtx)); mRtx.moveTo(nodeKey); }
[ "private", "void", "emitEndTag", "(", ")", "throws", "TTIOException", "{", "final", "long", "nodeKey", "=", "mRtx", ".", "getNode", "(", ")", ".", "getDataKey", "(", ")", ";", "mEvent", "=", "mFac", ".", "createEndElement", "(", "mRtx", ".", "getQNameOfCur...
Emit end tag. @param paramRTX Treetank reading transaction {@link IReadTransaction}. @throws TTIOException
[ "Emit", "end", "tag", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/StAXSerializer.java#L165-L169
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/StAXSerializer.java
StAXSerializer.emitNode
private void emitNode() throws TTIOException { switch (mRtx.getNode().getKind()) { case ROOT: mEvent = mFac.createStartDocument(); break; case ELEMENT: final long key = mRtx.getNode().getDataKey(); final QName qName = mRtx.getQNameOfCurrentNode(); ...
java
private void emitNode() throws TTIOException { switch (mRtx.getNode().getKind()) { case ROOT: mEvent = mFac.createStartDocument(); break; case ELEMENT: final long key = mRtx.getNode().getDataKey(); final QName qName = mRtx.getQNameOfCurrentNode(); ...
[ "private", "void", "emitNode", "(", ")", "throws", "TTIOException", "{", "switch", "(", "mRtx", ".", "getNode", "(", ")", ".", "getKind", "(", ")", ")", "{", "case", "ROOT", ":", "mEvent", "=", "mFac", ".", "createStartDocument", "(", ")", ";", "break"...
Emit a node. @param paramRTX Treetank reading transaction {@link IReadTransaction}. @throws TTIOException
[ "Emit", "a", "node", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/StAXSerializer.java#L178-L195
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/StAXSerializer.java
StAXSerializer.emit
private void emit() throws TTIOException { // Emit pending end elements. if (mCloseElements) { if (!mStack.empty() && mStack.peek() != ((ITreeStructData)mRtx.getNode()).getLeftSiblingKey()) { mRtx.moveTo(mStack.pop()); emitEndTag(); mRtx.moveTo...
java
private void emit() throws TTIOException { // Emit pending end elements. if (mCloseElements) { if (!mStack.empty() && mStack.peek() != ((ITreeStructData)mRtx.getNode()).getLeftSiblingKey()) { mRtx.moveTo(mStack.pop()); emitEndTag(); mRtx.moveTo...
[ "private", "void", "emit", "(", ")", "throws", "TTIOException", "{", "// Emit pending end elements.", "if", "(", "mCloseElements", ")", "{", "if", "(", "!", "mStack", ".", "empty", "(", ")", "&&", "mStack", ".", "peek", "(", ")", "!=", "(", "(", "ITreeSt...
Move to node and emit it. @throws IOException In case of any I/O error.
[ "Move", "to", "node", "and", "emit", "it", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/serialize/StAXSerializer.java#L383-L423
train
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/filter/PredicateFilterAxis.java
PredicateFilterAxis.isBooleanFalse
private boolean isBooleanFalse() { if (getNode().getDataKey() >= 0) { return false; } else { // is AtomicValue if (getNode().getTypeKey() == NamePageHash.generateHashForString("xs:boolean")) { // atomic value of type boolean // return true, if ato...
java
private boolean isBooleanFalse() { if (getNode().getDataKey() >= 0) { return false; } else { // is AtomicValue if (getNode().getTypeKey() == NamePageHash.generateHashForString("xs:boolean")) { // atomic value of type boolean // return true, if ato...
[ "private", "boolean", "isBooleanFalse", "(", ")", "{", "if", "(", "getNode", "(", ")", ".", "getDataKey", "(", ")", ">=", "0", ")", "{", "return", "false", ";", "}", "else", "{", "// is AtomicValue", "if", "(", "getNode", "(", ")", ".", "getTypeKey", ...
Tests whether current Item is an atomic value with boolean value "false". @return true, if Item is boolean typed atomic value with type "false".
[ "Tests", "whether", "current", "Item", "is", "an", "atomic", "value", "with", "boolean", "value", "false", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/filter/PredicateFilterAxis.java#L117-L132
train
sebastiangraf/treetank
interfacemodules/saxon/src/main/java/org/treetank/saxon/wrapper/NodeWrapper.java
NodeWrapper.expandString
private String expandString() { final FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.SMALL); try { final INodeReadTrx rtx = createRtxAndMove(); final FilterAxis axis = new FilterAxis(new DescendantAxis(rtx), rtx, new TextFilter(rtx)); while (axis.hasNex...
java
private String expandString() { final FastStringBuffer fsb = new FastStringBuffer(FastStringBuffer.SMALL); try { final INodeReadTrx rtx = createRtxAndMove(); final FilterAxis axis = new FilterAxis(new DescendantAxis(rtx), rtx, new TextFilter(rtx)); while (axis.hasNex...
[ "private", "String", "expandString", "(", ")", "{", "final", "FastStringBuffer", "fsb", "=", "new", "FastStringBuffer", "(", "FastStringBuffer", ".", "SMALL", ")", ";", "try", "{", "final", "INodeReadTrx", "rtx", "=", "createRtxAndMove", "(", ")", ";", "final"...
Filter text nodes. @return concatenated String of text treeData values.
[ "Filter", "text", "nodes", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/saxon/src/main/java/org/treetank/saxon/wrapper/NodeWrapper.java#L511-L528
train
sebastiangraf/treetank
interfacemodules/saxon/src/main/java/org/treetank/saxon/wrapper/NodeWrapper.java
NodeWrapper.getTypeAnnotation
public int getTypeAnnotation() { int type = 0; if (nodeKind == ATTRIBUTE) { type = StandardNames.XS_UNTYPED_ATOMIC; } else { type = StandardNames.XS_UNTYPED; } return type; }
java
public int getTypeAnnotation() { int type = 0; if (nodeKind == ATTRIBUTE) { type = StandardNames.XS_UNTYPED_ATOMIC; } else { type = StandardNames.XS_UNTYPED; } return type; }
[ "public", "int", "getTypeAnnotation", "(", ")", "{", "int", "type", "=", "0", ";", "if", "(", "nodeKind", "==", "ATTRIBUTE", ")", "{", "type", "=", "StandardNames", ".", "XS_UNTYPED_ATOMIC", ";", "}", "else", "{", "type", "=", "StandardNames", ".", "XS_U...
Get the type annotation. @return UNTYPED or UNTYPED_ATOMIC.
[ "Get", "the", "type", "annotation", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/saxon/src/main/java/org/treetank/saxon/wrapper/NodeWrapper.java#L543-L551
train
centic9/commons-dost
src/main/java/org/dstadler/commons/zip/ZipFileWalker.java
ZipFileWalker.walk
public boolean walk(OutputHandler outputHandler) throws IOException { try (ZipFile zipFile = new ZipFile(zip)) { // walk all entries and look for matches Enumeration<? extends ZipEntry> entries = zipFile.entries(); while(entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); // first c...
java
public boolean walk(OutputHandler outputHandler) throws IOException { try (ZipFile zipFile = new ZipFile(zip)) { // walk all entries and look for matches Enumeration<? extends ZipEntry> entries = zipFile.entries(); while(entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); // first c...
[ "public", "boolean", "walk", "(", "OutputHandler", "outputHandler", ")", "throws", "IOException", "{", "try", "(", "ZipFile", "zipFile", "=", "new", "ZipFile", "(", "zip", ")", ")", "{", "// walk all entries and look for matches", "Enumeration", "<", "?", "extends...
Run the ZipFileWalker using the given OutputHandler @param outputHandler For every file that is found in the Zip-file, the method found() in the {@link OutputHandler} is invoked. @return true if processing was stopped because of a found file, false if no file was found or the {@link OutputHandler} did not return true...
[ "Run", "the", "ZipFileWalker", "using", "the", "given", "OutputHandler" ]
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/zip/ZipFileWalker.java#L38-L62
train
Bedework/bw-util
bw-util-servlet-filters/src/main/java/org/bedework/util/servlet/filters/ConfiguredXSLTFilter.java
ConfiguredXSLTFilter.updateConfigInfo
public void updateConfigInfo(final HttpServletRequest request, final XSLTConfig xcfg) throws ServletException { PresentationState ps = getPresentationState(request); if (ps == null) { // Still can't do a thing return; } if (xcfg.nextCfg == null) { ...
java
public void updateConfigInfo(final HttpServletRequest request, final XSLTConfig xcfg) throws ServletException { PresentationState ps = getPresentationState(request); if (ps == null) { // Still can't do a thing return; } if (xcfg.nextCfg == null) { ...
[ "public", "void", "updateConfigInfo", "(", "final", "HttpServletRequest", "request", ",", "final", "XSLTConfig", "xcfg", ")", "throws", "ServletException", "{", "PresentationState", "ps", "=", "getPresentationState", "(", "request", ")", ";", "if", "(", "ps", "=="...
This method can be overridden to allow a subclass to set up ready for a transformation. <p>The default action provided here is to locate the PresentatoinState object in the session and use that to configure the filter. @param request Incoming HttpServletRequest object @param xcfg XSLTConfig Our globals. ...
[ "This", "method", "can", "be", "overridden", "to", "allow", "a", "subclass", "to", "set", "up", "ready", "for", "a", "transformation", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet-filters/src/main/java/org/bedework/util/servlet/filters/ConfiguredXSLTFilter.java#L165-L258
train
Bedework/bw-util
bw-util-servlet-filters/src/main/java/org/bedework/util/servlet/filters/ConfiguredXSLTFilter.java
ConfiguredXSLTFilter.getPresentationState
protected PresentationState getPresentationState(HttpServletRequest request) { String attrName = getPresentationAttrName(); if ((attrName == null) || (attrName.equals("NONE"))) { return null; } /* First try the request */ Object o = request.getAttribute(attrName); if (o == nul...
java
protected PresentationState getPresentationState(HttpServletRequest request) { String attrName = getPresentationAttrName(); if ((attrName == null) || (attrName.equals("NONE"))) { return null; } /* First try the request */ Object o = request.getAttribute(attrName); if (o == nul...
[ "protected", "PresentationState", "getPresentationState", "(", "HttpServletRequest", "request", ")", "{", "String", "attrName", "=", "getPresentationAttrName", "(", ")", ";", "if", "(", "(", "attrName", "==", "null", ")", "||", "(", "attrName", ".", "equals", "(...
Obtain the presentation state from the session. Override if you want different behaviour. @param request @return PresentationState
[ "Obtain", "the", "presentation", "state", "from", "the", "session", ".", "Override", "if", "you", "want", "different", "behaviour", "." ]
f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-servlet-filters/src/main/java/org/bedework/util/servlet/filters/ConfiguredXSLTFilter.java#L277-L310
train