id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
41,700
probedock/probedock-java
src/main/java/io/probedock/client/common/config/Configuration.java
Configuration.readUid
private String readUid(File uidFile) { String uid = null; // Try to read the shared UID try (BufferedReader br = new BufferedReader(new FileReader(uidFile))) { String line; while ((line = br.readLine()) != null) { uid = line; } } catc...
java
private String readUid(File uidFile) { String uid = null; // Try to read the shared UID try (BufferedReader br = new BufferedReader(new FileReader(uidFile))) { String line; while ((line = br.readLine()) != null) { uid = line; } } catc...
[ "private", "String", "readUid", "(", "File", "uidFile", ")", "{", "String", "uid", "=", "null", ";", "// Try to read the shared UID", "try", "(", "BufferedReader", "br", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "uidFile", ")", ")", ")", "...
Read a UID file @param uidFile The UID file to read @return The UID read
[ "Read", "a", "UID", "file" ]
92ee6634ba4fe3fdffeb4e202f5372ef947a67c3
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/config/Configuration.java#L450-L464
41,701
aoindustries/aocode-public
src/main/java/com/aoindustries/version/Version.java
Version.getInstance
public static Version getInstance( int major, int minor, int release, int build ) { return new Version(major, minor, release, build); }
java
public static Version getInstance( int major, int minor, int release, int build ) { return new Version(major, minor, release, build); }
[ "public", "static", "Version", "getInstance", "(", "int", "major", ",", "int", "minor", ",", "int", "release", ",", "int", "build", ")", "{", "return", "new", "Version", "(", "major", ",", "minor", ",", "release", ",", "build", ")", ";", "}" ]
Gets a version number instance from its component parts.
[ "Gets", "a", "version", "number", "instance", "from", "its", "component", "parts", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/version/Version.java#L37-L44
41,702
aoindustries/aocode-public
src/main/java/com/aoindustries/version/Version.java
Version.valueOf
public static Version valueOf(String version) throws IllegalArgumentException { NullArgumentException.checkNotNull(version, "version"); int dot1Pos = version.indexOf('.'); if(dot1Pos==-1) throw new IllegalArgumentException(version); int dot2Pos = version.indexOf('.', dot1Pos+1); if(dot2Pos==-1) throw new Ille...
java
public static Version valueOf(String version) throws IllegalArgumentException { NullArgumentException.checkNotNull(version, "version"); int dot1Pos = version.indexOf('.'); if(dot1Pos==-1) throw new IllegalArgumentException(version); int dot2Pos = version.indexOf('.', dot1Pos+1); if(dot2Pos==-1) throw new Ille...
[ "public", "static", "Version", "valueOf", "(", "String", "version", ")", "throws", "IllegalArgumentException", "{", "NullArgumentException", ".", "checkNotNull", "(", "version", ",", "\"version\"", ")", ";", "int", "dot1Pos", "=", "version", ".", "indexOf", "(", ...
Parses a version number from its string representation. @see #toString()
[ "Parses", "a", "version", "number", "from", "its", "string", "representation", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/version/Version.java#L51-L65
41,703
NessComputing/components-ness-config
src/main/java/com/nesscomputing/config/Config.java
Config.getConfig
public static Config getConfig() { final Configuration systemConfig = new SystemConfiguration(); final String configName = systemConfig.getString(CONFIG_PROPERTY_NAME); final String configLocation = systemConfig.getString(CONFIG_LOCATION_PROPERTY_NAME); Preconditions.checkState(confi...
java
public static Config getConfig() { final Configuration systemConfig = new SystemConfiguration(); final String configName = systemConfig.getString(CONFIG_PROPERTY_NAME); final String configLocation = systemConfig.getString(CONFIG_LOCATION_PROPERTY_NAME); Preconditions.checkState(confi...
[ "public", "static", "Config", "getConfig", "(", ")", "{", "final", "Configuration", "systemConfig", "=", "new", "SystemConfiguration", "(", ")", ";", "final", "String", "configName", "=", "systemConfig", ".", "getString", "(", "CONFIG_PROPERTY_NAME", ")", ";", "...
Loads the configuration. The no-args method uses system properties to determine which configurations to load. -Dness.config=x/y/z defines a hierarchy of configurations from general to detail. The ness.config.location variable must be set. If the ness.config variable is unset, the default value "default" is used. @th...
[ "Loads", "the", "configuration", ".", "The", "no", "-", "args", "method", "uses", "system", "properties", "to", "determine", "which", "configurations", "to", "load", "." ]
eb9b37327a9e612a097f1258eb09d288f475e2cb
https://github.com/NessComputing/components-ness-config/blob/eb9b37327a9e612a097f1258eb09d288f475e2cb/src/main/java/com/nesscomputing/config/Config.java#L143-L151
41,704
NessComputing/components-ness-config
src/main/java/com/nesscomputing/config/Config.java
Config.getConfig
public static Config getConfig(@Nonnull final URI configLocation, @Nullable final String configName) { final ConfigFactory configFactory = new ConfigFactory(configLocation, configName); return new Config(configFactory.load()); }
java
public static Config getConfig(@Nonnull final URI configLocation, @Nullable final String configName) { final ConfigFactory configFactory = new ConfigFactory(configLocation, configName); return new Config(configFactory.load()); }
[ "public", "static", "Config", "getConfig", "(", "@", "Nonnull", "final", "URI", "configLocation", ",", "@", "Nullable", "final", "String", "configName", ")", "{", "final", "ConfigFactory", "configFactory", "=", "new", "ConfigFactory", "(", "configLocation", ",", ...
Load Configuration, using the supplied URI as base. The loaded configuration can be overridden using system properties.
[ "Load", "Configuration", "using", "the", "supplied", "URI", "as", "base", ".", "The", "loaded", "configuration", "can", "be", "overridden", "using", "system", "properties", "." ]
eb9b37327a9e612a097f1258eb09d288f475e2cb
https://github.com/NessComputing/components-ness-config/blob/eb9b37327a9e612a097f1258eb09d288f475e2cb/src/main/java/com/nesscomputing/config/Config.java#L157-L161
41,705
NessComputing/components-ness-config
src/main/java/com/nesscomputing/config/Config.java
Config.getOverriddenConfig
public static Config getOverriddenConfig(@Nonnull final Config config, @Nullable final AbstractConfiguration ... overrideConfigurations) { if (overrideConfigurations == null || overrideConfigurations.length == 0) { return config; } final CombinedConfiguration cc = new CombinedCo...
java
public static Config getOverriddenConfig(@Nonnull final Config config, @Nullable final AbstractConfiguration ... overrideConfigurations) { if (overrideConfigurations == null || overrideConfigurations.length == 0) { return config; } final CombinedConfiguration cc = new CombinedCo...
[ "public", "static", "Config", "getOverriddenConfig", "(", "@", "Nonnull", "final", "Config", "config", ",", "@", "Nullable", "final", "AbstractConfiguration", "...", "overrideConfigurations", ")", "{", "if", "(", "overrideConfigurations", "==", "null", "||", "overri...
Create a new configuration object from an existing object using overrides. If no overrides are passed in, the same object is returned. the
[ "Create", "a", "new", "configuration", "object", "from", "an", "existing", "object", "using", "overrides", ".", "If", "no", "overrides", "are", "passed", "in", "the", "same", "object", "is", "returned", "." ]
eb9b37327a9e612a097f1258eb09d288f475e2cb
https://github.com/NessComputing/components-ness-config/blob/eb9b37327a9e612a097f1258eb09d288f475e2cb/src/main/java/com/nesscomputing/config/Config.java#L168-L213
41,706
attribyte/metrics-reporting
src/main/java/org/attribyte/metrics/Reporting.java
Reporting.start
public int start() throws Exception { if(isStarted.compareAndSet(false, true)) { try { for(Reporter reporter : reporters) { reporter.start(); } } catch(Exception e) { stop(); throw e; } } return reporters.size();...
java
public int start() throws Exception { if(isStarted.compareAndSet(false, true)) { try { for(Reporter reporter : reporters) { reporter.start(); } } catch(Exception e) { stop(); throw e; } } return reporters.size();...
[ "public", "int", "start", "(", ")", "throws", "Exception", "{", "if", "(", "isStarted", ".", "compareAndSet", "(", "false", ",", "true", ")", ")", "{", "try", "{", "for", "(", "Reporter", "reporter", ":", "reporters", ")", "{", "reporter", ".", "start"...
Starts all reporters. @return The number of configured reporters. @throws Exception on start error.
[ "Starts", "all", "reporters", "." ]
f7420264cc124598dc93aedbd902267dab2d1c02
https://github.com/attribyte/metrics-reporting/blob/f7420264cc124598dc93aedbd902267dab2d1c02/src/main/java/org/attribyte/metrics/Reporting.java#L88-L100
41,707
attribyte/metrics-reporting
src/main/java/org/attribyte/metrics/Reporting.java
Reporting.stop
public void stop() { if(isStarted.compareAndSet(true, false)) { for(Reporter reporter : reporters) { reporter.stop(); } } }
java
public void stop() { if(isStarted.compareAndSet(true, false)) { for(Reporter reporter : reporters) { reporter.stop(); } } }
[ "public", "void", "stop", "(", ")", "{", "if", "(", "isStarted", ".", "compareAndSet", "(", "true", ",", "false", ")", ")", "{", "for", "(", "Reporter", "reporter", ":", "reporters", ")", "{", "reporter", ".", "stop", "(", ")", ";", "}", "}", "}" ]
Stops all reporting.
[ "Stops", "all", "reporting", "." ]
f7420264cc124598dc93aedbd902267dab2d1c02
https://github.com/attribyte/metrics-reporting/blob/f7420264cc124598dc93aedbd902267dab2d1c02/src/main/java/org/attribyte/metrics/Reporting.java#L105-L111
41,708
bremersee/sms
src/main/java/org/bremersee/sms/ExtensionUtils.java
ExtensionUtils.xmlNodeToObject
public static <T> T xmlNodeToObject(final Node node, final Class<T> valueType, final JAXBContext jaxbContext) throws JAXBException { if (node == null) { return null; } Validate.notNull(valueType, "valueType must not be null"); if (jaxbContext == null) { return valueType.cast(get...
java
public static <T> T xmlNodeToObject(final Node node, final Class<T> valueType, final JAXBContext jaxbContext) throws JAXBException { if (node == null) { return null; } Validate.notNull(valueType, "valueType must not be null"); if (jaxbContext == null) { return valueType.cast(get...
[ "public", "static", "<", "T", ">", "T", "xmlNodeToObject", "(", "final", "Node", "node", ",", "final", "Class", "<", "T", ">", "valueType", ",", "final", "JAXBContext", "jaxbContext", ")", "throws", "JAXBException", "{", "if", "(", "node", "==", "null", ...
Transforms a XML node into an object. @param <T> the type parameter @param node the XML node @param valueType the class of the target object @param jaxbContext the {@link JAXBContext} (can be null) @return the target object @throws JAXBException if transformation fails
[ "Transforms", "a", "XML", "node", "into", "an", "object", "." ]
4e5e87ea98616dd316573b544f54cac56750d2f9
https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/ExtensionUtils.java#L109-L121
41,709
bremersee/sms
src/main/java/org/bremersee/sms/ExtensionUtils.java
ExtensionUtils.jsonMapToObject
public static <T> T jsonMapToObject(final Map<String, Object> map, final Class<T> valueType, final ObjectMapper objectMapper) throws IOException { if (map == null) { return null; } Validate.notNull(valueType, "valueType must not be null"); if (objectMapper == null) { return DEFAULT_OBJ...
java
public static <T> T jsonMapToObject(final Map<String, Object> map, final Class<T> valueType, final ObjectMapper objectMapper) throws IOException { if (map == null) { return null; } Validate.notNull(valueType, "valueType must not be null"); if (objectMapper == null) { return DEFAULT_OBJ...
[ "public", "static", "<", "T", ">", "T", "jsonMapToObject", "(", "final", "Map", "<", "String", ",", "Object", ">", "map", ",", "final", "Class", "<", "T", ">", "valueType", ",", "final", "ObjectMapper", "objectMapper", ")", "throws", "IOException", "{", ...
Transforms a JSON map into an object. @param <T> the type parameter @param map the JSON map @param valueType the class of the target object @param objectMapper the JSON object mapper (can be null) @return the target object @throws IOException if transformation fails
[ "Transforms", "a", "JSON", "map", "into", "an", "object", "." ]
4e5e87ea98616dd316573b544f54cac56750d2f9
https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/ExtensionUtils.java#L133-L144
41,710
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/ArraySet.java
ArraySet.fromArray
static <T> ArraySet<T> fromArray(List<T> aArray, Boolean aAllowDuplicates) { ArraySet<T> set = new ArraySet<>(); for (int i = 0, len = aArray.size(); i < len; i++) { set.add(aArray.get(i), aAllowDuplicates); } return set; }
java
static <T> ArraySet<T> fromArray(List<T> aArray, Boolean aAllowDuplicates) { ArraySet<T> set = new ArraySet<>(); for (int i = 0, len = aArray.size(); i < len; i++) { set.add(aArray.get(i), aAllowDuplicates); } return set; }
[ "static", "<", "T", ">", "ArraySet", "<", "T", ">", "fromArray", "(", "List", "<", "T", ">", "aArray", ",", "Boolean", "aAllowDuplicates", ")", "{", "ArraySet", "<", "T", ">", "set", "=", "new", "ArraySet", "<>", "(", ")", ";", "for", "(", "int", ...
Static method for creating ArraySet instances from an existing array.
[ "Static", "method", "for", "creating", "ArraySet", "instances", "from", "an", "existing", "array", "." ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/ArraySet.java#L40-L46
41,711
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/ArraySet.java
ArraySet.indexOf
Integer indexOf(T t) { if (t == null) { return null; } Integer i = _set.get(t); if (i == null) { return -1; } return i; }
java
Integer indexOf(T t) { if (t == null) { return null; } Integer i = _set.get(t); if (i == null) { return -1; } return i; }
[ "Integer", "indexOf", "(", "T", "t", ")", "{", "if", "(", "t", "==", "null", ")", "{", "return", "null", ";", "}", "Integer", "i", "=", "_set", ".", "get", "(", "t", ")", ";", "if", "(", "i", "==", "null", ")", "{", "return", "-", "1", ";",...
What is the index of the given string in the array? @param String aStr
[ "What", "is", "the", "index", "of", "the", "given", "string", "in", "the", "array?" ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/ArraySet.java#L100-L109
41,712
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/ArraySet.java
ArraySet.at
T at(Integer i) { if (i == null) { return null; } if (i >= _array.size()) { return null; } return _array.get(i); }
java
T at(Integer i) { if (i == null) { return null; } if (i >= _array.size()) { return null; } return _array.get(i); }
[ "T", "at", "(", "Integer", "i", ")", "{", "if", "(", "i", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "i", ">=", "_array", ".", "size", "(", ")", ")", "{", "return", "null", ";", "}", "return", "_array", ".", "get", "(", ...
What is the element at the given index? @param Number aIdx
[ "What", "is", "the", "element", "at", "the", "given", "index?" ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/ArraySet.java#L117-L125
41,713
aoindustries/aocode-public
src/main/java/com/aoindustries/io/FifoFileInputStream.java
FifoFileInputStream.read
@Override public int read() throws IOException { // Read from the queue synchronized(file) { while(true) { long len=file.getLength(); if(len>=1) { long pos=file.getFirstIndex(); file.file.seek(pos+16); int b=file.file.read(); if(b==-1) throw new EOFException("Unexpected EOF"); a...
java
@Override public int read() throws IOException { // Read from the queue synchronized(file) { while(true) { long len=file.getLength(); if(len>=1) { long pos=file.getFirstIndex(); file.file.seek(pos+16); int b=file.file.read(); if(b==-1) throw new EOFException("Unexpected EOF"); a...
[ "@", "Override", "public", "int", "read", "(", ")", "throws", "IOException", "{", "// Read from the queue", "synchronized", "(", "file", ")", "{", "while", "(", "true", ")", "{", "long", "len", "=", "file", ".", "getLength", "(", ")", ";", "if", "(", "...
Reads data from the file, blocks until the data is available.
[ "Reads", "data", "from", "the", "file", "blocks", "until", "the", "data", "is", "available", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FifoFileInputStream.java#L78-L106
41,714
aoindustries/aocode-public
src/main/java/com/aoindustries/io/FifoFileInputStream.java
FifoFileInputStream.read
@Override public int read(byte[] b, int off, int len) throws IOException { // Read from the queue synchronized(file) { while(true) { long fileLen=file.getLength(); if(fileLen>=1) { long pos=file.getFirstIndex(); file.file.seek(pos+16); int readSize=fileLen>len?len:(int)fileLen; // Wh...
java
@Override public int read(byte[] b, int off, int len) throws IOException { // Read from the queue synchronized(file) { while(true) { long fileLen=file.getLength(); if(fileLen>=1) { long pos=file.getFirstIndex(); file.file.seek(pos+16); int readSize=fileLen>len?len:(int)fileLen; // Wh...
[ "@", "Override", "public", "int", "read", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "// Read from the queue", "synchronized", "(", "file", ")", "{", "while", "(", "true", ")", "{", "long", "fil...
Reads data from the file, blocks until at least one byte is available.
[ "Reads", "data", "from", "the", "file", "blocks", "until", "at", "least", "one", "byte", "is", "available", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FifoFileInputStream.java#L119-L152
41,715
aoindustries/aocode-public
src/main/java/com/aoindustries/io/FifoFileInputStream.java
FifoFileInputStream.skip
@Override public long skip(long n) throws IOException { // Skip in the queue synchronized(file) { while(true) { long fileLen=file.getLength(); if(fileLen>=1) { long pos=file.getFirstIndex(); long skipSize=fileLen>n?n:fileLen; // When at the end of the file, skip the remaining bytes i...
java
@Override public long skip(long n) throws IOException { // Skip in the queue synchronized(file) { while(true) { long fileLen=file.getLength(); if(fileLen>=1) { long pos=file.getFirstIndex(); long skipSize=fileLen>n?n:fileLen; // When at the end of the file, skip the remaining bytes i...
[ "@", "Override", "public", "long", "skip", "(", "long", "n", ")", "throws", "IOException", "{", "// Skip in the queue", "synchronized", "(", "file", ")", "{", "while", "(", "true", ")", "{", "long", "fileLen", "=", "file", ".", "getLength", "(", ")", ";"...
Skips data in the queue, blocks until at least one byte is skipped.
[ "Skips", "data", "in", "the", "queue", "blocks", "until", "at", "least", "one", "byte", "is", "skipped", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FifoFileInputStream.java#L157-L187
41,716
aoindustries/aocode-public
src/main/java/com/aoindustries/io/FifoFileInputStream.java
FifoFileInputStream.available
@Override public int available() throws IOException { synchronized(file) { long len=file.getLength(); return len>Integer.MAX_VALUE?Integer.MAX_VALUE:(int)len; } }
java
@Override public int available() throws IOException { synchronized(file) { long len=file.getLength(); return len>Integer.MAX_VALUE?Integer.MAX_VALUE:(int)len; } }
[ "@", "Override", "public", "int", "available", "(", ")", "throws", "IOException", "{", "synchronized", "(", "file", ")", "{", "long", "len", "=", "file", ".", "getLength", "(", ")", ";", "return", "len", ">", "Integer", ".", "MAX_VALUE", "?", "Integer", ...
Determines the number of bytes that may be read without blocking.
[ "Determines", "the", "number", "of", "bytes", "that", "may", "be", "read", "without", "blocking", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FifoFileInputStream.java#L192-L198
41,717
attribyte/metrics-reporting
src/main/java/org/attribyte/metrics/ReporterBase.java
ReporterBase.init
protected void init(final String name, final Properties props) { init = new InitUtil("", props, false); this.name = name; }
java
protected void init(final String name, final Properties props) { init = new InitUtil("", props, false); this.name = name; }
[ "protected", "void", "init", "(", "final", "String", "name", ",", "final", "Properties", "props", ")", "{", "init", "=", "new", "InitUtil", "(", "\"\"", ",", "props", ",", "false", ")", ";", "this", ".", "name", "=", "name", ";", "}" ]
Initialize the properties. @param name The instance name. @param props The properties.
[ "Initialize", "the", "properties", "." ]
f7420264cc124598dc93aedbd902267dab2d1c02
https://github.com/attribyte/metrics-reporting/blob/f7420264cc124598dc93aedbd902267dab2d1c02/src/main/java/org/attribyte/metrics/ReporterBase.java#L55-L58
41,718
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapConsumer.java
SourceMapConsumer.allGeneratedPositionsFor
public List<GeneratedPosition> allGeneratedPositionsFor(int line, Integer column, String source) { // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping // returns the index of the closest mapping less than the needle. By // setting needle.originalColumn to 0, we thus fi...
java
public List<GeneratedPosition> allGeneratedPositionsFor(int line, Integer column, String source) { // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping // returns the index of the closest mapping less than the needle. By // setting needle.originalColumn to 0, we thus fi...
[ "public", "List", "<", "GeneratedPosition", ">", "allGeneratedPositionsFor", "(", "int", "line", ",", "Integer", "column", ",", "String", "source", ")", "{", "// When there is no exact match, BasicSourceMapConsumer.prototype._findMapping", "// returns the index of the closest map...
Returns all generated line and column information for the original source, line, and column provided. If no column is provided, returns all mappings corresponding to a either the line we are searching for or the next closest line that has any mappings. Otherwise, returns all mappings corresponding to the given line and...
[ "Returns", "all", "generated", "line", "and", "column", "information", "for", "the", "original", "source", "line", "and", "column", "provided", ".", "If", "no", "column", "is", "provided", "returns", "all", "mappings", "corresponding", "to", "a", "either", "th...
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapConsumer.java#L236-L294
41,719
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapConsumer.java
SourceMapConsumer._findMapping
<T> int _findMapping(T aNeedle, List<T> aMappings, Object aLineName, Object aColumnName, BinarySearch.Comparator<T> aComparator, BinarySearch.Bias aBias) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite po...
java
<T> int _findMapping(T aNeedle, List<T> aMappings, Object aLineName, Object aColumnName, BinarySearch.Comparator<T> aComparator, BinarySearch.Bias aBias) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite po...
[ "<", "T", ">", "int", "_findMapping", "(", "T", "aNeedle", ",", "List", "<", "T", ">", "aMappings", ",", "Object", "aLineName", ",", "Object", "aColumnName", ",", "BinarySearch", ".", "Comparator", "<", "T", ">", "aComparator", ",", "BinarySearch", ".", ...
Find the mapping that best matches the hypothetical "needle" mapping that we are searching for in the given "haystack" of mappings.
[ "Find", "the", "mapping", "that", "best", "matches", "the", "hypothetical", "needle", "mapping", "that", "we", "are", "searching", "for", "in", "the", "given", "haystack", "of", "mappings", "." ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapConsumer.java#L299-L314
41,720
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/HTMLInputStreamPage.java
HTMLInputStreamPage.getHTMLInputStream
public static InputStream getHTMLInputStream(Class<?> clazz) throws IOException { return HTMLInputStreamPage.class.getResourceAsStream('/'+clazz.getName().replace('.', '/')+".html"); }
java
public static InputStream getHTMLInputStream(Class<?> clazz) throws IOException { return HTMLInputStreamPage.class.getResourceAsStream('/'+clazz.getName().replace('.', '/')+".html"); }
[ "public", "static", "InputStream", "getHTMLInputStream", "(", "Class", "<", "?", ">", "clazz", ")", "throws", "IOException", "{", "return", "HTMLInputStreamPage", ".", "class", ".", "getResourceAsStream", "(", "'", "'", "+", "clazz", ".", "getName", "(", ")", ...
Gets the HTML file with the same name as the provided Class.
[ "Gets", "the", "HTML", "file", "with", "the", "same", "name", "as", "the", "provided", "Class", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/HTMLInputStreamPage.java#L74-L76
41,721
probedock/probedock-java
src/main/java/io/probedock/client/core/storage/FileStore.java
FileStore.save
public void save(ProbeTestRun probeTestRun) throws IOException { OutputStreamWriter osw = new OutputStreamWriter( new FileOutputStream(new File(getTmpDir(probeTestRun), UUID.randomUUID().toString())), Charset.forName(Constants.ENCODING).newEncoder() ); serializer.serializePayload(osw, probeTestRun, true)...
java
public void save(ProbeTestRun probeTestRun) throws IOException { OutputStreamWriter osw = new OutputStreamWriter( new FileOutputStream(new File(getTmpDir(probeTestRun), UUID.randomUUID().toString())), Charset.forName(Constants.ENCODING).newEncoder() ); serializer.serializePayload(osw, probeTestRun, true)...
[ "public", "void", "save", "(", "ProbeTestRun", "probeTestRun", ")", "throws", "IOException", "{", "OutputStreamWriter", "osw", "=", "new", "OutputStreamWriter", "(", "new", "FileOutputStream", "(", "new", "File", "(", "getTmpDir", "(", "probeTestRun", ")", ",", ...
Save a payload @param probeTestRun The payload to save @throws IOException I/O Errors
[ "Save", "a", "payload" ]
92ee6634ba4fe3fdffeb4e202f5372ef947a67c3
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/core/storage/FileStore.java#L61-L68
41,722
aoindustries/ao-messaging-base
src/main/java/com/aoindustries/messaging/base/AbstractSocketContext.java
AbstractSocketContext.onClose
void onClose(AbstractSocket socket) { synchronized(sockets) { if(sockets.remove(socket.getId()) == null) throw new AssertionError("Socket not part of this context. onClose called twice?"); } }
java
void onClose(AbstractSocket socket) { synchronized(sockets) { if(sockets.remove(socket.getId()) == null) throw new AssertionError("Socket not part of this context. onClose called twice?"); } }
[ "void", "onClose", "(", "AbstractSocket", "socket", ")", "{", "synchronized", "(", "sockets", ")", "{", "if", "(", "sockets", ".", "remove", "(", "socket", ".", "getId", "(", ")", ")", "==", "null", ")", "throw", "new", "AssertionError", "(", "\"Socket n...
Called by a socket when it is closed. This will only be called once.
[ "Called", "by", "a", "socket", "when", "it", "is", "closed", ".", "This", "will", "only", "be", "called", "once", "." ]
77921e05e06cf7999f313755d0bff1cc8b6b0228
https://github.com/aoindustries/ao-messaging-base/blob/77921e05e06cf7999f313755d0bff1cc8b6b0228/src/main/java/com/aoindustries/messaging/base/AbstractSocketContext.java#L133-L137
41,723
aoindustries/ao-messaging-base
src/main/java/com/aoindustries/messaging/base/AbstractSocketContext.java
AbstractSocketContext.addSocket
protected void addSocket(final S newSocket) { if(isClosed()) throw new IllegalStateException("SocketContext is closed"); Future<?> future; synchronized(sockets) { Identifier id = newSocket.getId(); if(sockets.containsKey(id)) throw new IllegalStateException("Socket with the same ID has already been added");...
java
protected void addSocket(final S newSocket) { if(isClosed()) throw new IllegalStateException("SocketContext is closed"); Future<?> future; synchronized(sockets) { Identifier id = newSocket.getId(); if(sockets.containsKey(id)) throw new IllegalStateException("Socket with the same ID has already been added");...
[ "protected", "void", "addSocket", "(", "final", "S", "newSocket", ")", "{", "if", "(", "isClosed", "(", ")", ")", "throw", "new", "IllegalStateException", "(", "\"SocketContext is closed\"", ")", ";", "Future", "<", "?", ">", "future", ";", "synchronized", "...
Adds a new socket to this context, sockets must be added to the context before they create any of their own events. This gives context listeners a chance to register per-socket listeners in "onNewSocket". First, adds to the list of sockets. Second, calls all listeners notifying them of new socket. Third, waits for al...
[ "Adds", "a", "new", "socket", "to", "this", "context", "sockets", "must", "be", "added", "to", "the", "context", "before", "they", "create", "any", "of", "their", "own", "events", ".", "This", "gives", "context", "listeners", "a", "chance", "to", "register...
77921e05e06cf7999f313755d0bff1cc8b6b0228
https://github.com/aoindustries/ao-messaging-base/blob/77921e05e06cf7999f313755d0bff1cc8b6b0228/src/main/java/com/aoindustries/messaging/base/AbstractSocketContext.java#L222-L252
41,724
aoindustries/aocode-public
src/main/java/com/aoindustries/io/CompressedDataOutputStream.java
CompressedDataOutputStream.writeCompressedUTF
public void writeCompressedUTF(String str, int slot) throws IOException { if(slot<0 || slot>0x3f) throw new IOException("Slot out of range (0-63): "+slot); if(lastStrings==null) lastStrings=new String[64]; String last=lastStrings[slot]; if(last==null) last=""; int strLen=str.length(); int lastLen=last.lengt...
java
public void writeCompressedUTF(String str, int slot) throws IOException { if(slot<0 || slot>0x3f) throw new IOException("Slot out of range (0-63): "+slot); if(lastStrings==null) lastStrings=new String[64]; String last=lastStrings[slot]; if(last==null) last=""; int strLen=str.length(); int lastLen=last.lengt...
[ "public", "void", "writeCompressedUTF", "(", "String", "str", ",", "int", "slot", ")", "throws", "IOException", "{", "if", "(", "slot", "<", "0", "||", "slot", ">", "0x3f", ")", "throw", "new", "IOException", "(", "\"Slot out of range (0-63): \"", "+", "slot...
Writes a String to the stream while using prefix compression. <pre> The first byte has these bits: X X X X X X X X | | +-+-+-+-+-+ Slot number (0-63) | +------------ 1 = Suffix UTF follows, 0 = No suffix UTF exists +-------------- 1 = Common length difference follows, 0 = Common length not changed Second, if common ...
[ "Writes", "a", "String", "to", "the", "stream", "while", "using", "prefix", "compression", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/CompressedDataOutputStream.java#L123-L155
41,725
aoindustries/aocode-public
src/main/java/com/aoindustries/io/CompressedDataOutputStream.java
CompressedDataOutputStream.writeLongUTF
public void writeLongUTF(String str) throws IOException { int length = str.length(); writeCompressedInt(length); for(int position = 0; position<length; position+=20480) { int blockLength = length - position; if(blockLength>20480) blockLength = 20480; String block = str.substring(position, position+blockL...
java
public void writeLongUTF(String str) throws IOException { int length = str.length(); writeCompressedInt(length); for(int position = 0; position<length; position+=20480) { int blockLength = length - position; if(blockLength>20480) blockLength = 20480; String block = str.substring(position, position+blockL...
[ "public", "void", "writeLongUTF", "(", "String", "str", ")", "throws", "IOException", "{", "int", "length", "=", "str", ".", "length", "(", ")", ";", "writeCompressedInt", "(", "length", ")", ";", "for", "(", "int", "position", "=", "0", ";", "position",...
Writes a string of any length.
[ "Writes", "a", "string", "of", "any", "length", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/CompressedDataOutputStream.java#L165-L174
41,726
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/AutoListPage.java
AutoListPage.printPageList
public static void printPageList(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, WebPage[] pages, WebPageLayout layout) throws IOException, SQLException { int len = pages.length; for (int c = 0; c < len; c++) { WebPage page = pages[c]; out.print(" <tr>\n" + " <td style='white-space:now...
java
public static void printPageList(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, WebPage[] pages, WebPageLayout layout) throws IOException, SQLException { int len = pages.length; for (int c = 0; c < len; c++) { WebPage page = pages[c]; out.print(" <tr>\n" + " <td style='white-space:now...
[ "public", "static", "void", "printPageList", "(", "ChainWriter", "out", ",", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ",", "WebPage", "[", "]", "pages", ",", "WebPageLayout", "layout", ")", "throws", "IOException", ",", "SQLException", "{", "...
Prints a list of pages.
[ "Prints", "a", "list", "of", "pages", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/AutoListPage.java#L86-L97
41,727
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/AutoListPage.java
AutoListPage.printPageList
public static void printPageList(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, WebPage parent, WebPageLayout layout) throws IOException, SQLException { printPageList(out, req, resp, parent.getCachedPages(req), layout); }
java
public static void printPageList(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, WebPage parent, WebPageLayout layout) throws IOException, SQLException { printPageList(out, req, resp, parent.getCachedPages(req), layout); }
[ "public", "static", "void", "printPageList", "(", "ChainWriter", "out", ",", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ",", "WebPage", "parent", ",", "WebPageLayout", "layout", ")", "throws", "IOException", ",", "SQLException", "{", "printPageList...
Prints an unordered list of the available pages.
[ "Prints", "an", "unordered", "list", "of", "the", "available", "pages", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/AutoListPage.java#L102-L104
41,728
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java
MappingList.generatedPositionAfter
private boolean generatedPositionAfter(Mapping mappingA, Mapping mappingB) { // Optimized for most common case int lineA = mappingA.generated.line; int lineB = mappingB.generated.line; int columnA = mappingA.generated.column; int columnB = mappingB.generated.column; retur...
java
private boolean generatedPositionAfter(Mapping mappingA, Mapping mappingB) { // Optimized for most common case int lineA = mappingA.generated.line; int lineB = mappingB.generated.line; int columnA = mappingA.generated.column; int columnB = mappingB.generated.column; retur...
[ "private", "boolean", "generatedPositionAfter", "(", "Mapping", "mappingA", ",", "Mapping", "mappingB", ")", "{", "// Optimized for most common case", "int", "lineA", "=", "mappingA", ".", "generated", ".", "line", ";", "int", "lineB", "=", "mappingB", ".", "gener...
Determine whether mappingB is after mappingA with respect to generated position.
[ "Determine", "whether", "mappingB", "is", "after", "mappingA", "with", "respect", "to", "generated", "position", "." ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java#L32-L39
41,729
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java
MappingList.add
void add(Mapping aMapping) { if (generatedPositionAfter(this._last, aMapping)) { this._last = aMapping; this._array.add(aMapping); } else { this._sorted = false; this._array.add(aMapping); } }
java
void add(Mapping aMapping) { if (generatedPositionAfter(this._last, aMapping)) { this._last = aMapping; this._array.add(aMapping); } else { this._sorted = false; this._array.add(aMapping); } }
[ "void", "add", "(", "Mapping", "aMapping", ")", "{", "if", "(", "generatedPositionAfter", "(", "this", ".", "_last", ",", "aMapping", ")", ")", "{", "this", ".", "_last", "=", "aMapping", ";", "this", ".", "_array", ".", "add", "(", "aMapping", ")", ...
Add the given source mapping. @param Object aMapping
[ "Add", "the", "given", "source", "mapping", "." ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java#L69-L77
41,730
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java
MappingList.toArray
List<Mapping> toArray() { if (!this._sorted) { Collections.sort(this._array, Util::compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; }
java
List<Mapping> toArray() { if (!this._sorted) { Collections.sort(this._array, Util::compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; }
[ "List", "<", "Mapping", ">", "toArray", "(", ")", "{", "if", "(", "!", "this", ".", "_sorted", ")", "{", "Collections", ".", "sort", "(", "this", ".", "_array", ",", "Util", "::", "compareByGeneratedPositionsInflated", ")", ";", "this", ".", "_sorted", ...
Returns the flat, sorted array of mappings. The mappings are sorted by generated position. WARNING: This method returns internal data without copying, for performance. The return value must NOT be mutated, and should be treated as an immutable borrow. If you want to take ownership, you must make your own copy. @retur...
[ "Returns", "the", "flat", "sorted", "array", "of", "mappings", ".", "The", "mappings", "are", "sorted", "by", "generated", "position", "." ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/MappingList.java#L87-L93
41,731
aoindustries/aocode-public
src/main/java/com/aoindustries/sql/AOConnectionPool.java
AOConnectionPool.loadDriver
private static void loadDriver(String classname) throws ClassNotFoundException, InstantiationException, IllegalAccessException { if(!driversLoaded.containsKey(classname)) { Object O = Class.forName(classname).newInstance(); driversLoaded.putIfAbsent(classname, O); } }
java
private static void loadDriver(String classname) throws ClassNotFoundException, InstantiationException, IllegalAccessException { if(!driversLoaded.containsKey(classname)) { Object O = Class.forName(classname).newInstance(); driversLoaded.putIfAbsent(classname, O); } }
[ "private", "static", "void", "loadDriver", "(", "String", "classname", ")", "throws", "ClassNotFoundException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "if", "(", "!", "driversLoaded", ".", "containsKey", "(", "classname", ")", ")", "{", ...
Loads a driver at most once.
[ "Loads", "a", "driver", "at", "most", "once", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/sql/AOConnectionPool.java#L129-L134
41,732
aoindustries/aocode-public
src/main/java/com/aoindustries/util/persistent/FixedPersistentBlockBuffer.java
FixedPersistentBlockBuffer.ensureCapacity
@Override // @NotThreadSafe protected void ensureCapacity(long capacity) throws IOException { long curCapacity = pbuffer.capacity(); if(curCapacity<capacity) expandCapacity(curCapacity, capacity); }
java
@Override // @NotThreadSafe protected void ensureCapacity(long capacity) throws IOException { long curCapacity = pbuffer.capacity(); if(curCapacity<capacity) expandCapacity(curCapacity, capacity); }
[ "@", "Override", "// @NotThreadSafe", "protected", "void", "ensureCapacity", "(", "long", "capacity", ")", "throws", "IOException", "{", "long", "curCapacity", "=", "pbuffer", ".", "capacity", "(", ")", ";", "if", "(", "curCapacity", "<", "capacity", ")", "exp...
This class takes a lazy approach on allocating buffer space. It will allocate additional space as needed here, rounding up to the next 4096-byte boundary.
[ "This", "class", "takes", "a", "lazy", "approach", "on", "allocating", "buffer", "space", ".", "It", "will", "allocate", "additional", "space", "as", "needed", "here", "rounding", "up", "to", "the", "next", "4096", "-", "byte", "boundary", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/persistent/FixedPersistentBlockBuffer.java#L318-L323
41,733
aoindustries/aocode-public
src/main/java/com/aoindustries/io/ParallelDelete.java
ParallelDelete.getRelativePath
private static String getRelativePath(File file, FilesystemIterator iterator) throws IOException { String path = file.getPath(); String prefix = iterator.getStartPath(); if(!path.startsWith(prefix)) throw new IOException("path doesn't start with prefix: path=\""+path+"\", prefix=\""+prefix+"\""); return path.su...
java
private static String getRelativePath(File file, FilesystemIterator iterator) throws IOException { String path = file.getPath(); String prefix = iterator.getStartPath(); if(!path.startsWith(prefix)) throw new IOException("path doesn't start with prefix: path=\""+path+"\", prefix=\""+prefix+"\""); return path.su...
[ "private", "static", "String", "getRelativePath", "(", "File", "file", ",", "FilesystemIterator", "iterator", ")", "throws", "IOException", "{", "String", "path", "=", "file", ".", "getPath", "(", ")", ";", "String", "prefix", "=", "iterator", ".", "getStartPa...
Gets the relative path for the provided file from the provided iterator.
[ "Gets", "the", "relative", "path", "for", "the", "provided", "file", "from", "the", "provided", "iterator", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/ParallelDelete.java#L328-L333
41,734
attribyte/metrics-reporting
src/main/java/org/attribyte/metrics/newrelic/ScheduledNewRelicReporter.java
ScheduledNewRelicReporter.toLabel
private String toLabel(final TimeUnit unit) { switch(unit) { case DAYS: return "day"; case HOURS: return "hour"; case MINUTES: return "minute"; case SECONDS: return "second"; case MILLISECONDS: return "ms"; case MICROSECONDS: return "us"; case NANOSEC...
java
private String toLabel(final TimeUnit unit) { switch(unit) { case DAYS: return "day"; case HOURS: return "hour"; case MINUTES: return "minute"; case SECONDS: return "second"; case MILLISECONDS: return "ms"; case MICROSECONDS: return "us"; case NANOSEC...
[ "private", "String", "toLabel", "(", "final", "TimeUnit", "unit", ")", "{", "switch", "(", "unit", ")", "{", "case", "DAYS", ":", "return", "\"day\"", ";", "case", "HOURS", ":", "return", "\"hour\"", ";", "case", "MINUTES", ":", "return", "\"minute\"", "...
Converts a time unit to a label. @param unit The time unit. @return The label.
[ "Converts", "a", "time", "unit", "to", "a", "label", "." ]
f7420264cc124598dc93aedbd902267dab2d1c02
https://github.com/attribyte/metrics-reporting/blob/f7420264cc124598dc93aedbd902267dab2d1c02/src/main/java/org/attribyte/metrics/newrelic/ScheduledNewRelicReporter.java#L153-L164
41,735
aoindustries/ao-messaging-http-client
src/main/java/com/aoindustries/messaging/http/client/HttpSocketClient.java
HttpSocketClient.connect
public void connect( final String endpoint, final Callback<? super HttpSocket> onConnect, final Callback<? super Exception> onError ) { executors.getUnbounded().submit( new Runnable() { @Override public void run() { try { // Build request bytes AoByteArrayOutputStream bout = new AoB...
java
public void connect( final String endpoint, final Callback<? super HttpSocket> onConnect, final Callback<? super Exception> onError ) { executors.getUnbounded().submit( new Runnable() { @Override public void run() { try { // Build request bytes AoByteArrayOutputStream bout = new AoB...
[ "public", "void", "connect", "(", "final", "String", "endpoint", ",", "final", "Callback", "<", "?", "super", "HttpSocket", ">", "onConnect", ",", "final", "Callback", "<", "?", "super", "Exception", ">", "onError", ")", "{", "executors", ".", "getUnbounded"...
Asynchronously connects.
[ "Asynchronously", "connects", "." ]
37bb05ff06fc19622162d4671fb79d3fc4e969a3
https://github.com/aoindustries/ao-messaging-http-client/blob/37bb05ff06fc19622162d4671fb79d3fc4e969a3/src/main/java/com/aoindustries/messaging/http/client/HttpSocketClient.java#L65-L133
41,736
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/Base64VLQ.java
Base64VLQ.encode
static final String encode(int aValue) { String encoded = ""; int digit; int vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { // There are still more digits in this value, so we must...
java
static final String encode(int aValue) { String encoded = ""; int digit; int vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { // There are still more digits in this value, so we must...
[ "static", "final", "String", "encode", "(", "int", "aValue", ")", "{", "String", "encoded", "=", "\"\"", ";", "int", "digit", ";", "int", "vlq", "=", "toVLQSigned", "(", "aValue", ")", ";", "do", "{", "digit", "=", "vlq", "&", "VLQ_BASE_MASK", ";", "...
Returns the base 64 VLQ encoded value.
[ "Returns", "the", "base", "64", "VLQ", "encoded", "value", "." ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/Base64VLQ.java#L64-L82
41,737
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/Base64VLQ.java
Base64VLQ.decode
static Base64VLQResult decode(String aStr, int aIndex) { int strLen = aStr.length(); int result = 0; int shift = 0; boolean continuation; int digit; do { if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); ...
java
static Base64VLQResult decode(String aStr, int aIndex) { int strLen = aStr.length(); int result = 0; int shift = 0; boolean continuation; int digit; do { if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); ...
[ "static", "Base64VLQResult", "decode", "(", "String", "aStr", ",", "int", "aIndex", ")", "{", "int", "strLen", "=", "aStr", ".", "length", "(", ")", ";", "int", "result", "=", "0", ";", "int", "shift", "=", "0", ";", "boolean", "continuation", ";", "...
Decodes the next base 64 VLQ value from the given string and returns the value and the rest of the string via the out parameter. @return
[ "Decodes", "the", "next", "base", "64", "VLQ", "value", "from", "the", "given", "string", "and", "returns", "the", "value", "and", "the", "rest", "of", "the", "string", "via", "the", "out", "parameter", "." ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/Base64VLQ.java#L89-L113
41,738
aoindustries/semanticcms-core-model
src/main/java/com/semanticcms/core/model/Element.java
Element.generateIdPrefix
public static StringBuilder generateIdPrefix(String template, String prefix) { NullArgumentException.checkNotNull(template, "template"); NullArgumentException.checkNotNull(prefix, "prefix"); assert isValidId(prefix); final int len = template.length(); // First character must be [A-Za-z] int pos = 0; while...
java
public static StringBuilder generateIdPrefix(String template, String prefix) { NullArgumentException.checkNotNull(template, "template"); NullArgumentException.checkNotNull(prefix, "prefix"); assert isValidId(prefix); final int len = template.length(); // First character must be [A-Za-z] int pos = 0; while...
[ "public", "static", "StringBuilder", "generateIdPrefix", "(", "String", "template", ",", "String", "prefix", ")", "{", "NullArgumentException", ".", "checkNotNull", "(", "template", ",", "\"template\"", ")", ";", "NullArgumentException", ".", "checkNotNull", "(", "p...
Generates a valid ID from an arbitrary string. Strip all character not matching [A-Za-z][A-Za-z0-9:_.-]* Also converts characters to lower case. @param template The preferred text to base the id on @param prefix The base used when template is unusable (must be a valid id or invalid ID's may be generated) @see <...
[ "Generates", "a", "valid", "ID", "from", "an", "arbitrary", "string", "." ]
14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624
https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Element.java#L82-L136
41,739
aoindustries/semanticcms-core-model
src/main/java/com/semanticcms/core/model/Element.java
Element.setPage
void setPage(Page page) { synchronized(lock) { checkNotFrozen(); if(this.page != null) throw new IllegalStateException("element already has a page: " + this); this.page = page; } assert checkPageAndParentElement(); }
java
void setPage(Page page) { synchronized(lock) { checkNotFrozen(); if(this.page != null) throw new IllegalStateException("element already has a page: " + this); this.page = page; } assert checkPageAndParentElement(); }
[ "void", "setPage", "(", "Page", "page", ")", "{", "synchronized", "(", "lock", ")", "{", "checkNotFrozen", "(", ")", ";", "if", "(", "this", ".", "page", "!=", "null", ")", "throw", "new", "IllegalStateException", "(", "\"element already has a page: \"", "+"...
This is set when the element is associated with the page. @see Page#addElement(com.aoindustries.docs.Element)
[ "This", "is", "set", "when", "the", "element", "is", "associated", "with", "the", "page", "." ]
14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624
https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Element.java#L194-L201
41,740
aoindustries/semanticcms-core-model
src/main/java/com/semanticcms/core/model/Element.java
Element.getId
public String getId() { if(id == null) { synchronized(lock) { if(id == null) { if(page != null) { Map<String,Element> elementsById = page.getElementsById(); // Generate the ID now String template = getElementIdTemplate(); if(template == null) { throw new IllegalStateExceptio...
java
public String getId() { if(id == null) { synchronized(lock) { if(id == null) { if(page != null) { Map<String,Element> elementsById = page.getElementsById(); // Generate the ID now String template = getElementIdTemplate(); if(template == null) { throw new IllegalStateExceptio...
[ "public", "String", "getId", "(", ")", "{", "if", "(", "id", "==", "null", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "id", "==", "null", ")", "{", "if", "(", "page", "!=", "null", ")", "{", "Map", "<", "String", ",", "Element"...
When inside a page, every element must have a per-page unique ID, when one is not provided, it will be generated. When not inside a page, no missing ID is generated and it will remain null.
[ "When", "inside", "a", "page", "every", "element", "must", "have", "a", "per", "-", "page", "unique", "ID", "when", "one", "is", "not", "provided", "it", "will", "be", "generated", ".", "When", "not", "inside", "a", "page", "no", "missing", "ID", "is",...
14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624
https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Element.java#L214-L247
41,741
aoindustries/semanticcms-core-model
src/main/java/com/semanticcms/core/model/Element.java
Element.getElementRef
public ElementRef getElementRef() throws IllegalStateException { Page p = page; if(p == null) throw new IllegalStateException("page not set"); PageRef pageRef = p.getPageRef(); String i = getId(); if(i == null) throw new IllegalStateException("page not set so no id generated"); ElementRef er = elementRef; ...
java
public ElementRef getElementRef() throws IllegalStateException { Page p = page; if(p == null) throw new IllegalStateException("page not set"); PageRef pageRef = p.getPageRef(); String i = getId(); if(i == null) throw new IllegalStateException("page not set so no id generated"); ElementRef er = elementRef; ...
[ "public", "ElementRef", "getElementRef", "(", ")", "throws", "IllegalStateException", "{", "Page", "p", "=", "page", ";", "if", "(", "p", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"page not set\"", ")", ";", "PageRef", "pageRef", "=", ...
Gets an ElementRef for this element. Must have a page set. If id has not yet been set, one will be generated. @throws IllegalStateException if page not set
[ "Gets", "an", "ElementRef", "for", "this", "element", ".", "Must", "have", "a", "page", "set", ".", "If", "id", "has", "not", "yet", "been", "set", "one", "will", "be", "generated", "." ]
14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624
https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Element.java#L274-L291
41,742
aoindustries/semanticcms-core-model
src/main/java/com/semanticcms/core/model/Element.java
Element.setParentElement
private void setParentElement(Element parentElement) { synchronized(lock) { checkNotFrozen(); if(this.parentElement != null) throw new IllegalStateException("parentElement already set"); this.parentElement = parentElement; } assert checkPageAndParentElement(); }
java
private void setParentElement(Element parentElement) { synchronized(lock) { checkNotFrozen(); if(this.parentElement != null) throw new IllegalStateException("parentElement already set"); this.parentElement = parentElement; } assert checkPageAndParentElement(); }
[ "private", "void", "setParentElement", "(", "Element", "parentElement", ")", "{", "synchronized", "(", "lock", ")", "{", "checkNotFrozen", "(", ")", ";", "if", "(", "this", ".", "parentElement", "!=", "null", ")", "throw", "new", "IllegalStateException", "(", ...
Sets the parent element of this element.
[ "Sets", "the", "parent", "element", "of", "this", "element", "." ]
14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624
https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Element.java#L305-L312
41,743
aoindustries/semanticcms-core-model
src/main/java/com/semanticcms/core/model/Element.java
Element.addChildElement
@Override public Long addChildElement(Element childElement, ElementWriter elementWriter) { Long elementKey = super.addChildElement(childElement, elementWriter); childElement.setParentElement(this); return elementKey; }
java
@Override public Long addChildElement(Element childElement, ElementWriter elementWriter) { Long elementKey = super.addChildElement(childElement, elementWriter); childElement.setParentElement(this); return elementKey; }
[ "@", "Override", "public", "Long", "addChildElement", "(", "Element", "childElement", ",", "ElementWriter", "elementWriter", ")", "{", "Long", "elementKey", "=", "super", ".", "addChildElement", "(", "childElement", ",", "elementWriter", ")", ";", "childElement", ...
Adds a child element to this element.
[ "Adds", "a", "child", "element", "to", "this", "element", "." ]
14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624
https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Element.java#L329-L334
41,744
aoindustries/aocode-public
src/main/java/com/aoindustries/io/LoggingProxy.java
LoggingProxy.log
private static void log(File logFile, long connectionId, char separator, String line) { synchronized(logFile) { try { try (Writer out = new FileWriter(logFile, true)) { out.write(Long.toString(connectionId)); out.write(separator); out.write(' '); out.write(line); out.write('\n'); }...
java
private static void log(File logFile, long connectionId, char separator, String line) { synchronized(logFile) { try { try (Writer out = new FileWriter(logFile, true)) { out.write(Long.toString(connectionId)); out.write(separator); out.write(' '); out.write(line); out.write('\n'); }...
[ "private", "static", "void", "log", "(", "File", "logFile", ",", "long", "connectionId", ",", "char", "separator", ",", "String", "line", ")", "{", "synchronized", "(", "logFile", ")", "{", "try", "{", "try", "(", "Writer", "out", "=", "new", "FileWriter...
Writes one line to the given file, synchronizes on the file object.
[ "Writes", "one", "line", "to", "the", "given", "file", "synchronizes", "on", "the", "file", "object", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/LoggingProxy.java#L52-L66
41,745
HalBuilder/halbuilder-guava
src/main/java/com/theoryinpractise/halbuilder/guava/Representations.java
Representations.tryValue
public static Optional<Object> tryValue(ReadableRepresentation representation, String name) { try { return Optional.fromNullable(representation.getValue(name)); } catch (RepresentationException e) { return Optional.absent(); } }
java
public static Optional<Object> tryValue(ReadableRepresentation representation, String name) { try { return Optional.fromNullable(representation.getValue(name)); } catch (RepresentationException e) { return Optional.absent(); } }
[ "public", "static", "Optional", "<", "Object", ">", "tryValue", "(", "ReadableRepresentation", "representation", ",", "String", "name", ")", "{", "try", "{", "return", "Optional", ".", "fromNullable", "(", "representation", ".", "getValue", "(", "name", ")", "...
Returns a property from the Representation. @param name The property to return @return A Guava Optional for the property
[ "Returns", "a", "property", "from", "the", "Representation", "." ]
648cb1ae6c4b4cebd82364a8d72d9801bd3db771
https://github.com/HalBuilder/halbuilder-guava/blob/648cb1ae6c4b4cebd82364a8d72d9801bd3db771/src/main/java/com/theoryinpractise/halbuilder/guava/Representations.java#L90-L96
41,746
nlalevee/jsourcemap
jsourcemap/src/java/org/hibnet/jsourcemap/Util.java
Util.intcmp
private static final int intcmp(Integer i1, Integer i2) { if (i1 == null && i2 == null) { return 0; } if (i1 == null) { return -i2; } if (i2 == null) { return i1; } return i1 - i2; }
java
private static final int intcmp(Integer i1, Integer i2) { if (i1 == null && i2 == null) { return 0; } if (i1 == null) { return -i2; } if (i2 == null) { return i1; } return i1 - i2; }
[ "private", "static", "final", "int", "intcmp", "(", "Integer", "i1", ",", "Integer", "i2", ")", "{", "if", "(", "i1", "==", "null", "&&", "i2", "==", "null", ")", "{", "return", "0", ";", "}", "if", "(", "i1", "==", "null", ")", "{", "return", ...
mimic the behaviour of i1 - i2 in JS
[ "mimic", "the", "behaviour", "of", "i1", "-", "i2", "in", "JS" ]
361a99c73d51c11afa5579dd83d477c4d0345599
https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/Util.java#L220-L231
41,747
aoindustries/semanticcms-news-model
src/main/java/com/semanticcms/news/model/News.java
News.compareTo
@Override public int compareTo(News o) { int diff = o.getPubDate().compareTo(getPubDate()); if(diff != 0) return diff; return getPage().compareTo(o.getPage()); }
java
@Override public int compareTo(News o) { int diff = o.getPubDate().compareTo(getPubDate()); if(diff != 0) return diff; return getPage().compareTo(o.getPage()); }
[ "@", "Override", "public", "int", "compareTo", "(", "News", "o", ")", "{", "int", "diff", "=", "o", ".", "getPubDate", "(", ")", ".", "compareTo", "(", "getPubDate", "(", ")", ")", ";", "if", "(", "diff", "!=", "0", ")", "return", "diff", ";", "r...
Ordered by pubDate desc, page
[ "Ordered", "by", "pubDate", "desc", "page" ]
addcb3d4a112dabd4ccf02b8f2c9dd3343dbff23
https://github.com/aoindustries/semanticcms-news-model/blob/addcb3d4a112dabd4ccf02b8f2c9dd3343dbff23/src/main/java/com/semanticcms/news/model/News.java#L53-L58
41,748
NessComputing/components-ness-jmx
src/main/java/com/nesscomputing/jmx/starter/JmxExporterConfig.java
JmxExporterConfig.defaultJmxExporterConfig
public static JmxExporterConfig defaultJmxExporterConfig(final InetAddress hostname, final Integer rmiRegistryPort, final Integer rmiServerPort, final boolean useRandomIds) throws IOException { return new JmxExporterConfig( (hostname != null) ? hostname : InetAddress.getByName(null), ...
java
public static JmxExporterConfig defaultJmxExporterConfig(final InetAddress hostname, final Integer rmiRegistryPort, final Integer rmiServerPort, final boolean useRandomIds) throws IOException { return new JmxExporterConfig( (hostname != null) ? hostname : InetAddress.getByName(null), ...
[ "public", "static", "JmxExporterConfig", "defaultJmxExporterConfig", "(", "final", "InetAddress", "hostname", ",", "final", "Integer", "rmiRegistryPort", ",", "final", "Integer", "rmiServerPort", ",", "final", "boolean", "useRandomIds", ")", "throws", "IOException", "{"...
Creates a default configuration object. @param hostname The hostname to use. If null, the localhost is used. @param rmiRegistryPort The port for the JMX registry. This is where remote clients will connect to the MBean server. @param rmiServerPort The port for the JMX Server. If null, a random port is used. @param useR...
[ "Creates", "a", "default", "configuration", "object", "." ]
694e0f117e1579019df835528a150257b57330b4
https://github.com/NessComputing/components-ness-jmx/blob/694e0f117e1579019df835528a150257b57330b4/src/main/java/com/nesscomputing/jmx/starter/JmxExporterConfig.java#L43-L51
41,749
aoindustries/aocode-public
src/main/java/com/aoindustries/io/NativeToUnixWriter.java
NativeToUnixWriter.getInstance
public static Writer getInstance(Writer out) { // Already in Unix format, no conversion necessary if(UNIX_EOL.equals(EOL)) return out; // Use FindReplaceWriter return new FindReplaceWriter(out, EOL, UNIX_EOL); }
java
public static Writer getInstance(Writer out) { // Already in Unix format, no conversion necessary if(UNIX_EOL.equals(EOL)) return out; // Use FindReplaceWriter return new FindReplaceWriter(out, EOL, UNIX_EOL); }
[ "public", "static", "Writer", "getInstance", "(", "Writer", "out", ")", "{", "// Already in Unix format, no conversion necessary", "if", "(", "UNIX_EOL", ".", "equals", "(", "EOL", ")", ")", "return", "out", ";", "// Use FindReplaceWriter", "return", "new", "FindRep...
Gets an instance of the Writer that performs the conversion. The implementation may be optimized for common platforms.
[ "Gets", "an", "instance", "of", "the", "Writer", "that", "performs", "the", "conversion", ".", "The", "implementation", "may", "be", "optimized", "for", "common", "platforms", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/NativeToUnixWriter.java#L54-L59
41,750
aoindustries/aocode-public
src/main/java/com/aoindustries/awt/image/Images.java
Images.getRGB
public static int[] getRGB(BufferedImage image) { int[] pixels = getRGBArray(image); getRGB(image, pixels); return pixels; }
java
public static int[] getRGB(BufferedImage image) { int[] pixels = getRGBArray(image); getRGB(image, pixels); return pixels; }
[ "public", "static", "int", "[", "]", "getRGB", "(", "BufferedImage", "image", ")", "{", "int", "[", "]", "pixels", "=", "getRGBArray", "(", "image", ")", ";", "getRGB", "(", "image", ",", "pixels", ")", ";", "return", "pixels", ";", "}" ]
Gets the RGB pixels for the given image into a new array.
[ "Gets", "the", "RGB", "pixels", "for", "the", "given", "image", "into", "a", "new", "array", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/awt/image/Images.java#L66-L70
41,751
aoindustries/aocode-public
src/main/java/com/aoindustries/awt/image/Images.java
Images.getImageFromResources
public static Image getImageFromResources(Class<?> clazz, String name) throws IOException { return getImageFromResources(clazz, name, Toolkit.getDefaultToolkit()); }
java
public static Image getImageFromResources(Class<?> clazz, String name) throws IOException { return getImageFromResources(clazz, name, Toolkit.getDefaultToolkit()); }
[ "public", "static", "Image", "getImageFromResources", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ")", "throws", "IOException", "{", "return", "getImageFromResources", "(", "clazz", ",", "name", ",", "Toolkit", ".", "getDefaultToolkit", "(", "...
Loads an image from a resource using the default toolkit.
[ "Loads", "an", "image", "from", "a", "resource", "using", "the", "default", "toolkit", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/awt/image/Images.java#L170-L172
41,752
aoindustries/aocode-public
src/main/java/com/aoindustries/awt/image/Images.java
Images.getImageFromResources
public static Image getImageFromResources(Class<?> clazz, String name, Toolkit toolkit) throws IOException { byte[] imageData; InputStream in = clazz.getResourceAsStream(name); if(in==null) throw new IOException("Unable to find resource: "+name); try { imageData = IoUtils.readFully(in); } finally { in.c...
java
public static Image getImageFromResources(Class<?> clazz, String name, Toolkit toolkit) throws IOException { byte[] imageData; InputStream in = clazz.getResourceAsStream(name); if(in==null) throw new IOException("Unable to find resource: "+name); try { imageData = IoUtils.readFully(in); } finally { in.c...
[ "public", "static", "Image", "getImageFromResources", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Toolkit", "toolkit", ")", "throws", "IOException", "{", "byte", "[", "]", "imageData", ";", "InputStream", "in", "=", "clazz", ".", "ge...
Loads an image from a resource using the provided toolkit.
[ "Loads", "an", "image", "from", "a", "resource", "using", "the", "provided", "toolkit", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/awt/image/Images.java#L177-L187
41,753
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.printLoginForm
public void printLoginForm(WebPage page, LoginException loginException, WebSiteRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException { getParent().printLoginForm(page, loginException, req, resp); }
java
public void printLoginForm(WebPage page, LoginException loginException, WebSiteRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException { getParent().printLoginForm(page, loginException, req, resp); }
[ "public", "void", "printLoginForm", "(", "WebPage", "page", ",", "LoginException", "loginException", ",", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ")", "throws", "ServletException", ",", "IOException", ",", "SQLException", "{", "getParent", "(", ...
Prints the form that is used to login.
[ "Prints", "the", "form", "that", "is", "used", "to", "login", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L176-L178
41,754
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.printUnauthorizedPage
public void printUnauthorizedPage(WebPage page, WebSiteRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException { getParent().printUnauthorizedPage(page, req, resp); }
java
public void printUnauthorizedPage(WebPage page, WebSiteRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException { getParent().printUnauthorizedPage(page, req, resp); }
[ "public", "void", "printUnauthorizedPage", "(", "WebPage", "page", ",", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ")", "throws", "ServletException", ",", "IOException", ",", "SQLException", "{", "getParent", "(", ")", ".", "printUnauthorizedPage", ...
Prints the unauthorized page message.
[ "Prints", "the", "unauthorized", "page", "message", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L183-L185
41,755
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getClassLastModified
protected final long getClassLastModified() throws IOException, SQLException { String dir=getServletContext().getRealPath("/WEB-INF/classes"); if(dir!=null && dir.length()>0) { // Try to get from the class file long lastMod=new File(dir, getClass().getName().replace('.', File.separatorChar) + ".class").lastMo...
java
protected final long getClassLastModified() throws IOException, SQLException { String dir=getServletContext().getRealPath("/WEB-INF/classes"); if(dir!=null && dir.length()>0) { // Try to get from the class file long lastMod=new File(dir, getClass().getName().replace('.', File.separatorChar) + ".class").lastMo...
[ "protected", "final", "long", "getClassLastModified", "(", ")", "throws", "IOException", ",", "SQLException", "{", "String", "dir", "=", "getServletContext", "(", ")", ".", "getRealPath", "(", "\"/WEB-INF/classes\"", ")", ";", "if", "(", "dir", "!=", "null", "...
Gets the last modified time of the java class file. If the class file is unavailable, it defaults to the time the servlets were loaded. @see WebSiteFrameworkConfiguration#getServletDirectory @see ErrorReportingServlet#getUptime()
[ "Gets", "the", "last", "modified", "time", "of", "the", "java", "class", "file", ".", "If", "the", "class", "file", "is", "unavailable", "it", "defaults", "to", "the", "time", "the", "servlets", "were", "loaded", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L228-L236
41,756
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getWebPageAndChildrenLastModified
public long getWebPageAndChildrenLastModified(WebSiteRequest req) throws IOException, SQLException { WebPage[] myPages = getCachedPages(req); int len = myPages.length; long mostRecent = getClassLastModified(); if(mostRecent==-1) return -1; for (int c = 0; c < len; c++) { long time = myPages[c].getLastModif...
java
public long getWebPageAndChildrenLastModified(WebSiteRequest req) throws IOException, SQLException { WebPage[] myPages = getCachedPages(req); int len = myPages.length; long mostRecent = getClassLastModified(); if(mostRecent==-1) return -1; for (int c = 0; c < len; c++) { long time = myPages[c].getLastModif...
[ "public", "long", "getWebPageAndChildrenLastModified", "(", "WebSiteRequest", "req", ")", "throws", "IOException", ",", "SQLException", "{", "WebPage", "[", "]", "myPages", "=", "getCachedPages", "(", "req", ")", ";", "int", "len", "=", "myPages", ".", "length",...
Gets the most recent last modified time of this page and its immediate children.
[ "Gets", "the", "most", "recent", "last", "modified", "time", "of", "this", "page", "and", "its", "immediate", "children", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L241-L252
41,757
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getLastModifiedRecursive
final public long getLastModifiedRecursive(WebSiteRequest req) throws IOException, SQLException { long time=getLastModified(req); WebPage[] myPages=getCachedPages(req); int len=myPages.length; for(int c=0; c<len; c++) { long time2=myPages[c].getLastModifiedRecursive(req); if(time2>time) time=time2; } ...
java
final public long getLastModifiedRecursive(WebSiteRequest req) throws IOException, SQLException { long time=getLastModified(req); WebPage[] myPages=getCachedPages(req); int len=myPages.length; for(int c=0; c<len; c++) { long time2=myPages[c].getLastModifiedRecursive(req); if(time2>time) time=time2; } ...
[ "final", "public", "long", "getLastModifiedRecursive", "(", "WebSiteRequest", "req", ")", "throws", "IOException", ",", "SQLException", "{", "long", "time", "=", "getLastModified", "(", "req", ")", ";", "WebPage", "[", "]", "myPages", "=", "getCachedPages", "(",...
Recursively gets the most recent modification time.
[ "Recursively", "gets", "the", "most", "recent", "modification", "time", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L257-L266
41,758
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getLastModifiedRecursive
public static long getLastModifiedRecursive(File file) { long time=file.lastModified(); if(file.isDirectory()) { String[] list=file.list(); if(list!=null) { int len=list.length; for(int c=0; c<len; c++) { long time2=getLastModifiedRecursive(new File(file, list[c])); if (time2 > time) time=ti...
java
public static long getLastModifiedRecursive(File file) { long time=file.lastModified(); if(file.isDirectory()) { String[] list=file.list(); if(list!=null) { int len=list.length; for(int c=0; c<len; c++) { long time2=getLastModifiedRecursive(new File(file, list[c])); if (time2 > time) time=ti...
[ "public", "static", "long", "getLastModifiedRecursive", "(", "File", "file", ")", "{", "long", "time", "=", "file", ".", "lastModified", "(", ")", ";", "if", "(", "file", ".", "isDirectory", "(", ")", ")", "{", "String", "[", "]", "list", "=", "file", ...
Recursively gets the most recent modification time of a file or directory.
[ "Recursively", "gets", "the", "most", "recent", "modification", "time", "of", "a", "file", "or", "directory", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L271-L284
41,759
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.doGet
public void doGet( ChainWriter out, WebSiteRequest req, HttpServletResponse resp ) throws ServletException, IOException, SQLException { }
java
public void doGet( ChainWriter out, WebSiteRequest req, HttpServletResponse resp ) throws ServletException, IOException, SQLException { }
[ "public", "void", "doGet", "(", "ChainWriter", "out", ",", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ")", "throws", "ServletException", ",", "IOException", ",", "SQLException", "{", "}" ]
By default, GET provides no content. @param out the <code>ChainWriter</code> to send output to @param req the current <code>WebSiteRequest</code> @param resp the <code>HttpServletResponse</code> for this request, is <code>null</code> when searching
[ "By", "default", "GET", "provides", "no", "content", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L369-L374
41,760
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getRootPage
public final WebPage getRootPage() throws IOException, SQLException { WebPage page = this; WebPage parent; while ((parent = page.getParent()) != null) page = parent; return page; }
java
public final WebPage getRootPage() throws IOException, SQLException { WebPage page = this; WebPage parent; while ((parent = page.getParent()) != null) page = parent; return page; }
[ "public", "final", "WebPage", "getRootPage", "(", ")", "throws", "IOException", ",", "SQLException", "{", "WebPage", "page", "=", "this", ";", "WebPage", "parent", ";", "while", "(", "(", "parent", "=", "page", ".", "getParent", "(", ")", ")", "!=", "nul...
Gets the root page in the web page hierarchy. The root page has no parent.
[ "Gets", "the", "root", "page", "in", "the", "web", "page", "hierarchy", ".", "The", "root", "page", "has", "no", "parent", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L584-L589
41,761
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getNavImageURL
public String getNavImageURL(WebSiteRequest req, HttpServletResponse resp, Object params) throws IOException, SQLException { return resp.encodeURL(req.getContextPath()+req.getURL(this, params)); }
java
public String getNavImageURL(WebSiteRequest req, HttpServletResponse resp, Object params) throws IOException, SQLException { return resp.encodeURL(req.getContextPath()+req.getURL(this, params)); }
[ "public", "String", "getNavImageURL", "(", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ",", "Object", "params", ")", "throws", "IOException", ",", "SQLException", "{", "return", "resp", ".", "encodeURL", "(", "req", ".", "getContextPath", "(", "...
Gets the URL associated with a nav image. @see #getNavImageAlt @see #getNavImageSuffix
[ "Gets", "the", "URL", "associated", "with", "a", "nav", "image", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L674-L676
41,762
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getPageIndexInParent
final public int getPageIndexInParent(WebSiteRequest req) throws IOException, SQLException { WebPage[] myPages=getParent().getCachedPages(req); int len=myPages.length; for(int c=0;c<len;c++) if(myPages[c].equals(this)) return c; throw new RuntimeException("Unable to find page index in parent."); }
java
final public int getPageIndexInParent(WebSiteRequest req) throws IOException, SQLException { WebPage[] myPages=getParent().getCachedPages(req); int len=myPages.length; for(int c=0;c<len;c++) if(myPages[c].equals(this)) return c; throw new RuntimeException("Unable to find page index in parent."); }
[ "final", "public", "int", "getPageIndexInParent", "(", "WebSiteRequest", "req", ")", "throws", "IOException", ",", "SQLException", "{", "WebPage", "[", "]", "myPages", "=", "getParent", "(", ")", ".", "getCachedPages", "(", "req", ")", ";", "int", "len", "="...
Gets the index of this page in the parents list of children pages.
[ "Gets", "the", "index", "of", "this", "page", "in", "the", "parents", "list", "of", "children", "pages", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L681-L686
41,763
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.loadClass
public static Class<? extends WebPage> loadClass(String className) throws ClassNotFoundException { return Class.forName(className).asSubclass(WebPage.class); }
java
public static Class<? extends WebPage> loadClass(String className) throws ClassNotFoundException { return Class.forName(className).asSubclass(WebPage.class); }
[ "public", "static", "Class", "<", "?", "extends", "WebPage", ">", "loadClass", "(", "String", "className", ")", "throws", "ClassNotFoundException", "{", "return", "Class", ".", "forName", "(", "className", ")", ".", "asSubclass", "(", "WebPage", ".", "class", ...
Dynamically loads new classes based on the source .class file's modified time.
[ "Dynamically", "loads", "new", "classes", "based", "on", "the", "source", ".", "class", "file", "s", "modified", "time", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L923-L925
41,764
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPage.java
WebPage.getCopyright
public String getCopyright(WebSiteRequest req, HttpServletResponse resp, WebPage requestPage) throws IOException, SQLException { return getParent().getCopyright(req, resp, requestPage); }
java
public String getCopyright(WebSiteRequest req, HttpServletResponse resp, WebPage requestPage) throws IOException, SQLException { return getParent().getCopyright(req, resp, requestPage); }
[ "public", "String", "getCopyright", "(", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ",", "WebPage", "requestPage", ")", "throws", "IOException", ",", "SQLException", "{", "return", "getParent", "(", ")", ".", "getCopyright", "(", "req", ",", "r...
Gets the copyright information for this page. Defaults to the copyright of the parent page. // TODO: Use dcterms: http://stackoverflow.com/questions/6665312/is-the-copyright-meta-tag-valid-in-html5 https://wiki.whatwg.org/wiki/MetaExtensions http://dublincore.org/documents/dcmi-terms/
[ "Gets", "the", "copyright", "information", "for", "this", "page", ".", "Defaults", "to", "the", "copyright", "of", "the", "parent", "page", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L1241-L1243
41,765
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.join
public static String join(Iterable<?> objects, String delimiter) throws ConcurrentModificationException { int delimiterLength = delimiter.length(); // Find total length int totalLength = 0; boolean didOne = false; for(Object obj : objects) { if(didOne) totalLength += delimiterLength; else didOne = true;...
java
public static String join(Iterable<?> objects, String delimiter) throws ConcurrentModificationException { int delimiterLength = delimiter.length(); // Find total length int totalLength = 0; boolean didOne = false; for(Object obj : objects) { if(didOne) totalLength += delimiterLength; else didOne = true;...
[ "public", "static", "String", "join", "(", "Iterable", "<", "?", ">", "objects", ",", "String", "delimiter", ")", "throws", "ConcurrentModificationException", "{", "int", "delimiterLength", "=", "delimiter", ".", "length", "(", ")", ";", "// Find total length", ...
Joins the string representation of objects on the provided delimiter. The iteration will be performed twice. Once to compute the total length of the resulting string, and the second to build the result. @throws ConcurrentModificationException if iteration is not consistent between passes @see #join(java.lang.Iterab...
[ "Joins", "the", "string", "representation", "of", "objects", "on", "the", "provided", "delimiter", ".", "The", "iteration", "will", "be", "performed", "twice", ".", "Once", "to", "compute", "the", "total", "length", "of", "the", "resulting", "string", "and", ...
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L137-L157
41,766
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.join
public static <A extends Appendable> A join(Iterable<?> objects, String delimiter, A out) throws IOException { boolean didOne = false; for(Object obj : objects) { if(didOne) out.append(delimiter); else didOne = true; out.append(String.valueOf(obj)); } return out; }
java
public static <A extends Appendable> A join(Iterable<?> objects, String delimiter, A out) throws IOException { boolean didOne = false; for(Object obj : objects) { if(didOne) out.append(delimiter); else didOne = true; out.append(String.valueOf(obj)); } return out; }
[ "public", "static", "<", "A", "extends", "Appendable", ">", "A", "join", "(", "Iterable", "<", "?", ">", "objects", ",", "String", "delimiter", ",", "A", "out", ")", "throws", "IOException", "{", "boolean", "didOne", "=", "false", ";", "for", "(", "Obj...
Joins the string representation of objects on the provided delimiter. @see #join(java.lang.Iterable, java.lang.String) @see #join(java.lang.Object[], java.lang.String, java.lang.Appendable)
[ "Joins", "the", "string", "representation", "of", "objects", "on", "the", "provided", "delimiter", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L165-L173
41,767
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.compareToDDMMYYYY
public static int compareToDDMMYYYY(String date1, String date2) { if(date1.length()!=8 || date2.length()!=8) return 0; return compareToDDMMYYYY0(date1)-compareToDDMMYYYY0(date2); }
java
public static int compareToDDMMYYYY(String date1, String date2) { if(date1.length()!=8 || date2.length()!=8) return 0; return compareToDDMMYYYY0(date1)-compareToDDMMYYYY0(date2); }
[ "public", "static", "int", "compareToDDMMYYYY", "(", "String", "date1", ",", "String", "date2", ")", "{", "if", "(", "date1", ".", "length", "(", ")", "!=", "8", "||", "date2", ".", "length", "(", ")", "!=", "8", ")", "return", "0", ";", "return", ...
Compare one date to another, must be in the DDMMYYYY format. @return <0 if the first date is before the second<br> 0 if the dates are the same or the format is invalid<br> >0 if the first date is after the second
[ "Compare", "one", "date", "to", "another", "must", "be", "in", "the", "DDMMYYYY", "format", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L230-L233
41,768
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.indexOf
public static int indexOf(String S, char[] chars, int start) { int Slen=S.length(); int clen=chars.length; for(int c=start;c<Slen;c++) { char ch=S.charAt(c); for(int d=0;d<clen;d++) if(ch==chars[d]) return c; } return -1; }
java
public static int indexOf(String S, char[] chars, int start) { int Slen=S.length(); int clen=chars.length; for(int c=start;c<Slen;c++) { char ch=S.charAt(c); for(int d=0;d<clen;d++) if(ch==chars[d]) return c; } return -1; }
[ "public", "static", "int", "indexOf", "(", "String", "S", ",", "char", "[", "]", "chars", ",", "int", "start", ")", "{", "int", "Slen", "=", "S", ".", "length", "(", ")", ";", "int", "clen", "=", "chars", ".", "length", ";", "for", "(", "int", ...
Finds the first occurrence of any of the supplied characters starting at the specified index. @param S the <code>String</code> to search @param chars the characters to look for @param start the starting index. @return the index of the first occurrence of <code>-1</code> if none found
[ "Finds", "the", "first", "occurrence", "of", "any", "of", "the", "supplied", "characters", "starting", "at", "the", "specified", "index", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L633-L641
41,769
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.replace
public static String replace(final String string, final String find, final String replacement) { int pos = string.indexOf(find); //System.out.println(string+": "+find+" at "+pos); if (pos == -1) return string; StringBuilder SB = new StringBuilder(); int lastpos = 0; final int findLen = find.length(); do {...
java
public static String replace(final String string, final String find, final String replacement) { int pos = string.indexOf(find); //System.out.println(string+": "+find+" at "+pos); if (pos == -1) return string; StringBuilder SB = new StringBuilder(); int lastpos = 0; final int findLen = find.length(); do {...
[ "public", "static", "String", "replace", "(", "final", "String", "string", ",", "final", "String", "find", ",", "final", "String", "replacement", ")", "{", "int", "pos", "=", "string", ".", "indexOf", "(", "find", ")", ";", "//System.out.println(string+\": \"+...
Replaces all occurrences of a String with a String Please consider the variant with the Appendable for higher performance.
[ "Replaces", "all", "occurrences", "of", "a", "String", "with", "a", "String", "Please", "consider", "the", "variant", "with", "the", "Appendable", "for", "higher", "performance", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L714-L729
41,770
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.replace
public static void replace(final StringBuffer sb, final String find, final String replacement) { int pos = 0; while(pos<sb.length()) { pos = sb.indexOf(find, pos); if(pos==-1) break; sb.replace(pos, pos+find.length(), replacement); pos += replacement.length(); } }
java
public static void replace(final StringBuffer sb, final String find, final String replacement) { int pos = 0; while(pos<sb.length()) { pos = sb.indexOf(find, pos); if(pos==-1) break; sb.replace(pos, pos+find.length(), replacement); pos += replacement.length(); } }
[ "public", "static", "void", "replace", "(", "final", "StringBuffer", "sb", ",", "final", "String", "find", ",", "final", "String", "replacement", ")", "{", "int", "pos", "=", "0", ";", "while", "(", "pos", "<", "sb", ".", "length", "(", ")", ")", "{"...
Replaces all occurrences of a String with a String.
[ "Replaces", "all", "occurrences", "of", "a", "String", "with", "a", "String", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L756-L764
41,771
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.splitLines
public static List<String> splitLines(String S) { List<String> V=new ArrayList<>(); int start=0; int pos; while((pos=S.indexOf('\n', start))!=-1) { String line; if(pos>start && S.charAt(pos-1)=='\r') line = S.substring(start, pos-1); else line = S.substring(start, pos); V.add(line); start=pos+1; ...
java
public static List<String> splitLines(String S) { List<String> V=new ArrayList<>(); int start=0; int pos; while((pos=S.indexOf('\n', start))!=-1) { String line; if(pos>start && S.charAt(pos-1)=='\r') line = S.substring(start, pos-1); else line = S.substring(start, pos); V.add(line); start=pos+1; ...
[ "public", "static", "List", "<", "String", ">", "splitLines", "(", "String", "S", ")", "{", "List", "<", "String", ">", "V", "=", "new", "ArrayList", "<>", "(", ")", ";", "int", "start", "=", "0", ";", "int", "pos", ";", "while", "(", "(", "pos",...
Splits a String into lines on any '\n' characters. Also removes any ending '\r' characters if present
[ "Splits", "a", "String", "into", "lines", "on", "any", "\\", "n", "characters", ".", "Also", "removes", "any", "ending", "\\", "r", "characters", "if", "present" ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L782-L801
41,772
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.splitStringCommaSpace
public static List<String> splitStringCommaSpace(String line) { List<String> words=new ArrayList<>(); int len=line.length(); int pos=0; while(pos<len) { // Skip past blank space char ch; while(pos<len && ((ch=line.charAt(pos))<=' ' || ch==',')) pos++; int start=pos; // Skip to the next blank spac...
java
public static List<String> splitStringCommaSpace(String line) { List<String> words=new ArrayList<>(); int len=line.length(); int pos=0; while(pos<len) { // Skip past blank space char ch; while(pos<len && ((ch=line.charAt(pos))<=' ' || ch==',')) pos++; int start=pos; // Skip to the next blank spac...
[ "public", "static", "List", "<", "String", ">", "splitStringCommaSpace", "(", "String", "line", ")", "{", "List", "<", "String", ">", "words", "=", "new", "ArrayList", "<>", "(", ")", ";", "int", "len", "=", "line", ".", "length", "(", ")", ";", "int...
Splits a string into multiple words on either whitespace or commas @return java.lang.String[] @param line java.lang.String
[ "Splits", "a", "string", "into", "multiple", "words", "on", "either", "whitespace", "or", "commas" ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L987-L1001
41,773
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.convertToHex
public static void convertToHex(int value, Appendable out) throws IOException { out.append(getHexChar(value >>> 28)); out.append(getHexChar(value >>> 24)); out.append(getHexChar(value >>> 20)); out.append(getHexChar(value >>> 16)); out.append(getHexChar(value >>> 12)); out.append(getHexChar(value >>> 8)); ...
java
public static void convertToHex(int value, Appendable out) throws IOException { out.append(getHexChar(value >>> 28)); out.append(getHexChar(value >>> 24)); out.append(getHexChar(value >>> 20)); out.append(getHexChar(value >>> 16)); out.append(getHexChar(value >>> 12)); out.append(getHexChar(value >>> 8)); ...
[ "public", "static", "void", "convertToHex", "(", "int", "value", ",", "Appendable", "out", ")", "throws", "IOException", "{", "out", ".", "append", "(", "getHexChar", "(", "value", ">>>", "28", ")", ")", ";", "out", ".", "append", "(", "getHexChar", "(",...
Converts an int to a full 8-character hex code.
[ "Converts", "an", "int", "to", "a", "full", "8", "-", "character", "hex", "code", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1168-L1177
41,774
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.compareToIgnoreCaseCarefulEquals
public static int compareToIgnoreCaseCarefulEquals(String S1, String S2) { int diff=S1.compareToIgnoreCase(S2); if(diff==0) diff=S1.compareTo(S2); return diff; }
java
public static int compareToIgnoreCaseCarefulEquals(String S1, String S2) { int diff=S1.compareToIgnoreCase(S2); if(diff==0) diff=S1.compareTo(S2); return diff; }
[ "public", "static", "int", "compareToIgnoreCaseCarefulEquals", "(", "String", "S1", ",", "String", "S2", ")", "{", "int", "diff", "=", "S1", ".", "compareToIgnoreCase", "(", "S2", ")", ";", "if", "(", "diff", "==", "0", ")", "diff", "=", "S1", ".", "co...
Compares two strings in a case insensitive manner. However, if they are considered equals in the case-insensitive manner, the case sensitive comparison is done.
[ "Compares", "two", "strings", "in", "a", "case", "insensitive", "manner", ".", "However", "if", "they", "are", "considered", "equals", "in", "the", "case", "-", "insensitive", "manner", "the", "case", "sensitive", "comparison", "is", "done", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1345-L1349
41,775
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.indexOf
public static int indexOf(String source, String target, int fromIndex, int toIndex) { if(fromIndex>toIndex) throw new IllegalArgumentException("fromIndex>toIndex: fromIndex="+fromIndex+", toIndex="+toIndex); int sourceCount = source.length(); // This line makes it different than regular String indexOf method. ...
java
public static int indexOf(String source, String target, int fromIndex, int toIndex) { if(fromIndex>toIndex) throw new IllegalArgumentException("fromIndex>toIndex: fromIndex="+fromIndex+", toIndex="+toIndex); int sourceCount = source.length(); // This line makes it different than regular String indexOf method. ...
[ "public", "static", "int", "indexOf", "(", "String", "source", ",", "String", "target", ",", "int", "fromIndex", ",", "int", "toIndex", ")", "{", "if", "(", "fromIndex", ">", "toIndex", ")", "throw", "new", "IllegalArgumentException", "(", "\"fromIndex>toIndex...
Finds the next of a substring like regular String.indexOf, but stops at a certain maximum index. Like substring, will look up to the character one before toIndex.
[ "Finds", "the", "next", "of", "a", "substring", "like", "regular", "String", ".", "indexOf", "but", "stops", "at", "a", "certain", "maximum", "index", ".", "Like", "substring", "will", "look", "up", "to", "the", "character", "one", "before", "toIndex", "."...
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1365-L1411
41,776
aoindustries/aocode-public
src/main/java/com/aoindustries/util/StringUtility.java
StringUtility.nullIfEmpty
public static String nullIfEmpty(String value) { return value==null || value.isEmpty() ? null : value; }
java
public static String nullIfEmpty(String value) { return value==null || value.isEmpty() ? null : value; }
[ "public", "static", "String", "nullIfEmpty", "(", "String", "value", ")", "{", "return", "value", "==", "null", "||", "value", ".", "isEmpty", "(", ")", "?", "null", ":", "value", ";", "}" ]
Returns null if the string is null or empty.
[ "Returns", "null", "if", "the", "string", "is", "null", "or", "empty", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1428-L1430
41,777
aoindustries/aocode-public
src/main/java/com/aoindustries/util/UnionMethodSet.java
UnionMethodSet.isEmpty
@Override public boolean isEmpty() { for(List<? extends Method<? extends E>> methods : methodsByClass.values()) { for(Method<? extends E> method : methods) { E singleton = method.getSingleton(target); if(singleton!=null) return false; Set<? extends E> set = method.getSet(target); if(set!=null && !...
java
@Override public boolean isEmpty() { for(List<? extends Method<? extends E>> methods : methodsByClass.values()) { for(Method<? extends E> method : methods) { E singleton = method.getSingleton(target); if(singleton!=null) return false; Set<? extends E> set = method.getSet(target); if(set!=null && !...
[ "@", "Override", "public", "boolean", "isEmpty", "(", ")", "{", "for", "(", "List", "<", "?", "extends", "Method", "<", "?", "extends", "E", ">", ">", "methods", ":", "methodsByClass", ".", "values", "(", ")", ")", "{", "for", "(", "Method", "<", "...
Checks if this set is empty. This can be an expensive method since it can potentially call all methods.
[ "Checks", "if", "this", "set", "is", "empty", ".", "This", "can", "be", "an", "expensive", "method", "since", "it", "can", "potentially", "call", "all", "methods", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/UnionMethodSet.java#L204-L215
41,778
aoindustries/aocode-public
src/main/java/com/aoindustries/util/UnionClassSet.java
UnionClassSet.addAll
@Override @SuppressWarnings("unchecked") public boolean addAll(Collection<? extends E> c) { if(c.isEmpty()) return false; if(c instanceof Set) return addAll((Set<? extends E>)c); else throw new UnsupportedOperationException("May only add sets"); }
java
@Override @SuppressWarnings("unchecked") public boolean addAll(Collection<? extends E> c) { if(c.isEmpty()) return false; if(c instanceof Set) return addAll((Set<? extends E>)c); else throw new UnsupportedOperationException("May only add sets"); }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "boolean", "addAll", "(", "Collection", "<", "?", "extends", "E", ">", "c", ")", "{", "if", "(", "c", ".", "isEmpty", "(", ")", ")", "return", "false", ";", "if", "(", "c"...
Must be a set. @see #addAll(java.util.Set)
[ "Must", "be", "a", "set", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/UnionClassSet.java#L134-L140
41,779
aoindustries/aocode-public
src/main/java/com/aoindustries/io/TempFileList.java
TempFileList.createTempFile
public TempFile createTempFile() throws IOException { TempFile tempFile = new TempFile(prefix, suffix, directory); synchronized(tempFiles) { tempFiles.add(new WeakReference<>(tempFile)); } return tempFile; }
java
public TempFile createTempFile() throws IOException { TempFile tempFile = new TempFile(prefix, suffix, directory); synchronized(tempFiles) { tempFiles.add(new WeakReference<>(tempFile)); } return tempFile; }
[ "public", "TempFile", "createTempFile", "(", ")", "throws", "IOException", "{", "TempFile", "tempFile", "=", "new", "TempFile", "(", "prefix", ",", "suffix", ",", "directory", ")", ";", "synchronized", "(", "tempFiles", ")", "{", "tempFiles", ".", "add", "("...
Creates a new temp file while adding it to the list of files that will be explicitly deleted when this list is deleted.
[ "Creates", "a", "new", "temp", "file", "while", "adding", "it", "to", "the", "list", "of", "files", "that", "will", "be", "explicitly", "deleted", "when", "this", "list", "is", "deleted", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/TempFileList.java#L92-L98
41,780
aoindustries/aocode-public
src/main/java/com/aoindustries/io/TempFileList.java
TempFileList.delete
public void delete() throws IOException { synchronized(tempFiles) { for(WeakReference<TempFile> tempFileRef : tempFiles) { TempFile tempFile = tempFileRef.get(); if(tempFile!=null) tempFile.delete(); } tempFiles.clear(); } }
java
public void delete() throws IOException { synchronized(tempFiles) { for(WeakReference<TempFile> tempFileRef : tempFiles) { TempFile tempFile = tempFileRef.get(); if(tempFile!=null) tempFile.delete(); } tempFiles.clear(); } }
[ "public", "void", "delete", "(", ")", "throws", "IOException", "{", "synchronized", "(", "tempFiles", ")", "{", "for", "(", "WeakReference", "<", "TempFile", ">", "tempFileRef", ":", "tempFiles", ")", "{", "TempFile", "tempFile", "=", "tempFileRef", ".", "ge...
Deletes all of the underlying temp files immediately. This list may still be used for additional temp files. @see TempFile#delete()
[ "Deletes", "all", "of", "the", "underlying", "temp", "files", "immediately", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/TempFileList.java#L107-L115
41,781
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.getFileUploadDirectory
private static File getFileUploadDirectory(ServletContext servletContext) throws FileNotFoundException { File uploadDir = new File( (File)servletContext.getAttribute(ServletContext.TEMPDIR), "uploads" ); if( !uploadDir.exists() && !uploadDir.mkdirs() // Check exists again, another thread may have c...
java
private static File getFileUploadDirectory(ServletContext servletContext) throws FileNotFoundException { File uploadDir = new File( (File)servletContext.getAttribute(ServletContext.TEMPDIR), "uploads" ); if( !uploadDir.exists() && !uploadDir.mkdirs() // Check exists again, another thread may have c...
[ "private", "static", "File", "getFileUploadDirectory", "(", "ServletContext", "servletContext", ")", "throws", "FileNotFoundException", "{", "File", "uploadDir", "=", "new", "File", "(", "(", "File", ")", "servletContext", ".", "getAttribute", "(", "ServletContext", ...
Gets the upload directory.
[ "Gets", "the", "upload", "directory", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L66-L80
41,782
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.appendParams
protected static boolean appendParams(StringBuilder SB, Object optParam, List<String> finishedParams, boolean alreadyAppended) { if (optParam != null) { if (optParam instanceof String) { List<String> nameValuePairs=StringUtility.splitString((String)optParam, '&'); int len=nameValuePairs.size(); for(int...
java
protected static boolean appendParams(StringBuilder SB, Object optParam, List<String> finishedParams, boolean alreadyAppended) { if (optParam != null) { if (optParam instanceof String) { List<String> nameValuePairs=StringUtility.splitString((String)optParam, '&'); int len=nameValuePairs.size(); for(int...
[ "protected", "static", "boolean", "appendParams", "(", "StringBuilder", "SB", ",", "Object", "optParam", ",", "List", "<", "String", ">", "finishedParams", ",", "boolean", "alreadyAppended", ")", "{", "if", "(", "optParam", "!=", "null", ")", "{", "if", "(",...
Appends the parameters to a URL. Parameters should already be URL encoded but not XML encoded.
[ "Appends", "the", "parameters", "to", "a", "URL", ".", "Parameters", "should", "already", "be", "URL", "encoded", "but", "not", "XML", "encoded", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L310-L345
41,783
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.getURL
public String getURL(String classAndParams) throws IOException, SQLException { String className, params; int pos=classAndParams.indexOf('?'); if(pos==-1) { className=classAndParams; params=null; } else { className=classAndParams.substring(0, pos); params=classAndParams.substring(pos+1); } return...
java
public String getURL(String classAndParams) throws IOException, SQLException { String className, params; int pos=classAndParams.indexOf('?'); if(pos==-1) { className=classAndParams; params=null; } else { className=classAndParams.substring(0, pos); params=classAndParams.substring(pos+1); } return...
[ "public", "String", "getURL", "(", "String", "classAndParams", ")", "throws", "IOException", ",", "SQLException", "{", "String", "className", ",", "params", ";", "int", "pos", "=", "classAndParams", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "pos"...
Gets a relative URL from a String containing a classname and optional parameters. Parameters should already be URL encoded but not XML encoded.
[ "Gets", "a", "relative", "URL", "from", "a", "String", "containing", "a", "classname", "and", "optional", "parameters", ".", "Parameters", "should", "already", "be", "URL", "encoded", "but", "not", "XML", "encoded", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L351-L362
41,784
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.getURL
public String getURL(String classname, String params) throws IOException, SQLException { try { Class<? extends WebPage> clazz=Class.forName(classname).asSubclass(WebPage.class); return getURL(clazz, params); } catch(ClassNotFoundException err) { throw new IOException("Unable to load class: "+classname, err...
java
public String getURL(String classname, String params) throws IOException, SQLException { try { Class<? extends WebPage> clazz=Class.forName(classname).asSubclass(WebPage.class); return getURL(clazz, params); } catch(ClassNotFoundException err) { throw new IOException("Unable to load class: "+classname, err...
[ "public", "String", "getURL", "(", "String", "classname", ",", "String", "params", ")", "throws", "IOException", ",", "SQLException", "{", "try", "{", "Class", "<", "?", "extends", "WebPage", ">", "clazz", "=", "Class", ".", "forName", "(", "classname", ")...
Gets a relative URL given its classname and optional parameters. Parameters should already be URL encoded but not XML encoded.
[ "Gets", "a", "relative", "URL", "given", "its", "classname", "and", "optional", "parameters", ".", "Parameters", "should", "already", "be", "URL", "encoded", "but", "not", "XML", "encoded", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L368-L375
41,785
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.getURL
public String getURL(String url, Object optParam, boolean keepSettings) throws IOException { StringBuilder SB=new StringBuilder(); SB.append(url); List<String> finishedParams=new SortedArrayList<>(); boolean alreadyAppended=appendParams(SB, optParam, finishedParams, false); if(keepSettings) appendSettings(fin...
java
public String getURL(String url, Object optParam, boolean keepSettings) throws IOException { StringBuilder SB=new StringBuilder(); SB.append(url); List<String> finishedParams=new SortedArrayList<>(); boolean alreadyAppended=appendParams(SB, optParam, finishedParams, false); if(keepSettings) appendSettings(fin...
[ "public", "String", "getURL", "(", "String", "url", ",", "Object", "optParam", ",", "boolean", "keepSettings", ")", "throws", "IOException", "{", "StringBuilder", "SB", "=", "new", "StringBuilder", "(", ")", ";", "SB", ".", "append", "(", "url", ")", ";", ...
Gets the context-relative URL, optionally with the settings embedded. Parameters should already be URL encoded but not XML encoded. @param url the context-relative URL
[ "Gets", "the", "context", "-", "relative", "URL", "optionally", "with", "the", "settings", "embedded", ".", "Parameters", "should", "already", "be", "URL", "encoded", "but", "not", "XML", "encoded", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L383-L390
41,786
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.getURL
public String getURL(WebPage page) throws IOException, SQLException { return getURL(page, (Object)null); }
java
public String getURL(WebPage page) throws IOException, SQLException { return getURL(page, (Object)null); }
[ "public", "String", "getURL", "(", "WebPage", "page", ")", "throws", "IOException", ",", "SQLException", "{", "return", "getURL", "(", "page", ",", "(", "Object", ")", "null", ")", ";", "}" ]
Gets the context-relative URL to a web page.
[ "Gets", "the", "context", "-", "relative", "URL", "to", "a", "web", "page", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L424-L426
41,787
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.getURL
public String getURL(String url, Object optParam) throws IOException { return getURL(url, optParam, true); }
java
public String getURL(String url, Object optParam) throws IOException { return getURL(url, optParam, true); }
[ "public", "String", "getURL", "(", "String", "url", ",", "Object", "optParam", ")", "throws", "IOException", "{", "return", "getURL", "(", "url", ",", "optParam", ",", "true", ")", ";", "}" ]
Gets the URL String with the given parameters embedded, keeping the current settings. @param url the context-relative URL, with a beginning slash @param optParam any number of additional parameters. This parameter can accept several types of objects. The following is a list of supported objects an...
[ "Gets", "the", "URL", "String", "with", "the", "given", "parameters", "embedded", "keeping", "the", "current", "settings", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L477-L479
41,788
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.isLynx
public boolean isLynx() { if(!isLynxDone) { String agent = req.getHeader("user-agent"); isLynx=agent != null && agent.toLowerCase(Locale.ROOT).contains("lynx"); isLynxDone=true; } return isLynx; }
java
public boolean isLynx() { if(!isLynxDone) { String agent = req.getHeader("user-agent"); isLynx=agent != null && agent.toLowerCase(Locale.ROOT).contains("lynx"); isLynxDone=true; } return isLynx; }
[ "public", "boolean", "isLynx", "(", ")", "{", "if", "(", "!", "isLynxDone", ")", "{", "String", "agent", "=", "req", ".", "getHeader", "(", "\"user-agent\"", ")", ";", "isLynx", "=", "agent", "!=", "null", "&&", "agent", ".", "toLowerCase", "(", "Local...
Determines if the request is for a Lynx browser
[ "Determines", "if", "the", "request", "is", "for", "a", "Lynx", "browser" ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L484-L491
41,789
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.isBlackBerry
public boolean isBlackBerry() { if(!isBlackBerryDone) { String agent = req.getHeader("user-agent"); isBlackBerry=agent != null && agent.startsWith("BlackBerry"); isBlackBerryDone=true; } return isBlackBerry; }
java
public boolean isBlackBerry() { if(!isBlackBerryDone) { String agent = req.getHeader("user-agent"); isBlackBerry=agent != null && agent.startsWith("BlackBerry"); isBlackBerryDone=true; } return isBlackBerry; }
[ "public", "boolean", "isBlackBerry", "(", ")", "{", "if", "(", "!", "isBlackBerryDone", ")", "{", "String", "agent", "=", "req", ".", "getHeader", "(", "\"user-agent\"", ")", ";", "isBlackBerry", "=", "agent", "!=", "null", "&&", "agent", ".", "startsWith"...
Determines if the request is for a BlackBerry browser
[ "Determines", "if", "the", "request", "is", "for", "a", "BlackBerry", "browser" ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L496-L503
41,790
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebSiteRequest.java
WebSiteRequest.isLinux
public boolean isLinux() { if(!isLinuxDone) { String agent = req.getHeader("user-agent"); isLinux=agent == null || agent.toLowerCase(Locale.ROOT).contains("linux"); isLinuxDone=true; } return isLinux; }
java
public boolean isLinux() { if(!isLinuxDone) { String agent = req.getHeader("user-agent"); isLinux=agent == null || agent.toLowerCase(Locale.ROOT).contains("linux"); isLinuxDone=true; } return isLinux; }
[ "public", "boolean", "isLinux", "(", ")", "{", "if", "(", "!", "isLinuxDone", ")", "{", "String", "agent", "=", "req", ".", "getHeader", "(", "\"user-agent\"", ")", ";", "isLinux", "=", "agent", "==", "null", "||", "agent", ".", "toLowerCase", "(", "Lo...
Determines if the request is for a Linux browser
[ "Determines", "if", "the", "request", "is", "for", "a", "Linux", "browser" ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L508-L515
41,791
aoindustries/aocode-public
src/main/java/com/aoindustries/net/HttpParametersUtils.java
HttpParametersUtils.addParams
public static String addParams(String href, HttpParameters params, String encoding) throws UnsupportedEncodingException { if(params!=null) { StringBuilder sb = new StringBuilder(href); // First find any anchor and if has parameters int anchorStart = href.lastIndexOf('#'); String anchor; boolean hasQues...
java
public static String addParams(String href, HttpParameters params, String encoding) throws UnsupportedEncodingException { if(params!=null) { StringBuilder sb = new StringBuilder(href); // First find any anchor and if has parameters int anchorStart = href.lastIndexOf('#'); String anchor; boolean hasQues...
[ "public", "static", "String", "addParams", "(", "String", "href", ",", "HttpParameters", "params", ",", "String", "encoding", ")", "throws", "UnsupportedEncodingException", "{", "if", "(", "params", "!=", "null", ")", "{", "StringBuilder", "sb", "=", "new", "S...
Adds all of the parameters to a URL.
[ "Adds", "all", "of", "the", "parameters", "to", "a", "URL", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/net/HttpParametersUtils.java#L40-L72
41,792
inversoft/jackson5
src/main/java/com/inversoft/json/ToString.java
ToString.toJSONString
public static String toJSONString(Object o) { try { return objectMapper.writer().without(SerializationFeature.INDENT_OUTPUT).writeValueAsString(o); } catch (JsonProcessingException e) { throw new RuntimeException(e); } }
java
public static String toJSONString(Object o) { try { return objectMapper.writer().without(SerializationFeature.INDENT_OUTPUT).writeValueAsString(o); } catch (JsonProcessingException e) { throw new RuntimeException(e); } }
[ "public", "static", "String", "toJSONString", "(", "Object", "o", ")", "{", "try", "{", "return", "objectMapper", ".", "writer", "(", ")", ".", "without", "(", "SerializationFeature", ".", "INDENT_OUTPUT", ")", ".", "writeValueAsString", "(", "o", ")", ";", ...
A not-pretty printed JSON string. Returns a portable JSON string. @param o the object to serialize @return a string representation of the object.
[ "A", "not", "-", "pretty", "printed", "JSON", "string", ".", "Returns", "a", "portable", "JSON", "string", "." ]
65de3c17408ca03a2e28c1062ef6bb139f36f5a7
https://github.com/inversoft/jackson5/blob/65de3c17408ca03a2e28c1062ef6bb139f36f5a7/src/main/java/com/inversoft/json/ToString.java#L53-L59
41,793
aoindustries/aoweb-framework
src/main/java/com/aoindustries/website/framework/WebPageLayout.java
WebPageLayout.beginLightArea
final public void beginLightArea(WebSiteRequest req, HttpServletResponse resp, ChainWriter out) throws IOException { beginLightArea(req, resp, out, null, false); }
java
final public void beginLightArea(WebSiteRequest req, HttpServletResponse resp, ChainWriter out) throws IOException { beginLightArea(req, resp, out, null, false); }
[ "final", "public", "void", "beginLightArea", "(", "WebSiteRequest", "req", ",", "HttpServletResponse", "resp", ",", "ChainWriter", "out", ")", "throws", "IOException", "{", "beginLightArea", "(", "req", ",", "resp", ",", "out", ",", "null", ",", "false", ")", ...
Begins a lighter colored area of the site.
[ "Begins", "a", "lighter", "colored", "area", "of", "the", "site", "." ]
8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0
https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPageLayout.java#L263-L265
41,794
aoindustries/aocode-public
src/main/java/com/aoindustries/io/MultiFileOutputStream.java
MultiFileOutputStream.makeNewFile
private void makeNewFile() throws IOException { String filename=prefix+(files.size()+1)+suffix; File file=new File(parent, filename); out=new FileOutputStream(file); bytesOut=0; files.add(file); }
java
private void makeNewFile() throws IOException { String filename=prefix+(files.size()+1)+suffix; File file=new File(parent, filename); out=new FileOutputStream(file); bytesOut=0; files.add(file); }
[ "private", "void", "makeNewFile", "(", ")", "throws", "IOException", "{", "String", "filename", "=", "prefix", "+", "(", "files", ".", "size", "(", ")", "+", "1", ")", "+", "suffix", ";", "File", "file", "=", "new", "File", "(", "parent", ",", "filen...
All accesses are already synchronized.
[ "All", "accesses", "are", "already", "synchronized", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/MultiFileOutputStream.java#L119-L125
41,795
aoindustries/ao-messaging-api
src/main/java/com/aoindustries/messaging/FileMessage.java
FileMessage.decode
public static FileMessage decode(String encodedMessage, File file) throws IOException { return decode( encodedMessage.isEmpty() ? ByteArray.EMPTY_BYTE_ARRAY : new ByteArray( Base64Coder.decode( encodedMessage ) ), file ); }
java
public static FileMessage decode(String encodedMessage, File file) throws IOException { return decode( encodedMessage.isEmpty() ? ByteArray.EMPTY_BYTE_ARRAY : new ByteArray( Base64Coder.decode( encodedMessage ) ), file ); }
[ "public", "static", "FileMessage", "decode", "(", "String", "encodedMessage", ",", "File", "file", ")", "throws", "IOException", "{", "return", "decode", "(", "encodedMessage", ".", "isEmpty", "(", ")", "?", "ByteArray", ".", "EMPTY_BYTE_ARRAY", ":", "new", "B...
base-64 decodes the message into the provided file. @see #decode(com.aoindustries.messaging.ByteArray, java.io.File)
[ "base", "-", "64", "decodes", "the", "message", "into", "the", "provided", "file", "." ]
dbe4d3baefcc846f99b7eeab42646057e99729f0
https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/FileMessage.java#L48-L59
41,796
aoindustries/ao-messaging-api
src/main/java/com/aoindustries/messaging/FileMessage.java
FileMessage.decode
@Deprecated public static FileMessage decode(String encodedMessage) throws IOException { return decode( encodedMessage.isEmpty() ? ByteArray.EMPTY_BYTE_ARRAY : new ByteArray( Base64Coder.decode( encodedMessage ) ) ); }
java
@Deprecated public static FileMessage decode(String encodedMessage) throws IOException { return decode( encodedMessage.isEmpty() ? ByteArray.EMPTY_BYTE_ARRAY : new ByteArray( Base64Coder.decode( encodedMessage ) ) ); }
[ "@", "Deprecated", "public", "static", "FileMessage", "decode", "(", "String", "encodedMessage", ")", "throws", "IOException", "{", "return", "decode", "(", "encodedMessage", ".", "isEmpty", "(", ")", "?", "ByteArray", ".", "EMPTY_BYTE_ARRAY", ":", "new", "ByteA...
base-64 decodes the message into a temp file. @see #decode(java.lang.String, java.io.File) @deprecated Please use {@link TempFileContext} as {@link File#deleteOnExit()} is prone to memory leaks in long-running applications.
[ "base", "-", "64", "decodes", "the", "message", "into", "a", "temp", "file", "." ]
dbe4d3baefcc846f99b7eeab42646057e99729f0
https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/FileMessage.java#L69-L80
41,797
aoindustries/ao-messaging-api
src/main/java/com/aoindustries/messaging/FileMessage.java
FileMessage.decode
public static FileMessage decode(ByteArray encodedMessage, File file) throws IOException { try (OutputStream out = new FileOutputStream(file)) { out.write(encodedMessage.array, 0, encodedMessage.size); } return new FileMessage(true, file); }
java
public static FileMessage decode(ByteArray encodedMessage, File file) throws IOException { try (OutputStream out = new FileOutputStream(file)) { out.write(encodedMessage.array, 0, encodedMessage.size); } return new FileMessage(true, file); }
[ "public", "static", "FileMessage", "decode", "(", "ByteArray", "encodedMessage", ",", "File", "file", ")", "throws", "IOException", "{", "try", "(", "OutputStream", "out", "=", "new", "FileOutputStream", "(", "file", ")", ")", "{", "out", ".", "write", "(", ...
Restores this message into the provided file. @see #decode(java.lang.String, java.io.File)
[ "Restores", "this", "message", "into", "the", "provided", "file", "." ]
dbe4d3baefcc846f99b7eeab42646057e99729f0
https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/FileMessage.java#L87-L92
41,798
aoindustries/ao-messaging-api
src/main/java/com/aoindustries/messaging/FileMessage.java
FileMessage.decode
@Deprecated public static FileMessage decode(ByteArray encodedMessage) throws IOException { File file = File.createTempFile("FileMessage.", null); file.deleteOnExit(); return decode(encodedMessage, file); }
java
@Deprecated public static FileMessage decode(ByteArray encodedMessage) throws IOException { File file = File.createTempFile("FileMessage.", null); file.deleteOnExit(); return decode(encodedMessage, file); }
[ "@", "Deprecated", "public", "static", "FileMessage", "decode", "(", "ByteArray", "encodedMessage", ")", "throws", "IOException", "{", "File", "file", "=", "File", ".", "createTempFile", "(", "\"FileMessage.\"", ",", "null", ")", ";", "file", ".", "deleteOnExit"...
Restores this message into a temp file. @see #decode(com.aoindustries.messaging.ByteArray, java.io.File) @deprecated Please use {@link TempFileContext} as {@link File#deleteOnExit()} is prone to memory leaks in long-running applications.
[ "Restores", "this", "message", "into", "a", "temp", "file", "." ]
dbe4d3baefcc846f99b7eeab42646057e99729f0
https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/FileMessage.java#L102-L107
41,799
aoindustries/aocode-public
src/main/java/com/aoindustries/rmi/RegistryManager.java
RegistryManager.createRegistry
public static Registry createRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException { synchronized(registryCache) { Integer portObj = port; Registry registry = registryCache.get(portObj); if(registry==null) { registry = LocateRegistry.createRegistry(port, csf, s...
java
public static Registry createRegistry(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException { synchronized(registryCache) { Integer portObj = port; Registry registry = registryCache.get(portObj); if(registry==null) { registry = LocateRegistry.createRegistry(port, csf, s...
[ "public", "static", "Registry", "createRegistry", "(", "int", "port", ",", "RMIClientSocketFactory", "csf", ",", "RMIServerSocketFactory", "ssf", ")", "throws", "RemoteException", "{", "synchronized", "(", "registryCache", ")", "{", "Integer", "portObj", "=", "port"...
Creates a registry or returns the registry that is already using the port.
[ "Creates", "a", "registry", "or", "returns", "the", "registry", "that", "is", "already", "using", "the", "port", "." ]
c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/rmi/RegistryManager.java#L48-L58