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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
62,500 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java | CollectionUtil.mergeArrays | @SuppressWarnings({"SuspiciousSystemArraycopy"})
public static Object mergeArrays(Object pArray1, int pOffset1, int pLength1, Object pArray2, int pOffset2, int pLength2) {
Class class1 = pArray1.getClass();
Class type = class1.getComponentType();
// Create new array of the new length
... | java | @SuppressWarnings({"SuspiciousSystemArraycopy"})
public static Object mergeArrays(Object pArray1, int pOffset1, int pLength1, Object pArray2, int pOffset2, int pLength2) {
Class class1 = pArray1.getClass();
Class type = class1.getComponentType();
// Create new array of the new length
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"SuspiciousSystemArraycopy\"",
"}",
")",
"public",
"static",
"Object",
"mergeArrays",
"(",
"Object",
"pArray1",
",",
"int",
"pOffset1",
",",
"int",
"pLength1",
",",
"Object",
"pArray2",
",",
"int",
"pOffset2",
",",
"int",
"... | Merges two arrays into a new array. Elements from pArray1 and pArray2 will
be copied into a new array, that has pLength1 + pLength2 elements.
@param pArray1 First array
@param pOffset1 the offset into the first array
@param pLength1 the number of elements to copy from the first array
@param pArray2 Second array, mus... | [
"Merges",
"two",
"arrays",
"into",
"a",
"new",
"array",
".",
"Elements",
"from",
"pArray1",
"and",
"pArray2",
"will",
"be",
"copied",
"into",
"a",
"new",
"array",
"that",
"has",
"pLength1",
"+",
"pLength2",
"elements",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java#L246-L257 |
62,501 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java | CollectionUtil.addAll | public static <E> void addAll(Collection<E> pCollection, Iterator<? extends E> pIterator) {
while (pIterator.hasNext()) {
pCollection.add(pIterator.next());
}
} | java | public static <E> void addAll(Collection<E> pCollection, Iterator<? extends E> pIterator) {
while (pIterator.hasNext()) {
pCollection.add(pIterator.next());
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"addAll",
"(",
"Collection",
"<",
"E",
">",
"pCollection",
",",
"Iterator",
"<",
"?",
"extends",
"E",
">",
"pIterator",
")",
"{",
"while",
"(",
"pIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"pCollection",
... | Adds all elements of the iterator to the collection.
@param pCollection the collection
@param pIterator the elements to add
@throws UnsupportedOperationException if {@code add} is not supported by
the given collection.
@throws ClassCastException class of the specified element prevents it
from being added to this coll... | [
"Adds",
"all",
"elements",
"of",
"the",
"iterator",
"to",
"the",
"collection",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java#L414-L418 |
62,502 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java | ServiceRegistry.registerSPIs | <T> void registerSPIs(final URL pResource, final Class<T> pCategory, final ClassLoader pLoader) {
Properties classNames = new Properties();
try {
classNames.load(pResource.openStream());
}
catch (IOException e) {
throw new ServiceConfigurationError(e);
... | java | <T> void registerSPIs(final URL pResource, final Class<T> pCategory, final ClassLoader pLoader) {
Properties classNames = new Properties();
try {
classNames.load(pResource.openStream());
}
catch (IOException e) {
throw new ServiceConfigurationError(e);
... | [
"<",
"T",
">",
"void",
"registerSPIs",
"(",
"final",
"URL",
"pResource",
",",
"final",
"Class",
"<",
"T",
">",
"pCategory",
",",
"final",
"ClassLoader",
"pLoader",
")",
"{",
"Properties",
"classNames",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",... | Registers all SPIs listed in the given resource.
@param pResource the resource to load SPIs from
@param pCategory the category class
@param pLoader the class loader to use | [
"Registers",
"all",
"SPIs",
"listed",
"in",
"the",
"given",
"resource",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java#L147-L185 |
62,503 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java | ServiceRegistry.getRegistry | private <T> CategoryRegistry<T> getRegistry(final Class<T> pCategory) {
@SuppressWarnings({"unchecked"})
CategoryRegistry<T> registry = categoryMap.get(pCategory);
if (registry == null) {
throw new IllegalArgumentException("No such category: " + pCategory.getName());
}
... | java | private <T> CategoryRegistry<T> getRegistry(final Class<T> pCategory) {
@SuppressWarnings({"unchecked"})
CategoryRegistry<T> registry = categoryMap.get(pCategory);
if (registry == null) {
throw new IllegalArgumentException("No such category: " + pCategory.getName());
}
... | [
"private",
"<",
"T",
">",
"CategoryRegistry",
"<",
"T",
">",
"getRegistry",
"(",
"final",
"Class",
"<",
"T",
">",
"pCategory",
")",
"{",
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"CategoryRegistry",
"<",
"T",
">",
"registry",
"=",
"ca... | Gets the category registry for the given category.
@param pCategory the category class
@return the {@code CategoryRegistry} for the given category | [
"Gets",
"the",
"category",
"registry",
"for",
"the",
"given",
"category",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java#L288-L295 |
62,504 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java | ServiceRegistry.register | public boolean register(final Object pProvider) {
Iterator<Class<?>> categories = compatibleCategories(pProvider);
boolean registered = false;
while (categories.hasNext()) {
Class<?> category = categories.next();
if (registerImpl(pProvider, category) && !registered) ... | java | public boolean register(final Object pProvider) {
Iterator<Class<?>> categories = compatibleCategories(pProvider);
boolean registered = false;
while (categories.hasNext()) {
Class<?> category = categories.next();
if (registerImpl(pProvider, category) && !registered) ... | [
"public",
"boolean",
"register",
"(",
"final",
"Object",
"pProvider",
")",
"{",
"Iterator",
"<",
"Class",
"<",
"?",
">",
">",
"categories",
"=",
"compatibleCategories",
"(",
"pProvider",
")",
";",
"boolean",
"registered",
"=",
"false",
";",
"while",
"(",
"... | Registers the given provider for all categories it matches.
@param pProvider the provider instance
@return {@code true} if {@code pProvider} is now registered in
one or more categories it was not registered in before.
@see #compatibleCategories(Object) | [
"Registers",
"the",
"given",
"provider",
"for",
"all",
"categories",
"it",
"matches",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java#L305-L315 |
62,505 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java | ServiceRegistry.register | public <T> boolean register(final T pProvider, final Class<? super T> pCategory) {
return registerImpl(pProvider, pCategory);
} | java | public <T> boolean register(final T pProvider, final Class<? super T> pCategory) {
return registerImpl(pProvider, pCategory);
} | [
"public",
"<",
"T",
">",
"boolean",
"register",
"(",
"final",
"T",
"pProvider",
",",
"final",
"Class",
"<",
"?",
"super",
"T",
">",
"pCategory",
")",
"{",
"return",
"registerImpl",
"(",
"pProvider",
",",
"pCategory",
")",
";",
"}"
] | Registers the given provider for the given category.
@param pProvider the provider instance
@param pCategory the category class
@return {@code true} if {@code pProvider} is now registered in
the given category | [
"Registers",
"the",
"given",
"provider",
"for",
"the",
"given",
"category",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java#L329-L331 |
62,506 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java | ServiceRegistry.deregister | public boolean deregister(final Object pProvider) {
Iterator<Class<?>> categories = containingCategories(pProvider);
boolean deregistered = false;
while (categories.hasNext()) {
Class<?> category = categories.next();
if (deregister(pProvider, category) && !deregist... | java | public boolean deregister(final Object pProvider) {
Iterator<Class<?>> categories = containingCategories(pProvider);
boolean deregistered = false;
while (categories.hasNext()) {
Class<?> category = categories.next();
if (deregister(pProvider, category) && !deregist... | [
"public",
"boolean",
"deregister",
"(",
"final",
"Object",
"pProvider",
")",
"{",
"Iterator",
"<",
"Class",
"<",
"?",
">",
">",
"categories",
"=",
"containingCategories",
"(",
"pProvider",
")",
";",
"boolean",
"deregistered",
"=",
"false",
";",
"while",
"(",... | De-registers the given provider from all categories it's currently
registered in.
@param pProvider the provider instance
@return {@code true} if {@code pProvider} was previously registered in
any category and is now de-registered.
@see #containingCategories(Object) | [
"De",
"-",
"registers",
"the",
"given",
"provider",
"from",
"all",
"categories",
"it",
"s",
"currently",
"registered",
"in",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/service/ServiceRegistry.java#L342-L354 |
62,507 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.isEmpty | public static boolean isEmpty(String[] pStringArray) {
// No elements to test
if (pStringArray == null) {
return true;
}
// Test all the elements
for (String string : pStringArray) {
if (!isEmpty(string)) {
return false;
... | java | public static boolean isEmpty(String[] pStringArray) {
// No elements to test
if (pStringArray == null) {
return true;
}
// Test all the elements
for (String string : pStringArray) {
if (!isEmpty(string)) {
return false;
... | [
"public",
"static",
"boolean",
"isEmpty",
"(",
"String",
"[",
"]",
"pStringArray",
")",
"{",
"// No elements to test\r",
"if",
"(",
"pStringArray",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"// Test all the elements\r",
"for",
"(",
"String",
"string",
... | Tests a string array, to see if all items are null or an empty string.
@param pStringArray The string array to check.
@return true if the string array is null or only contains string items
that are null or contain only whitespace, otherwise false. | [
"Tests",
"a",
"string",
"array",
"to",
"see",
"if",
"all",
"items",
"are",
"null",
"or",
"an",
"empty",
"string",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L167-L182 |
62,508 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.contains | public static boolean contains(String pContainer, String pLookFor) {
return ((pContainer != null) && (pLookFor != null) && (pContainer.indexOf(pLookFor) >= 0));
} | java | public static boolean contains(String pContainer, String pLookFor) {
return ((pContainer != null) && (pLookFor != null) && (pContainer.indexOf(pLookFor) >= 0));
} | [
"public",
"static",
"boolean",
"contains",
"(",
"String",
"pContainer",
",",
"String",
"pLookFor",
")",
"{",
"return",
"(",
"(",
"pContainer",
"!=",
"null",
")",
"&&",
"(",
"pLookFor",
"!=",
"null",
")",
"&&",
"(",
"pContainer",
".",
"indexOf",
"(",
"pLo... | Tests if a string contains another string.
@param pContainer The string to test
@param pLookFor The string to look for
@return {@code true} if the container string is contains the string, and
both parameters are non-{@code null}, otherwise {@code false}. | [
"Tests",
"if",
"a",
"string",
"contains",
"another",
"string",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L192-L194 |
62,509 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.containsIgnoreCase | public static boolean containsIgnoreCase(String pString, int pChar) {
return ((pString != null)
&& ((pString.indexOf(Character.toLowerCase((char) pChar)) >= 0)
|| (pString.indexOf(Character.toUpperCase((char) pChar)) >= 0)));
// NOTE: I don't convert the string to ... | java | public static boolean containsIgnoreCase(String pString, int pChar) {
return ((pString != null)
&& ((pString.indexOf(Character.toLowerCase((char) pChar)) >= 0)
|| (pString.indexOf(Character.toUpperCase((char) pChar)) >= 0)));
// NOTE: I don't convert the string to ... | [
"public",
"static",
"boolean",
"containsIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
")",
"{",
"return",
"(",
"(",
"pString",
"!=",
"null",
")",
"&&",
"(",
"(",
"pString",
".",
"indexOf",
"(",
"Character",
".",
"toLowerCase",
"(",
"(",
"ch... | Tests if a string contains a specific character, ignoring case.
@param pString The string to check.
@param pChar The character to search for.
@return true if the string contains the specific character. | [
"Tests",
"if",
"a",
"string",
"contains",
"a",
"specific",
"character",
"ignoring",
"case",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L227-L235 |
62,510 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.indexOfIgnoreCase | public static int indexOfIgnoreCase(String pString, int pChar, int pPos) {
if ((pString == null)) {
return -1;
}
// Get first char
char lower = Character.toLowerCase((char) pChar);
char upper = Character.toUpperCase((char) pChar);
int indexLower;
... | java | public static int indexOfIgnoreCase(String pString, int pChar, int pPos) {
if ((pString == null)) {
return -1;
}
// Get first char
char lower = Character.toLowerCase((char) pChar);
char upper = Character.toUpperCase((char) pChar);
int indexLower;
... | [
"public",
"static",
"int",
"indexOfIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
",",
"int",
"pPos",
")",
"{",
"if",
"(",
"(",
"pString",
"==",
"null",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// Get first char\r",
"char",
"lower",
"... | Returns the index within this string of the first occurrence of the
specified character, starting at the specified index.
@param pString The string to test
@param pChar The character to look for
@param pPos The first index to test
@return if the string argument occurs as a substring within this object,
then the i... | [
"Returns",
"the",
"index",
"within",
"this",
"string",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"character",
"starting",
"at",
"the",
"specified",
"index",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L465-L496 |
62,511 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.lastIndexOfIgnoreCase | public static int lastIndexOfIgnoreCase(String pString, int pChar) {
return lastIndexOfIgnoreCase(pString, pChar, pString != null ? pString.length() : -1);
} | java | public static int lastIndexOfIgnoreCase(String pString, int pChar) {
return lastIndexOfIgnoreCase(pString, pChar, pString != null ? pString.length() : -1);
} | [
"public",
"static",
"int",
"lastIndexOfIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
")",
"{",
"return",
"lastIndexOfIgnoreCase",
"(",
"pString",
",",
"pChar",
",",
"pString",
"!=",
"null",
"?",
"pString",
".",
"length",
"(",
")",
":",
"-",
"... | Returns the index within this string of the last occurrence of the
specified character.
@param pString The string to test
@param pChar The character to look for
@return if the string argument occurs as a substring within this object,
then the index of the first character of the first such substring is
returned; if i... | [
"Returns",
"the",
"index",
"within",
"this",
"string",
"of",
"the",
"last",
"occurrence",
"of",
"the",
"specified",
"character",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L509-L511 |
62,512 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.lastIndexOfIgnoreCase | public static int lastIndexOfIgnoreCase(String pString, int pChar, int pPos) {
if ((pString == null)) {
return -1;
}
// Get first char
char lower = Character.toLowerCase((char) pChar);
char upper = Character.toUpperCase((char) pChar);
int indexLower;
... | java | public static int lastIndexOfIgnoreCase(String pString, int pChar, int pPos) {
if ((pString == null)) {
return -1;
}
// Get first char
char lower = Character.toLowerCase((char) pChar);
char upper = Character.toUpperCase((char) pChar);
int indexLower;
... | [
"public",
"static",
"int",
"lastIndexOfIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
",",
"int",
"pPos",
")",
"{",
"if",
"(",
"(",
"pString",
"==",
"null",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// Get first char\r",
"char",
"lower",... | Returns the index within this string of the last occurrence of the
specified character, searching backward starting at the specified index.
@param pString The string to test
@param pChar The character to look for
@param pPos The last index to test
@return if the string argument occurs as a substring within this o... | [
"Returns",
"the",
"index",
"within",
"this",
"string",
"of",
"the",
"last",
"occurrence",
"of",
"the",
"specified",
"character",
"searching",
"backward",
"starting",
"at",
"the",
"specified",
"index",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L525-L556 |
62,513 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.ltrim | public static String ltrim(String pString) {
if ((pString == null) || (pString.length() == 0)) {
return pString;// Null or empty string
}
for (int i = 0; i < pString.length(); i++) {
if (!Character.isWhitespace(pString.charAt(i))) {
if (i == 0) {
... | java | public static String ltrim(String pString) {
if ((pString == null) || (pString.length() == 0)) {
return pString;// Null or empty string
}
for (int i = 0; i < pString.length(); i++) {
if (!Character.isWhitespace(pString.charAt(i))) {
if (i == 0) {
... | [
"public",
"static",
"String",
"ltrim",
"(",
"String",
"pString",
")",
"{",
"if",
"(",
"(",
"pString",
"==",
"null",
")",
"||",
"(",
"pString",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"{",
"return",
"pString",
";",
"// Null or empty string\r",
"}"... | Trims the argument string for whitespace on the left side only.
@param pString the string to trim
@return the string with no whitespace on the left, or {@code null} if
the string argument is {@code null}.
@see #rtrim
@see String#trim() | [
"Trims",
"the",
"argument",
"string",
"for",
"whitespace",
"on",
"the",
"left",
"side",
"only",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L567-L584 |
62,514 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.replace | public static String replace(String pSource, String pPattern, String pReplace) {
if (pPattern.length() == 0) {
return pSource;// Special case: No pattern to replace
}
int match;
int offset = 0;
StringBuilder result = new StringBuilder();
// Loop str... | java | public static String replace(String pSource, String pPattern, String pReplace) {
if (pPattern.length() == 0) {
return pSource;// Special case: No pattern to replace
}
int match;
int offset = 0;
StringBuilder result = new StringBuilder();
// Loop str... | [
"public",
"static",
"String",
"replace",
"(",
"String",
"pSource",
",",
"String",
"pPattern",
",",
"String",
"pReplace",
")",
"{",
"if",
"(",
"pPattern",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"pSource",
";",
"// Special case: No pattern to ... | Replaces a substring of a string with another string. All matches are
replaced.
@param pSource The source String
@param pPattern The pattern to replace
@param pReplace The new String to be inserted instead of the
replace String
@return The new String with the pattern replaced | [
"Replaces",
"a",
"substring",
"of",
"a",
"string",
"with",
"another",
"string",
".",
"All",
"matches",
"are",
"replaced",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L624-L646 |
62,515 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.replaceIgnoreCase | public static String replaceIgnoreCase(String pSource, String pPattern, String pReplace) {
if (pPattern.length() == 0) {
return pSource;// Special case: No pattern to replace
}
int match;
int offset = 0;
StringBuilder result = new StringBuilder();
whi... | java | public static String replaceIgnoreCase(String pSource, String pPattern, String pReplace) {
if (pPattern.length() == 0) {
return pSource;// Special case: No pattern to replace
}
int match;
int offset = 0;
StringBuilder result = new StringBuilder();
whi... | [
"public",
"static",
"String",
"replaceIgnoreCase",
"(",
"String",
"pSource",
",",
"String",
"pPattern",
",",
"String",
"pReplace",
")",
"{",
"if",
"(",
"pPattern",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"pSource",
";",
"// Special case: No p... | Replaces a substring of a string with another string, ignoring case.
All matches are replaced.
@param pSource The source String
@param pPattern The pattern to replace
@param pReplace The new String to be inserted instead of the
replace String
@return The new String with the pattern replaced
@see #replace(String,Strin... | [
"Replaces",
"a",
"substring",
"of",
"a",
"string",
"with",
"another",
"string",
"ignoring",
"case",
".",
"All",
"matches",
"are",
"replaced",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L659-L674 |
62,516 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.capitalize | public static String capitalize(String pString, int pIndex) {
if (pIndex < 0) {
throw new IndexOutOfBoundsException("Negative index not allowed: " + pIndex);
}
if (pString == null || pString.length() <= pIndex) {
return pString;
}
// This is the f... | java | public static String capitalize(String pString, int pIndex) {
if (pIndex < 0) {
throw new IndexOutOfBoundsException("Negative index not allowed: " + pIndex);
}
if (pString == null || pString.length() <= pIndex) {
return pString;
}
// This is the f... | [
"public",
"static",
"String",
"capitalize",
"(",
"String",
"pString",
",",
"int",
"pIndex",
")",
"{",
"if",
"(",
"pIndex",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Negative index not allowed: \"",
"+",
"pIndex",
")",
";",
"}",
... | Makes the Nth letter of a String uppercase. If the index is outside the
the length of the argument string, the argument is simply returned.
@param pString The string to capitalize
@param pIndex The base-0 index of the char to capitalize.
@return The capitalized string, or null, if a null argument was given. | [
"Makes",
"the",
"Nth",
"letter",
"of",
"a",
"String",
"uppercase",
".",
"If",
"the",
"index",
"is",
"outside",
"the",
"the",
"length",
"of",
"the",
"argument",
"string",
"the",
"argument",
"is",
"simply",
"returned",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L717-L748 |
62,517 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.pad | public static String pad(String pSource, int pRequiredLength, String pPadString, boolean pPrepend) {
if (pPadString == null || pPadString.length() == 0) {
throw new IllegalArgumentException("Pad string: \"" + pPadString + "\"");
}
if (pSource.length() >= pRequiredLength) {
... | java | public static String pad(String pSource, int pRequiredLength, String pPadString, boolean pPrepend) {
if (pPadString == null || pPadString.length() == 0) {
throw new IllegalArgumentException("Pad string: \"" + pPadString + "\"");
}
if (pSource.length() >= pRequiredLength) {
... | [
"public",
"static",
"String",
"pad",
"(",
"String",
"pSource",
",",
"int",
"pRequiredLength",
",",
"String",
"pPadString",
",",
"boolean",
"pPrepend",
")",
"{",
"if",
"(",
"pPadString",
"==",
"null",
"||",
"pPadString",
".",
"length",
"(",
")",
"==",
"0",
... | String length check with simple concatenation of selected pad-string.
E.g. a zip number from 123 to the correct 0123.
@param pSource The source string.
@param pRequiredLength The accurate length of the resulting string.
@param pPadString The string for concatenation.
@param pPrepend The location of... | [
"String",
"length",
"check",
"with",
"simple",
"concatenation",
"of",
"selected",
"pad",
"-",
"string",
".",
"E",
".",
"g",
".",
"a",
"zip",
"number",
"from",
"123",
"to",
"the",
"correct",
"0123",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L805-L855 |
62,518 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.toStringArray | public static String[] toStringArray(String pString, String pDelimiters) {
if (isEmpty(pString)) {
return new String[0];
}
StringTokenIterator st = new StringTokenIterator(pString, pDelimiters);
List<String> v = new ArrayList<String>();
while (st.hasMoreElem... | java | public static String[] toStringArray(String pString, String pDelimiters) {
if (isEmpty(pString)) {
return new String[0];
}
StringTokenIterator st = new StringTokenIterator(pString, pDelimiters);
List<String> v = new ArrayList<String>();
while (st.hasMoreElem... | [
"public",
"static",
"String",
"[",
"]",
"toStringArray",
"(",
"String",
"pString",
",",
"String",
"pDelimiters",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"pString",
")",
")",
"{",
"return",
"new",
"String",
"[",
"0",
"]",
";",
"}",
"StringTokenIterator",
"st... | Converts a delimiter separated String to an array of Strings.
@param pString The comma-separated string
@param pDelimiters The delimiter string
@return a {@code String} array containing the delimiter separated elements | [
"Converts",
"a",
"delimiter",
"separated",
"String",
"to",
"an",
"array",
"of",
"Strings",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L930-L943 |
62,519 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.toIntArray | public static int[] toIntArray(String pString, String pDelimiters, int pBase) {
if (isEmpty(pString)) {
return new int[0];
}
// Some room for improvement here...
String[] temp = toStringArray(pString, pDelimiters);
int[] array = new int[temp.length];
... | java | public static int[] toIntArray(String pString, String pDelimiters, int pBase) {
if (isEmpty(pString)) {
return new int[0];
}
// Some room for improvement here...
String[] temp = toStringArray(pString, pDelimiters);
int[] array = new int[temp.length];
... | [
"public",
"static",
"int",
"[",
"]",
"toIntArray",
"(",
"String",
"pString",
",",
"String",
"pDelimiters",
",",
"int",
"pBase",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"pString",
")",
")",
"{",
"return",
"new",
"int",
"[",
"0",
"]",
";",
"}",
"// Some r... | Converts a comma-separated String to an array of ints.
@param pString The comma-separated string
@param pDelimiters The delimiter string
@param pBase The radix
@return an {@code int} array
@throws NumberFormatException if any of the elements are not parseable
as an int | [
"Converts",
"a",
"comma",
"-",
"separated",
"String",
"to",
"an",
"array",
"of",
"ints",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L966-L979 |
62,520 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.toLongArray | public static long[] toLongArray(String pString, String pDelimiters) {
if (isEmpty(pString)) {
return new long[0];
}
// Some room for improvement here...
String[] temp = toStringArray(pString, pDelimiters);
long[] array = new long[temp.length];
for ... | java | public static long[] toLongArray(String pString, String pDelimiters) {
if (isEmpty(pString)) {
return new long[0];
}
// Some room for improvement here...
String[] temp = toStringArray(pString, pDelimiters);
long[] array = new long[temp.length];
for ... | [
"public",
"static",
"long",
"[",
"]",
"toLongArray",
"(",
"String",
"pString",
",",
"String",
"pDelimiters",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"pString",
")",
")",
"{",
"return",
"new",
"long",
"[",
"0",
"]",
";",
"}",
"// Some room for improvement here... | Converts a comma-separated String to an array of longs.
@param pString The comma-separated string
@param pDelimiters The delimiter string
@return a {@code long} array
@throws NumberFormatException if any of the elements are not parseable
as a long | [
"Converts",
"a",
"comma",
"-",
"separated",
"String",
"to",
"an",
"array",
"of",
"longs",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L1018-L1031 |
62,521 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.toDoubleArray | public static double[] toDoubleArray(String pString, String pDelimiters) {
if (isEmpty(pString)) {
return new double[0];
}
// Some room for improvement here...
String[] temp = toStringArray(pString, pDelimiters);
double[] array = new double[temp.length];
... | java | public static double[] toDoubleArray(String pString, String pDelimiters) {
if (isEmpty(pString)) {
return new double[0];
}
// Some room for improvement here...
String[] temp = toStringArray(pString, pDelimiters);
double[] array = new double[temp.length];
... | [
"public",
"static",
"double",
"[",
"]",
"toDoubleArray",
"(",
"String",
"pString",
",",
"String",
"pDelimiters",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"pString",
")",
")",
"{",
"return",
"new",
"double",
"[",
"0",
"]",
";",
"}",
"// Some room for improvemen... | Converts a comma-separated String to an array of doubles.
@param pString The comma-separated string
@param pDelimiters The delimiter string
@return a {@code double} array
@throws NumberFormatException if any of the elements are not parseable
as a double | [
"Converts",
"a",
"comma",
"-",
"separated",
"String",
"to",
"an",
"array",
"of",
"doubles",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L1056-L1071 |
62,522 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.toCSVString | public static String toCSVString(Object[] pStringArray, String pDelimiterString) {
if (pStringArray == null) {
return "";
}
if (pDelimiterString == null) {
throw new IllegalArgumentException("delimiter == null");
}
StringBuilder buffer = new Strin... | java | public static String toCSVString(Object[] pStringArray, String pDelimiterString) {
if (pStringArray == null) {
return "";
}
if (pDelimiterString == null) {
throw new IllegalArgumentException("delimiter == null");
}
StringBuilder buffer = new Strin... | [
"public",
"static",
"String",
"toCSVString",
"(",
"Object",
"[",
"]",
"pStringArray",
",",
"String",
"pDelimiterString",
")",
"{",
"if",
"(",
"pStringArray",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"pDelimiterString",
"==",
"null",
"... | Converts a string array to a string separated by the given delimiter.
@param pStringArray the string array
@param pDelimiterString the delimiter string
@return string of delimiter separated values
@throws IllegalArgumentException if {@code pDelimiterString == null} | [
"Converts",
"a",
"string",
"array",
"to",
"a",
"string",
"separated",
"by",
"the",
"given",
"delimiter",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L1589-L1607 |
62,523 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/lang/NativeLoader.java | NativeLoader.loadLibrary0 | static void loadLibrary0(String pLibrary, String pResource, ClassLoader pLoader) {
if (pLibrary == null) {
throw new IllegalArgumentException("library == null");
}
// Try loading normal way
UnsatisfiedLinkError unsatisfied;
try {
System.loadLibrar... | java | static void loadLibrary0(String pLibrary, String pResource, ClassLoader pLoader) {
if (pLibrary == null) {
throw new IllegalArgumentException("library == null");
}
// Try loading normal way
UnsatisfiedLinkError unsatisfied;
try {
System.loadLibrar... | [
"static",
"void",
"loadLibrary0",
"(",
"String",
"pLibrary",
",",
"String",
"pResource",
",",
"ClassLoader",
"pLoader",
")",
"{",
"if",
"(",
"pLibrary",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"library == null\"",
")",
";",
"... | Loads a native library.
@param pLibrary name of the library
@param pResource name of the resource
@param pLoader the class loader to use
@throws UnsatisfiedLinkError | [
"Loads",
"a",
"native",
"library",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/lang/NativeLoader.java#L230-L276 |
62,524 | haraldk/TwelveMonkeys | imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/tiff/Rational.java | Rational.plus | public Rational plus(final Rational pOther) {
// special cases
if (equals(ZERO)) {
return pOther;
}
if (pOther.equals(ZERO)) {
return this;
}
// Find gcd of numerators and denominators
long f = gcd(numerator, pOther.numerator);
lon... | java | public Rational plus(final Rational pOther) {
// special cases
if (equals(ZERO)) {
return pOther;
}
if (pOther.equals(ZERO)) {
return this;
}
// Find gcd of numerators and denominators
long f = gcd(numerator, pOther.numerator);
lon... | [
"public",
"Rational",
"plus",
"(",
"final",
"Rational",
"pOther",
")",
"{",
"// special cases",
"if",
"(",
"equals",
"(",
"ZERO",
")",
")",
"{",
"return",
"pOther",
";",
"}",
"if",
"(",
"pOther",
".",
"equals",
"(",
"ZERO",
")",
")",
"{",
"return",
"... | return a + b, staving off overflow | [
"return",
"a",
"+",
"b",
"staving",
"off",
"overflow"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/tiff/Rational.java#L187-L206 |
62,525 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/droplet/Param.java | Param.service | public void service(PageContext pContext)
throws ServletException, IOException {
JspWriter writer = pContext.getOut();
writer.print(value);
} | java | public void service(PageContext pContext)
throws ServletException, IOException {
JspWriter writer = pContext.getOut();
writer.print(value);
} | [
"public",
"void",
"service",
"(",
"PageContext",
"pContext",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"JspWriter",
"writer",
"=",
"pContext",
".",
"getOut",
"(",
")",
";",
"writer",
".",
"print",
"(",
"value",
")",
";",
"}"
] | Services the page fragment. This version simply prints the value of
this parameter to teh PageContext's out. | [
"Services",
"the",
"page",
"fragment",
".",
"This",
"version",
"simply",
"prints",
"the",
"value",
"of",
"this",
"parameter",
"to",
"teh",
"PageContext",
"s",
"out",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/droplet/Param.java#L36-L40 |
62,526 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/TimeFormat.java | TimeFormat.main | static void main(String[] argv) {
Time time = null;
TimeFormat in = null;
TimeFormat out = null;
if (argv.length >= 3) {
System.out.println("Creating out TimeFormat: \"" + argv[2] + "\"");
out = new TimeFormat(argv[2]);
}
if (argv.length >= 2) {
System.out.println("Creating in TimeForm... | java | static void main(String[] argv) {
Time time = null;
TimeFormat in = null;
TimeFormat out = null;
if (argv.length >= 3) {
System.out.println("Creating out TimeFormat: \"" + argv[2] + "\"");
out = new TimeFormat(argv[2]);
}
if (argv.length >= 2) {
System.out.println("Creating in TimeForm... | [
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"argv",
")",
"{",
"Time",
"time",
"=",
"null",
";",
"TimeFormat",
"in",
"=",
"null",
";",
"TimeFormat",
"out",
"=",
"null",
";",
"if",
"(",
"argv",
".",
"length",
">=",
"3",
")",
"{",
"System",
"... | Main method for testing ONLY | [
"Main",
"method",
"for",
"testing",
"ONLY"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/TimeFormat.java#L96-L128 |
62,527 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/TimeFormat.java | TimeFormat.format | public String format(Time pTime) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < formatter.length; i++) {
buf.append(formatter[i].format(pTime));
}
return buf.toString();
} | java | public String format(Time pTime) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < formatter.length; i++) {
buf.append(formatter[i].format(pTime));
}
return buf.toString();
} | [
"public",
"String",
"format",
"(",
"Time",
"pTime",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"formatter",
".",
"length",
";",
"i",
"++",
")",
"{",
"buf",
".",
"... | Formats the the given time, using this format. | [
"Formats",
"the",
"the",
"given",
"time",
"using",
"this",
"format",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/TimeFormat.java#L251-L257 |
62,528 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/cache/HTTPCache.java | HTTPCache.registerContent | void registerContent(
final String pCacheURI,
final CacheRequest pRequest,
final CachedResponse pCachedResponse
) throws IOException {
// System.out.println(" ## HTTPCache ## Registering content for " + pCacheURI);
// pRequest.removeAttribute(ATTRIB_IS_STAL... | java | void registerContent(
final String pCacheURI,
final CacheRequest pRequest,
final CachedResponse pCachedResponse
) throws IOException {
// System.out.println(" ## HTTPCache ## Registering content for " + pCacheURI);
// pRequest.removeAttribute(ATTRIB_IS_STAL... | [
"void",
"registerContent",
"(",
"final",
"String",
"pCacheURI",
",",
"final",
"CacheRequest",
"pRequest",
",",
"final",
"CachedResponse",
"pCachedResponse",
")",
"throws",
"IOException",
"{",
"// System.out.println(\" ## HTTPCache ## Registering content for \" + pCacheURI);\r",
... | Registers content for the given URI in the cache.
@param pCacheURI the cache URI
@param pRequest the request
@param pCachedResponse the cached response
@throws IOException if the content could not be cached | [
"Registers",
"content",
"for",
"the",
"given",
"URI",
"in",
"the",
"cache",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/cache/HTTPCache.java#L736-L846 |
62,529 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/cache/HTTPCache.java | HTTPCache.getDateHeader | static long getDateHeader(final String pHeaderValue) {
long date = -1L;
if (pHeaderValue != null) {
date = HTTPUtil.parseHTTPDate(pHeaderValue);
}
return date;
} | java | static long getDateHeader(final String pHeaderValue) {
long date = -1L;
if (pHeaderValue != null) {
date = HTTPUtil.parseHTTPDate(pHeaderValue);
}
return date;
} | [
"static",
"long",
"getDateHeader",
"(",
"final",
"String",
"pHeaderValue",
")",
"{",
"long",
"date",
"=",
"-",
"1L",
";",
"if",
"(",
"pHeaderValue",
"!=",
"null",
")",
"{",
"date",
"=",
"HTTPUtil",
".",
"parseHTTPDate",
"(",
"pHeaderValue",
")",
";",
"}"... | Utility to read a date header from a cached response.
@param pHeaderValue the header value
@return the parsed date as a long, or {@code -1L} if not found
@see javax.servlet.http.HttpServletRequest#getDateHeader(String) | [
"Utility",
"to",
"read",
"a",
"date",
"header",
"from",
"a",
"cached",
"response",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/cache/HTTPCache.java#L1084-L1090 |
62,530 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/ColorServlet.java | ColorServlet.service | public void service(ServletRequest pRequest, ServletResponse pResponse) throws IOException, ServletException {
int red = 0;
int green = 0;
int blue = 0;
// Get color parameter and parse color
String rgb = pRequest.getParameter(RGB_PARAME);
if (rgb != null && rgb.l... | java | public void service(ServletRequest pRequest, ServletResponse pResponse) throws IOException, ServletException {
int red = 0;
int green = 0;
int blue = 0;
// Get color parameter and parse color
String rgb = pRequest.getParameter(RGB_PARAME);
if (rgb != null && rgb.l... | [
"public",
"void",
"service",
"(",
"ServletRequest",
"pRequest",
",",
"ServletResponse",
"pResponse",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"int",
"red",
"=",
"0",
";",
"int",
"green",
"=",
"0",
";",
"int",
"blue",
"=",
"0",
";",
"// G... | Renders the 1 x 1 single color PNG to the response.
@see ColorServlet class description
@param pRequest the request
@param pResponse the response
@throws IOException
@throws ServletException | [
"Renders",
"the",
"1",
"x",
"1",
"single",
"color",
"PNG",
"to",
"the",
"response",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/ColorServlet.java#L112-L162 |
62,531 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java | ServletUtil.getParameter | public static String getParameter(final ServletRequest pReq, final String pName, final String pDefault) {
String str = pReq.getParameter(pName);
return str != null ? str : pDefault;
} | java | public static String getParameter(final ServletRequest pReq, final String pName, final String pDefault) {
String str = pReq.getParameter(pName);
return str != null ? str : pDefault;
} | [
"public",
"static",
"String",
"getParameter",
"(",
"final",
"ServletRequest",
"pReq",
",",
"final",
"String",
"pName",
",",
"final",
"String",
"pDefault",
")",
"{",
"String",
"str",
"=",
"pReq",
".",
"getParameter",
"(",
"pName",
")",
";",
"return",
"str",
... | Gets the value of the given parameter from the request, or if the
parameter is not set, the default value.
@param pReq the servlet request
@param pName the parameter name
@param pDefault the default value
@return the value of the parameter, or the default value, if the
parameter is not set. | [
"Gets",
"the",
"value",
"of",
"the",
"given",
"parameter",
"from",
"the",
"request",
"or",
"if",
"the",
"parameter",
"is",
"not",
"set",
"the",
"default",
"value",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L128-L132 |
62,532 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java | ServletUtil.getParameter | static <T> T getParameter(final ServletRequest pReq, final String pName, final Class<T> pType, final String pFormat, final T pDefault) {
// Test if pDefault is either null or instance of pType
if (pDefault != null && !pType.isInstance(pDefault)) {
throw new IllegalArgumentException("defau... | java | static <T> T getParameter(final ServletRequest pReq, final String pName, final Class<T> pType, final String pFormat, final T pDefault) {
// Test if pDefault is either null or instance of pType
if (pDefault != null && !pType.isInstance(pDefault)) {
throw new IllegalArgumentException("defau... | [
"static",
"<",
"T",
">",
"T",
"getParameter",
"(",
"final",
"ServletRequest",
"pReq",
",",
"final",
"String",
"pName",
",",
"final",
"Class",
"<",
"T",
">",
"pType",
",",
"final",
"String",
"pFormat",
",",
"final",
"T",
"pDefault",
")",
"{",
"// Test if ... | Gets the value of the given parameter from the request converted to
an Object. If the parameter is not set or not parseable, the default
value is returned.
@param pReq the servlet request
@param pName the parameter name
@param pType the type of object (class) to return
@param pFormat the format to use (migh... | [
"Gets",
"the",
"value",
"of",
"the",
"given",
"parameter",
"from",
"the",
"request",
"converted",
"to",
"an",
"Object",
".",
"If",
"the",
"parameter",
"is",
"not",
"set",
"or",
"not",
"parseable",
"the",
"default",
"value",
"is",
"returned",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L153-L171 |
62,533 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java | ServletUtil.getScriptName | static String getScriptName(final HttpServletRequest pRequest) {
String requestURI = pRequest.getRequestURI();
return StringUtil.getLastElement(requestURI, "/");
} | java | static String getScriptName(final HttpServletRequest pRequest) {
String requestURI = pRequest.getRequestURI();
return StringUtil.getLastElement(requestURI, "/");
} | [
"static",
"String",
"getScriptName",
"(",
"final",
"HttpServletRequest",
"pRequest",
")",
"{",
"String",
"requestURI",
"=",
"pRequest",
".",
"getRequestURI",
"(",
")",
";",
"return",
"StringUtil",
".",
"getLastElement",
"(",
"requestURI",
",",
"\"/\"",
")",
";",... | Gets the name of the servlet or the script that generated the servlet.
@param pRequest The HTTP servlet request object.
@return the script name.
@todo Read the spec, seems to be a mismatch with the Servlet API...
@see javax.servlet.http.HttpServletRequest#getServletPath() | [
"Gets",
"the",
"name",
"of",
"the",
"servlet",
"or",
"the",
"script",
"that",
"generated",
"the",
"servlet",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L519-L522 |
62,534 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java | ServletUtil.getSessionId | public static String getSessionId(final HttpServletRequest pRequest) {
HttpSession session = pRequest.getSession();
return (session != null) ? session.getId() : null;
} | java | public static String getSessionId(final HttpServletRequest pRequest) {
HttpSession session = pRequest.getSession();
return (session != null) ? session.getId() : null;
} | [
"public",
"static",
"String",
"getSessionId",
"(",
"final",
"HttpServletRequest",
"pRequest",
")",
"{",
"HttpSession",
"session",
"=",
"pRequest",
".",
"getSession",
"(",
")",
";",
"return",
"(",
"session",
"!=",
"null",
")",
"?",
"session",
".",
"getId",
"(... | Gets the unique identifier assigned to this session.
The identifier is assigned by the servlet container and is implementation
dependent.
@param pRequest The HTTP servlet request object.
@return the session Id | [
"Gets",
"the",
"unique",
"identifier",
"assigned",
"to",
"this",
"session",
".",
"The",
"identifier",
"is",
"assigned",
"by",
"the",
"servlet",
"container",
"and",
"is",
"implementation",
"dependent",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L588-L592 |
62,535 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/IgnoreCaseMap.java | IgnoreCaseMap.toUpper | protected static Object toUpper(final Object pObject) {
if (pObject instanceof String) {
return ((String) pObject).toUpperCase();
}
return pObject;
} | java | protected static Object toUpper(final Object pObject) {
if (pObject instanceof String) {
return ((String) pObject).toUpperCase();
}
return pObject;
} | [
"protected",
"static",
"Object",
"toUpper",
"(",
"final",
"Object",
"pObject",
")",
"{",
"if",
"(",
"pObject",
"instanceof",
"String",
")",
"{",
"return",
"(",
"(",
"String",
")",
"pObject",
")",
".",
"toUpperCase",
"(",
")",
";",
"}",
"return",
"pObject... | Converts the parameter to uppercase, if it's a String. | [
"Converts",
"the",
"parameter",
"to",
"uppercase",
"if",
"it",
"s",
"a",
"String",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/IgnoreCaseMap.java#L160-L165 |
62,536 | haraldk/TwelveMonkeys | imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPScanner.java | XMPScanner.scanForSequence | private static long scanForSequence(final ImageInputStream pStream, final byte[] pSequence) throws IOException {
long start = -1l;
int index = 0;
int nullBytes = 0;
for (int read; (read = pStream.read()) >= 0;) {
if (pSequence[index] == (byte) read) {
// If ... | java | private static long scanForSequence(final ImageInputStream pStream, final byte[] pSequence) throws IOException {
long start = -1l;
int index = 0;
int nullBytes = 0;
for (int read; (read = pStream.read()) >= 0;) {
if (pSequence[index] == (byte) read) {
// If ... | [
"private",
"static",
"long",
"scanForSequence",
"(",
"final",
"ImageInputStream",
"pStream",
",",
"final",
"byte",
"[",
"]",
"pSequence",
")",
"throws",
"IOException",
"{",
"long",
"start",
"=",
"-",
"1l",
";",
"int",
"index",
"=",
"0",
";",
"int",
"nullBy... | Scans for a given ASCII sequence.
@param pStream the stream to scan
@param pSequence the byte sequence to search for
@return the start position of the given sequence.
@throws IOException if an I/O exception occurs during scanning | [
"Scans",
"for",
"a",
"given",
"ASCII",
"sequence",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPScanner.java#L185-L223 |
62,537 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java | SystemUtil.getResourceAsStream | private static InputStream getResourceAsStream(ClassLoader pClassLoader, String pName, boolean pGuessSuffix) {
InputStream is;
if (!pGuessSuffix) {
is = pClassLoader.getResourceAsStream(pName);
// If XML, wrap stream
if (is != null && pName.endsWith(XML_PROPE... | java | private static InputStream getResourceAsStream(ClassLoader pClassLoader, String pName, boolean pGuessSuffix) {
InputStream is;
if (!pGuessSuffix) {
is = pClassLoader.getResourceAsStream(pName);
// If XML, wrap stream
if (is != null && pName.endsWith(XML_PROPE... | [
"private",
"static",
"InputStream",
"getResourceAsStream",
"(",
"ClassLoader",
"pClassLoader",
",",
"String",
"pName",
",",
"boolean",
"pGuessSuffix",
")",
"{",
"InputStream",
"is",
";",
"if",
"(",
"!",
"pGuessSuffix",
")",
"{",
"is",
"=",
"pClassLoader",
".",
... | Gets the named resource as a stream from the given Class' Classoader.
If the pGuessSuffix parameter is true, the method will try to append
typical properties file suffixes, such as ".properties" or ".xml".
@param pClassLoader the class loader to use
@param pName name of the resource
@param pGuessSuffix guess suffix
@... | [
"Gets",
"the",
"named",
"resource",
"as",
"a",
"stream",
"from",
"the",
"given",
"Class",
"Classoader",
".",
"If",
"the",
"pGuessSuffix",
"parameter",
"is",
"true",
"the",
"method",
"will",
"try",
"to",
"append",
"typical",
"properties",
"file",
"suffixes",
... | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java#L84-L112 |
62,538 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java | SystemUtil.getFileAsStream | private static InputStream getFileAsStream(String pName, boolean pGuessSuffix) {
InputStream is = null;
File propertiesFile;
try {
if (!pGuessSuffix) {
// Get file
propertiesFile = new File(pName);
if (propertiesFile.exists(... | java | private static InputStream getFileAsStream(String pName, boolean pGuessSuffix) {
InputStream is = null;
File propertiesFile;
try {
if (!pGuessSuffix) {
// Get file
propertiesFile = new File(pName);
if (propertiesFile.exists(... | [
"private",
"static",
"InputStream",
"getFileAsStream",
"(",
"String",
"pName",
",",
"boolean",
"pGuessSuffix",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"File",
"propertiesFile",
";",
"try",
"{",
"if",
"(",
"!",
"pGuessSuffix",
")",
"{",
"// Get file \r... | Gets the named file as a stream from the current directory.
If the pGuessSuffix parameter is true, the method will try to append
typical properties file suffixes, such as ".properties" or ".xml".
@param pName name of the resource
@param pGuessSuffix guess suffix
@return an input stream reading from the resource | [
"Gets",
"the",
"named",
"file",
"as",
"a",
"stream",
"from",
"the",
"current",
"directory",
".",
"If",
"the",
"pGuessSuffix",
"parameter",
"is",
"true",
"the",
"method",
"will",
"try",
"to",
"append",
"typical",
"properties",
"file",
"suffixes",
"such",
"as"... | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java#L124-L167 |
62,539 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java | SystemUtil.loadProperties | private static Properties loadProperties(InputStream pInput)
throws IOException {
if (pInput == null) {
throw new IllegalArgumentException("InputStream == null!");
}
Properties mapping = new Properties();
/*if (pInput instanceof XMLPropertiesInputStream) {
... | java | private static Properties loadProperties(InputStream pInput)
throws IOException {
if (pInput == null) {
throw new IllegalArgumentException("InputStream == null!");
}
Properties mapping = new Properties();
/*if (pInput instanceof XMLPropertiesInputStream) {
... | [
"private",
"static",
"Properties",
"loadProperties",
"(",
"InputStream",
"pInput",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pInput",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"InputStream == null!\"",
")",
";",
"}",
"Properti... | Returns a Properties, loaded from the given inputstream. If the given
inputstream is null, then an empty Properties object is returned.
@param pInput the inputstream to read from
@return a Properties object read from the given stream, or an empty
Properties mapping, if the stream is null.
@throws IOException if an e... | [
"Returns",
"a",
"Properties",
"loaded",
"from",
"the",
"given",
"inputstream",
".",
"If",
"the",
"given",
"inputstream",
"is",
"null",
"then",
"an",
"empty",
"Properties",
"object",
"is",
"returned",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/SystemUtil.java#L405-L424 |
62,540 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/StringTokenIterator.java | StringTokenIterator.initMaxDelimiter | private static char initMaxDelimiter(char[] pDelimiters) {
if (pDelimiters == null) {
return 0;
}
char max = 0;
for (char c : pDelimiters) {
if (max < c) {
max = c;
}
}
return max;
} | java | private static char initMaxDelimiter(char[] pDelimiters) {
if (pDelimiters == null) {
return 0;
}
char max = 0;
for (char c : pDelimiters) {
if (max < c) {
max = c;
}
}
return max;
} | [
"private",
"static",
"char",
"initMaxDelimiter",
"(",
"char",
"[",
"]",
"pDelimiters",
")",
"{",
"if",
"(",
"pDelimiters",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"char",
"max",
"=",
"0",
";",
"for",
"(",
"char",
"c",
":",
"pDelimiters",
")"... | Returns the highest char in the delimiter set.
@param pDelimiters the delimiter set
@return the highest char | [
"Returns",
"the",
"highest",
"char",
"in",
"the",
"delimiter",
"set",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/StringTokenIterator.java#L169-L182 |
62,541 | haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java | PICTImageReader.getPICTFrame | private Rectangle getPICTFrame() throws IOException {
if (frame == null) {
// Read in header information
readPICTHeader(imageInput);
if (DEBUG) {
System.out.println("Done reading PICT header!");
}
}
return frame;
} | java | private Rectangle getPICTFrame() throws IOException {
if (frame == null) {
// Read in header information
readPICTHeader(imageInput);
if (DEBUG) {
System.out.println("Done reading PICT header!");
}
}
return frame;
} | [
"private",
"Rectangle",
"getPICTFrame",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"frame",
"==",
"null",
")",
"{",
"// Read in header information",
"readPICTHeader",
"(",
"imageInput",
")",
";",
"if",
"(",
"DEBUG",
")",
"{",
"System",
".",
"out",
".... | Open and read the frame size of the PICT file.
@return return the PICT frame
@throws IOException if an I/O error occurs while reading the image. | [
"Open",
"and",
"read",
"the",
"frame",
"size",
"of",
"the",
"PICT",
"file",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java#L150-L161 |
62,542 | haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java | PICTImageReader.readPICTHeader | private void readPICTHeader(final ImageInputStream pStream) throws IOException {
pStream.seek(0l);
try {
readPICTHeader0(pStream);
}
catch (IIOException e) {
// Rest and try again
pStream.seek(0l);
// Skip first 512 bytes
PICT... | java | private void readPICTHeader(final ImageInputStream pStream) throws IOException {
pStream.seek(0l);
try {
readPICTHeader0(pStream);
}
catch (IIOException e) {
// Rest and try again
pStream.seek(0l);
// Skip first 512 bytes
PICT... | [
"private",
"void",
"readPICTHeader",
"(",
"final",
"ImageInputStream",
"pStream",
")",
"throws",
"IOException",
"{",
"pStream",
".",
"seek",
"(",
"0l",
")",
";",
"try",
"{",
"readPICTHeader0",
"(",
"pStream",
")",
";",
"}",
"catch",
"(",
"IIOException",
"e",... | Read the PICT header. The information read is shown on stdout if "DEBUG" is true.
@param pStream the stream to read from
@throws IOException if an I/O error occurs while reading the image. | [
"Read",
"the",
"PICT",
"header",
".",
"The",
"information",
"read",
"is",
"shown",
"on",
"stdout",
"if",
"DEBUG",
"is",
"true",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java#L170-L184 |
62,543 | haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java | PICTImageReader.readRectangle | private void readRectangle(DataInput pStream, Rectangle pDestRect) throws IOException {
int y = pStream.readUnsignedShort();
int x = pStream.readUnsignedShort();
int h = pStream.readUnsignedShort();
int w = pStream.readUnsignedShort();
pDestRect.setLocation(getXPtCoord(x), getYP... | java | private void readRectangle(DataInput pStream, Rectangle pDestRect) throws IOException {
int y = pStream.readUnsignedShort();
int x = pStream.readUnsignedShort();
int h = pStream.readUnsignedShort();
int w = pStream.readUnsignedShort();
pDestRect.setLocation(getXPtCoord(x), getYP... | [
"private",
"void",
"readRectangle",
"(",
"DataInput",
"pStream",
",",
"Rectangle",
"pDestRect",
")",
"throws",
"IOException",
"{",
"int",
"y",
"=",
"pStream",
".",
"readUnsignedShort",
"(",
")",
";",
"int",
"x",
"=",
"pStream",
".",
"readUnsignedShort",
"(",
... | Reads the rectangle location and size from an 8-byte rectangle stream.
@param pStream the stream to read from
@param pDestRect the rectangle to read into
@throws NullPointerException if {@code pDestRect} is {@code null}
@throws IOException if an I/O error occurs while reading the image. | [
"Reads",
"the",
"rectangle",
"location",
"and",
"size",
"from",
"an",
"8",
"-",
"byte",
"rectangle",
"stream",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java#L2366-L2374 |
62,544 | haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java | PICTImageReader.readPoly | private Polygon readPoly(DataInput pStream, Rectangle pBounds) throws IOException {
// Get polygon data size
int size = pStream.readUnsignedShort();
// Get poly bounds
readRectangle(pStream, pBounds);
// Initialize the point array to the right size
int points = (size - ... | java | private Polygon readPoly(DataInput pStream, Rectangle pBounds) throws IOException {
// Get polygon data size
int size = pStream.readUnsignedShort();
// Get poly bounds
readRectangle(pStream, pBounds);
// Initialize the point array to the right size
int points = (size - ... | [
"private",
"Polygon",
"readPoly",
"(",
"DataInput",
"pStream",
",",
"Rectangle",
"pBounds",
")",
"throws",
"IOException",
"{",
"// Get polygon data size",
"int",
"size",
"=",
"pStream",
".",
"readUnsignedShort",
"(",
")",
";",
"// Get poly bounds",
"readRectangle",
... | Read in a polygon. The input stream should be positioned at the first byte
of the polygon.
@param pStream the stream to read from
@param pBounds the bounds rectangle to read into
@return the polygon
@throws IOException if an I/O error occurs while reading the image. | [
"Read",
"in",
"a",
"polygon",
".",
"The",
"input",
"stream",
"should",
"be",
"positioned",
"at",
"the",
"first",
"byte",
"of",
"the",
"polygon",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java#L2452-L2476 |
62,545 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java | ThrottleFilter.setMaxConcurrentThreadCount | public void setMaxConcurrentThreadCount(String pMaxConcurrentThreadCount) {
if (!StringUtil.isEmpty(pMaxConcurrentThreadCount)) {
try {
maxConcurrentThreadCount = Integer.parseInt(pMaxConcurrentThreadCount);
}
catch (NumberFormatException nfe) {
... | java | public void setMaxConcurrentThreadCount(String pMaxConcurrentThreadCount) {
if (!StringUtil.isEmpty(pMaxConcurrentThreadCount)) {
try {
maxConcurrentThreadCount = Integer.parseInt(pMaxConcurrentThreadCount);
}
catch (NumberFormatException nfe) {
... | [
"public",
"void",
"setMaxConcurrentThreadCount",
"(",
"String",
"pMaxConcurrentThreadCount",
")",
"{",
"if",
"(",
"!",
"StringUtil",
".",
"isEmpty",
"(",
"pMaxConcurrentThreadCount",
")",
")",
"{",
"try",
"{",
"maxConcurrentThreadCount",
"=",
"Integer",
".",
"parseI... | Sets the minimum free thread count.
@param pMaxConcurrentThreadCount | [
"Sets",
"the",
"minimum",
"free",
"thread",
"count",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java#L109-L118 |
62,546 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java | ThrottleFilter.getContentType | private String getContentType(HttpServletRequest pRequest) {
if (responseMessageTypes != null) {
String accept = pRequest.getHeader("Accept");
for (String type : responseMessageTypes) {
// Note: This is not 100% correct way of doing content negotiation
... | java | private String getContentType(HttpServletRequest pRequest) {
if (responseMessageTypes != null) {
String accept = pRequest.getHeader("Accept");
for (String type : responseMessageTypes) {
// Note: This is not 100% correct way of doing content negotiation
... | [
"private",
"String",
"getContentType",
"(",
"HttpServletRequest",
"pRequest",
")",
"{",
"if",
"(",
"responseMessageTypes",
"!=",
"null",
")",
"{",
"String",
"accept",
"=",
"pRequest",
".",
"getHeader",
"(",
"\"Accept\"",
")",
";",
"for",
"(",
"String",
"type",... | Gets the content type for the response, suitable for the requesting user agent.
@param pRequest
@return the content type | [
"Gets",
"the",
"content",
"type",
"for",
"the",
"response",
"suitable",
"for",
"the",
"requesting",
"user",
"agent",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java#L222-L237 |
62,547 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java | ThrottleFilter.getMessage | private String getMessage(String pContentType) {
String fileName = responseMessageNames.get(pContentType);
// Get cached value
CacheEntry entry = responseCache.get(fileName);
if ((entry == null) || entry.isExpired()) {
// Create and add or replace cached value
... | java | private String getMessage(String pContentType) {
String fileName = responseMessageNames.get(pContentType);
// Get cached value
CacheEntry entry = responseCache.get(fileName);
if ((entry == null) || entry.isExpired()) {
// Create and add or replace cached value
... | [
"private",
"String",
"getMessage",
"(",
"String",
"pContentType",
")",
"{",
"String",
"fileName",
"=",
"responseMessageNames",
".",
"get",
"(",
"pContentType",
")",
";",
"// Get cached value\r",
"CacheEntry",
"entry",
"=",
"responseCache",
".",
"get",
"(",
"fileNa... | Gets the response message for the given content type.
@param pContentType
@return the message | [
"Gets",
"the",
"response",
"message",
"for",
"the",
"given",
"content",
"type",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java#L245-L262 |
62,548 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java | ThrottleFilter.readMessage | private String readMessage(String pFileName) {
try {
// Read resource from web app
InputStream is = getServletContext().getResourceAsStream(pFileName);
if (is != null) {
return new String(FileUtil.read(is));
}
else {
... | java | private String readMessage(String pFileName) {
try {
// Read resource from web app
InputStream is = getServletContext().getResourceAsStream(pFileName);
if (is != null) {
return new String(FileUtil.read(is));
}
else {
... | [
"private",
"String",
"readMessage",
"(",
"String",
"pFileName",
")",
"{",
"try",
"{",
"// Read resource from web app\r",
"InputStream",
"is",
"=",
"getServletContext",
"(",
")",
".",
"getResourceAsStream",
"(",
"pFileName",
")",
";",
"if",
"(",
"is",
"!=",
"null... | Reads the response message from a file in the current web app.
@param pFileName
@return the message | [
"Reads",
"the",
"response",
"message",
"from",
"a",
"file",
"in",
"the",
"current",
"web",
"app",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ThrottleFilter.java#L270-L286 |
62,549 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/cache/CacheFilter.java | CacheFilter.init | public void init() throws ServletException {
FilterConfig config = getFilterConfig();
// Default don't delete cache files on exit (persistent cache)
boolean deleteCacheOnExit = "TRUE".equalsIgnoreCase(config.getInitParameter("deleteCacheOnExit"));
// Default expiry time 10 minute... | java | public void init() throws ServletException {
FilterConfig config = getFilterConfig();
// Default don't delete cache files on exit (persistent cache)
boolean deleteCacheOnExit = "TRUE".equalsIgnoreCase(config.getInitParameter("deleteCacheOnExit"));
// Default expiry time 10 minute... | [
"public",
"void",
"init",
"(",
")",
"throws",
"ServletException",
"{",
"FilterConfig",
"config",
"=",
"getFilterConfig",
"(",
")",
";",
"// Default don't delete cache files on exit (persistent cache)\r",
"boolean",
"deleteCacheOnExit",
"=",
"\"TRUE\"",
".",
"equalsIgnoreCas... | Initializes the filter
@throws javax.servlet.ServletException | [
"Initializes",
"the",
"filter"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/cache/CacheFilter.java#L69-L131 |
62,550 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/AbstractDecoratedMap.java | AbstractDecoratedMap.removeEntry | protected Entry<K, V> removeEntry(Entry<K, V> pEntry) {
if (pEntry == null) {
return null;
}
// Find candidate entry for this key
Entry<K, V> candidate = getEntry(pEntry.getKey());
if (candidate == pEntry || (candidate != null && candidate.equals(pEntry))) {
... | java | protected Entry<K, V> removeEntry(Entry<K, V> pEntry) {
if (pEntry == null) {
return null;
}
// Find candidate entry for this key
Entry<K, V> candidate = getEntry(pEntry.getKey());
if (candidate == pEntry || (candidate != null && candidate.equals(pEntry))) {
... | [
"protected",
"Entry",
"<",
"K",
",",
"V",
">",
"removeEntry",
"(",
"Entry",
"<",
"K",
",",
"V",
">",
"pEntry",
")",
"{",
"if",
"(",
"pEntry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Find candidate entry for this key\r",
"Entry",
"<",
"K... | Removes the given entry from the Map.
@param pEntry the entry to be removed
@return the removed entry, or {@code null} if nothing was removed. | [
"Removes",
"the",
"given",
"entry",
"from",
"the",
"Map",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/AbstractDecoratedMap.java#L232-L245 |
62,551 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java | ExTagSupport.writeHtml | public void writeHtml(JspWriter pOut, String pHtml) throws IOException {
StringTokenizer parser = new StringTokenizer(pHtml, "<>&", true);
while (parser.hasMoreTokens()) {
String token = parser.nextToken();
if (token.equals("<")) {
pOut.print("<");
... | java | public void writeHtml(JspWriter pOut, String pHtml) throws IOException {
StringTokenizer parser = new StringTokenizer(pHtml, "<>&", true);
while (parser.hasMoreTokens()) {
String token = parser.nextToken();
if (token.equals("<")) {
pOut.print("<");
... | [
"public",
"void",
"writeHtml",
"(",
"JspWriter",
"pOut",
",",
"String",
"pHtml",
")",
"throws",
"IOException",
"{",
"StringTokenizer",
"parser",
"=",
"new",
"StringTokenizer",
"(",
"pHtml",
",",
"\"<>&\"",
",",
"true",
")",
";",
"while",
"(",
"parser",
".",
... | writeHtml ensures that the text being outputted appears as it was
entered. This prevents users from hacking the system by entering
html or jsp code into an entry form where that value will be displayed
later in the site.
@param pOut The JspWriter to write the output to.
@param pHtml The original html to filter and ou... | [
"writeHtml",
"ensures",
"that",
"the",
"text",
"being",
"outputted",
"appears",
"as",
"it",
"was",
"entered",
".",
"This",
"prevents",
"users",
"from",
"hacking",
"the",
"system",
"by",
"entering",
"html",
"or",
"jsp",
"code",
"into",
"an",
"entry",
"form",
... | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java#L56-L75 |
62,552 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java | ExTagSupport.getInitParameter | public String getInitParameter(String pName, int pScope) {
switch (pScope) {
case PageContext.PAGE_SCOPE:
return getServletConfig().getInitParameter(pName);
case PageContext.APPLICATION_SCOPE:
return getServletContext().getInitParameter(pName);
... | java | public String getInitParameter(String pName, int pScope) {
switch (pScope) {
case PageContext.PAGE_SCOPE:
return getServletConfig().getInitParameter(pName);
case PageContext.APPLICATION_SCOPE:
return getServletContext().getInitParameter(pName);
... | [
"public",
"String",
"getInitParameter",
"(",
"String",
"pName",
",",
"int",
"pScope",
")",
"{",
"switch",
"(",
"pScope",
")",
"{",
"case",
"PageContext",
".",
"PAGE_SCOPE",
":",
"return",
"getServletConfig",
"(",
")",
".",
"getInitParameter",
"(",
"pName",
"... | Returns the initialisation parameter from the scope specified with the
name specified.
@param pName The name of the initialisation parameter to return the
value for.
@param pScope The scope to search for the initialisation parameter
within.
@return The value of the parameter found. If no parameter with the
name speci... | [
"Returns",
"the",
"initialisation",
"parameter",
"from",
"the",
"scope",
"specified",
"with",
"the",
"name",
"specified",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java#L211-L220 |
62,553 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java | ExTagSupport.getInitParameterNames | public Enumeration getInitParameterNames(int pScope) {
switch (pScope) {
case PageContext.PAGE_SCOPE:
return getServletConfig().getInitParameterNames();
case PageContext.APPLICATION_SCOPE:
return getServletContext().getInitParameterNames();
... | java | public Enumeration getInitParameterNames(int pScope) {
switch (pScope) {
case PageContext.PAGE_SCOPE:
return getServletConfig().getInitParameterNames();
case PageContext.APPLICATION_SCOPE:
return getServletContext().getInitParameterNames();
... | [
"public",
"Enumeration",
"getInitParameterNames",
"(",
"int",
"pScope",
")",
"{",
"switch",
"(",
"pScope",
")",
"{",
"case",
"PageContext",
".",
"PAGE_SCOPE",
":",
"return",
"getServletConfig",
"(",
")",
".",
"getInitParameterNames",
"(",
")",
";",
"case",
"Pa... | Returns an enumeration containing all the parameters defined in the
scope specified by the parameter.
@param pScope The scope to return the names of all the parameters
defined within.
@return An {@code Enumeration} containing all the names for all the
parameters defined in the scope passed in as a parameter. | [
"Returns",
"an",
"enumeration",
"containing",
"all",
"the",
"parameters",
"defined",
"in",
"the",
"scope",
"specified",
"by",
"the",
"parameter",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java#L232-L241 |
62,554 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java | ExTagSupport.getResourceAsStream | public InputStream getResourceAsStream(String pPath) {
//throws MalformedURLException {
String path = pPath;
if (pPath != null && !pPath.startsWith("/")) {
path = getContextPath() + pPath;
}
return pageContext.getServletContext().getResourceAsStream(path);
... | java | public InputStream getResourceAsStream(String pPath) {
//throws MalformedURLException {
String path = pPath;
if (pPath != null && !pPath.startsWith("/")) {
path = getContextPath() + pPath;
}
return pageContext.getServletContext().getResourceAsStream(path);
... | [
"public",
"InputStream",
"getResourceAsStream",
"(",
"String",
"pPath",
")",
"{",
"//throws MalformedURLException {\r",
"String",
"path",
"=",
"pPath",
";",
"if",
"(",
"pPath",
"!=",
"null",
"&&",
"!",
"pPath",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
... | Gets the resource associated with the given relative path for the
current JSP page request.
The path may be absolute, or relative to the current context root.
@param pPath the path
@return a path relative to the current context root | [
"Gets",
"the",
"resource",
"associated",
"with",
"the",
"given",
"relative",
"path",
"for",
"the",
"current",
"JSP",
"page",
"request",
".",
"The",
"path",
"may",
"be",
"absolute",
"or",
"relative",
"to",
"the",
"current",
"context",
"root",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java#L281-L290 |
62,555 | haraldk/TwelveMonkeys | imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/ColorSpaces.java | ColorSpaces.isCS_sRGB | public static boolean isCS_sRGB(final ICC_Profile profile) {
Validate.notNull(profile, "profile");
return profile.getColorSpaceType() == ColorSpace.TYPE_RGB && Arrays.equals(getProfileHeaderWithProfileId(profile), sRGB.header);
} | java | public static boolean isCS_sRGB(final ICC_Profile profile) {
Validate.notNull(profile, "profile");
return profile.getColorSpaceType() == ColorSpace.TYPE_RGB && Arrays.equals(getProfileHeaderWithProfileId(profile), sRGB.header);
} | [
"public",
"static",
"boolean",
"isCS_sRGB",
"(",
"final",
"ICC_Profile",
"profile",
")",
"{",
"Validate",
".",
"notNull",
"(",
"profile",
",",
"\"profile\"",
")",
";",
"return",
"profile",
".",
"getColorSpaceType",
"(",
")",
"==",
"ColorSpace",
".",
"TYPE_RGB"... | Tests whether an ICC color profile is equal to the default sRGB profile.
@param profile the ICC profile to test. May not be {@code null}.
@return {@code true} if {@code profile} is equal to the default sRGB profile.
@throws IllegalArgumentException if {@code profile} is {@code null}
@see java.awt.color.ColorSpace#isC... | [
"Tests",
"whether",
"an",
"ICC",
"color",
"profile",
"is",
"equal",
"to",
"the",
"default",
"sRGB",
"profile",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/color/ColorSpaces.java#L236-L240 |
62,556 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/convert/DateConverter.java | DateConverter.toObject | public Object toObject(String pString, Class pType, String pFormat) throws ConversionException {
if (StringUtil.isEmpty(pString))
return null;
try {
DateFormat format;
if (pFormat == null) {
// Use system default format, using default lo... | java | public Object toObject(String pString, Class pType, String pFormat) throws ConversionException {
if (StringUtil.isEmpty(pString))
return null;
try {
DateFormat format;
if (pFormat == null) {
// Use system default format, using default lo... | [
"public",
"Object",
"toObject",
"(",
"String",
"pString",
",",
"Class",
"pType",
",",
"String",
"pFormat",
")",
"throws",
"ConversionException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"pString",
")",
")",
"return",
"null",
";",
"try",
"{",
"Dat... | Converts the string to a date, using the given format for parsing.
@param pString the string to convert.
@param pType the type to convert to. {@code java.util.Date} and
subclasses allowed.
@param pFormat the format used for parsing. Must be a legal
{@code SimpleDateFormat} format, or {@code null} which will use the
de... | [
"Converts",
"the",
"string",
"to",
"a",
"date",
"using",
"the",
"given",
"format",
"for",
"parsing",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/convert/DateConverter.java#L76-L112 |
62,557 | haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/DiffusionDither.java | DiffusionDither.toRGBArray | private static int[] toRGBArray(int pARGB, int[] pBuffer) {
pBuffer[0] = ((pARGB & 0x00ff0000) >> 16);
pBuffer[1] = ((pARGB & 0x0000ff00) >> 8);
pBuffer[2] = ((pARGB & 0x000000ff));
//pBuffer[3] = ((pARGB & 0xff000000) >> 24); // alpha
return pBuffer;
} | java | private static int[] toRGBArray(int pARGB, int[] pBuffer) {
pBuffer[0] = ((pARGB & 0x00ff0000) >> 16);
pBuffer[1] = ((pARGB & 0x0000ff00) >> 8);
pBuffer[2] = ((pARGB & 0x000000ff));
//pBuffer[3] = ((pARGB & 0xff000000) >> 24); // alpha
return pBuffer;
} | [
"private",
"static",
"int",
"[",
"]",
"toRGBArray",
"(",
"int",
"pARGB",
",",
"int",
"[",
"]",
"pBuffer",
")",
"{",
"pBuffer",
"[",
"0",
"]",
"=",
"(",
"(",
"pARGB",
"&",
"0x00ff0000",
")",
">>",
"16",
")",
";",
"pBuffer",
"[",
"1",
"]",
"=",
"... | Converts an int ARGB to int triplet. | [
"Converts",
"an",
"int",
"ARGB",
"to",
"int",
"triplet",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/DiffusionDither.java#L215-L222 |
62,558 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/ScaleFilter.java | ScaleFilter.doFilter | protected RenderedImage doFilter(BufferedImage pImage, ServletRequest pRequest, ImageServletResponse pResponse) {
// Get quality setting
// SMOOTH | FAST | REPLICATE | DEFAULT | AREA_AVERAGING
// See Image (mHints)
int quality = getQuality(pRequest.getParameter(PARAM_SCALE_QUALITY)... | java | protected RenderedImage doFilter(BufferedImage pImage, ServletRequest pRequest, ImageServletResponse pResponse) {
// Get quality setting
// SMOOTH | FAST | REPLICATE | DEFAULT | AREA_AVERAGING
// See Image (mHints)
int quality = getQuality(pRequest.getParameter(PARAM_SCALE_QUALITY)... | [
"protected",
"RenderedImage",
"doFilter",
"(",
"BufferedImage",
"pImage",
",",
"ServletRequest",
"pRequest",
",",
"ImageServletResponse",
"pResponse",
")",
"{",
"// Get quality setting\r",
"// SMOOTH | FAST | REPLICATE | DEFAULT | AREA_AVERAGING\r",
"// See Image (mHints)\r",
"int"... | Reads the image from the requested URL, scales it, and returns it in the
Servlet stream. See above for details on parameters. | [
"Reads",
"the",
"image",
"from",
"the",
"requested",
"URL",
"scales",
"it",
"and",
"returns",
"it",
"in",
"the",
"Servlet",
"stream",
".",
"See",
"above",
"for",
"details",
"on",
"parameters",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/ScaleFilter.java#L134-L164 |
62,559 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/ScaleFilter.java | ScaleFilter.getQuality | protected int getQuality(String pQualityStr) {
if (!StringUtil.isEmpty(pQualityStr)) {
try {
// Get quality constant from Image using reflection
Class cl = Image.class;
Field field = cl.getField(pQualityStr.toUpperCase());
retur... | java | protected int getQuality(String pQualityStr) {
if (!StringUtil.isEmpty(pQualityStr)) {
try {
// Get quality constant from Image using reflection
Class cl = Image.class;
Field field = cl.getField(pQualityStr.toUpperCase());
retur... | [
"protected",
"int",
"getQuality",
"(",
"String",
"pQualityStr",
")",
"{",
"if",
"(",
"!",
"StringUtil",
".",
"isEmpty",
"(",
"pQualityStr",
")",
")",
"{",
"try",
"{",
"// Get quality constant from Image using reflection\r",
"Class",
"cl",
"=",
"Image",
".",
"cla... | Gets the quality constant for the scaling, from the string argument.
@param pQualityStr The string representation of the scale quality
constant.
@return The matching quality constant, or the default quality if none
was found.
@see java.awt.Image
@see java.awt.Image#getScaledInstance(int,int,int) | [
"Gets",
"the",
"quality",
"constant",
"for",
"the",
"scaling",
"from",
"the",
"string",
"argument",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/ScaleFilter.java#L176-L194 |
62,560 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/ScaleFilter.java | ScaleFilter.getUnits | protected int getUnits(String pUnitStr) {
if (StringUtil.isEmpty(pUnitStr)
|| pUnitStr.equalsIgnoreCase("PIXELS")) {
return UNITS_PIXELS;
}
else if (pUnitStr.equalsIgnoreCase("PERCENT")) {
return UNITS_PERCENT;
}
else {
... | java | protected int getUnits(String pUnitStr) {
if (StringUtil.isEmpty(pUnitStr)
|| pUnitStr.equalsIgnoreCase("PIXELS")) {
return UNITS_PIXELS;
}
else if (pUnitStr.equalsIgnoreCase("PERCENT")) {
return UNITS_PERCENT;
}
else {
... | [
"protected",
"int",
"getUnits",
"(",
"String",
"pUnitStr",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"pUnitStr",
")",
"||",
"pUnitStr",
".",
"equalsIgnoreCase",
"(",
"\"PIXELS\"",
")",
")",
"{",
"return",
"UNITS_PIXELS",
";",
"}",
"else",
"if... | Gets the units constant for the width and height arguments, from the
given string argument.
@param pUnitStr The string representation of the units constant,
can be one of "PIXELS" or "PERCENT".
@return The mathcing units constant, or UNITS_UNKNOWN if none was found. | [
"Gets",
"the",
"units",
"constant",
"for",
"the",
"width",
"and",
"height",
"arguments",
"from",
"the",
"given",
"string",
"argument",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/ScaleFilter.java#L208-L219 |
62,561 | haraldk/TwelveMonkeys | imageio/imageio-jpeg/src/main/java/com/twelvemonkeys/imageio/plugins/jpeg/JPEGLosslessDecoder.java | JPEGLosslessDecoder.getHuffmanValue | private int getHuffmanValue(final int table[], final int temp[], final int index[]) throws IOException {
int code, input;
final int mask = 0xFFFF;
if (index[0] < 8) {
temp[0] <<= 8;
input = this.input.readUnsignedByte();
if (input == 0xFF) {
m... | java | private int getHuffmanValue(final int table[], final int temp[], final int index[]) throws IOException {
int code, input;
final int mask = 0xFFFF;
if (index[0] < 8) {
temp[0] <<= 8;
input = this.input.readUnsignedByte();
if (input == 0xFF) {
m... | [
"private",
"int",
"getHuffmanValue",
"(",
"final",
"int",
"table",
"[",
"]",
",",
"final",
"int",
"temp",
"[",
"]",
",",
"final",
"int",
"index",
"[",
"]",
")",
"throws",
"IOException",
"{",
"int",
"code",
",",
"input",
";",
"final",
"int",
"mask",
"... | will not be called | [
"will",
"not",
"be",
"called"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-jpeg/src/main/java/com/twelvemonkeys/imageio/plugins/jpeg/JPEGLosslessDecoder.java#L548-L604 |
62,562 | haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/enc/EncoderStream.java | EncoderStream.write | public void write(final byte[] pBytes, final int pOffset, final int pLength) throws IOException {
if (!flushOnWrite && pLength < buffer.remaining()) {
// Buffer data
buffer.put(pBytes, pOffset, pLength);
}
else {
// Encode data already in the buffer
... | java | public void write(final byte[] pBytes, final int pOffset, final int pLength) throws IOException {
if (!flushOnWrite && pLength < buffer.remaining()) {
// Buffer data
buffer.put(pBytes, pOffset, pLength);
}
else {
// Encode data already in the buffer
... | [
"public",
"void",
"write",
"(",
"final",
"byte",
"[",
"]",
"pBytes",
",",
"final",
"int",
"pOffset",
",",
"final",
"int",
"pLength",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"flushOnWrite",
"&&",
"pLength",
"<",
"buffer",
".",
"remaining",
"(",... | tell the EncoderStream how large buffer it prefers... | [
"tell",
"the",
"EncoderStream",
"how",
"large",
"buffer",
"it",
"prefers",
"..."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/enc/EncoderStream.java#L116-L128 |
62,563 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java | NetUtil.getURLAndSetAuthorization | private static URL getURLAndSetAuthorization(final String pURL, final Properties pProperties) throws MalformedURLException {
String url = pURL;
// Split user/password away from url
String userPass = null;
String protocolPrefix = HTTP;
int httpIdx = url.indexOf(HTTPS);
if... | java | private static URL getURLAndSetAuthorization(final String pURL, final Properties pProperties) throws MalformedURLException {
String url = pURL;
// Split user/password away from url
String userPass = null;
String protocolPrefix = HTTP;
int httpIdx = url.indexOf(HTTPS);
if... | [
"private",
"static",
"URL",
"getURLAndSetAuthorization",
"(",
"final",
"String",
"pURL",
",",
"final",
"Properties",
"pProperties",
")",
"throws",
"MalformedURLException",
"{",
"String",
"url",
"=",
"pURL",
";",
"// Split user/password away from url",
"String",
"userPas... | Registers the password from the URL string, and returns the URL object.
@param pURL the string representation of the URL, possibly including authorization part
@param pProperties the
@return the URL created from {@code pURL}.
@throws java.net.MalformedURLException if there's a syntax error in {@code pURL} | [
"Registers",
"the",
"password",
"from",
"the",
"URL",
"string",
"and",
"returns",
"the",
"URL",
"object",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java#L597-L631 |
62,564 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java | NetUtil.createHttpURLConnection | public static HttpURLConnection createHttpURLConnection(URL pURL, Properties pProperties, boolean pFollowRedirects, int pTimeout)
throws IOException {
// Open the connection, and get the stream
HttpURLConnection conn;
if (pTimeout > 0) {
// Supports timeout
... | java | public static HttpURLConnection createHttpURLConnection(URL pURL, Properties pProperties, boolean pFollowRedirects, int pTimeout)
throws IOException {
// Open the connection, and get the stream
HttpURLConnection conn;
if (pTimeout > 0) {
// Supports timeout
... | [
"public",
"static",
"HttpURLConnection",
"createHttpURLConnection",
"(",
"URL",
"pURL",
",",
"Properties",
"pProperties",
",",
"boolean",
"pFollowRedirects",
",",
"int",
"pTimeout",
")",
"throws",
"IOException",
"{",
"// Open the connection, and get the stream",
"HttpURLCon... | Creates a HTTP connection to the given URL.
@param pURL the URL to get.
@param pProperties connection properties.
@param pFollowRedirects specifies whether we should follow redirects.
@param pTimeout the specified timeout, in milliseconds.
@return a HttpURLConnection
@throws UnknownHostExcepti... | [
"Creates",
"a",
"HTTP",
"connection",
"to",
"the",
"given",
"URL",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java#L869-L919 |
62,565 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/BASE64.java | BASE64.encode | public static String encode(byte[] pData) {
int offset = 0;
int len;
StringBuilder buf = new StringBuilder();
while ((pData.length - offset) > 0) {
byte a, b, c;
if ((pData.length - offset) > 2) {
len = 3;
}
else {
... | java | public static String encode(byte[] pData) {
int offset = 0;
int len;
StringBuilder buf = new StringBuilder();
while ((pData.length - offset) > 0) {
byte a, b, c;
if ((pData.length - offset) > 2) {
len = 3;
}
else {
... | [
"public",
"static",
"String",
"encode",
"(",
"byte",
"[",
"]",
"pData",
")",
"{",
"int",
"offset",
"=",
"0",
";",
"int",
"len",
";",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"while",
"(",
"(",
"pData",
".",
"length",
"-",
... | Encodes the input data using the standard base64 encoding scheme.
@param pData the bytes to encode to base64
@return a string with base64 encoded data | [
"Encodes",
"the",
"input",
"data",
"using",
"the",
"standard",
"base64",
"encoding",
"scheme",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/BASE64.java#L68-L116 |
62,566 | haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java | BufferedImageFactory.setSourceSubsampling | public void setSourceSubsampling(int pXSub, int pYSub) {
// Re-fetch everything, if subsampling changed
if (xSub != pXSub || ySub != pYSub) {
dispose();
}
if (pXSub > 1) {
xSub = pXSub;
}
if (pYSub > 1) {
ySub = pYSub;
}
} | java | public void setSourceSubsampling(int pXSub, int pYSub) {
// Re-fetch everything, if subsampling changed
if (xSub != pXSub || ySub != pYSub) {
dispose();
}
if (pXSub > 1) {
xSub = pXSub;
}
if (pYSub > 1) {
ySub = pYSub;
}
} | [
"public",
"void",
"setSourceSubsampling",
"(",
"int",
"pXSub",
",",
"int",
"pYSub",
")",
"{",
"// Re-fetch everything, if subsampling changed",
"if",
"(",
"xSub",
"!=",
"pXSub",
"||",
"ySub",
"!=",
"pYSub",
")",
"{",
"dispose",
"(",
")",
";",
"}",
"if",
"(",... | Sets the source subsampling for the new image.
@param pXSub horizontal subsampling factor
@param pYSub vertical subsampling factor | [
"Sets",
"the",
"source",
"subsampling",
"for",
"the",
"new",
"image",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java#L176-L188 |
62,567 | haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java | BufferedImageFactory.addProgressListener | public void addProgressListener(ProgressListener pListener) {
if (pListener == null) {
return;
}
if (listeners == null) {
listeners = new CopyOnWriteArrayList<ProgressListener>();
}
listeners.add(pListener);
} | java | public void addProgressListener(ProgressListener pListener) {
if (pListener == null) {
return;
}
if (listeners == null) {
listeners = new CopyOnWriteArrayList<ProgressListener>();
}
listeners.add(pListener);
} | [
"public",
"void",
"addProgressListener",
"(",
"ProgressListener",
"pListener",
")",
"{",
"if",
"(",
"pListener",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"listeners",
"==",
"null",
")",
"{",
"listeners",
"=",
"new",
"CopyOnWriteArrayList",
"<",... | Adds a progress listener to this factory.
@param pListener the progress listener | [
"Adds",
"a",
"progress",
"listener",
"to",
"this",
"factory",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java#L283-L293 |
62,568 | haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java | BufferedImageFactory.removeProgressListener | public void removeProgressListener(ProgressListener pListener) {
if (pListener == null) {
return;
}
if (listeners == null) {
return;
}
listeners.remove(pListener);
} | java | public void removeProgressListener(ProgressListener pListener) {
if (pListener == null) {
return;
}
if (listeners == null) {
return;
}
listeners.remove(pListener);
} | [
"public",
"void",
"removeProgressListener",
"(",
"ProgressListener",
"pListener",
")",
"{",
"if",
"(",
"pListener",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"listeners",
"==",
"null",
")",
"{",
"return",
";",
"}",
"listeners",
".",
"remove",
... | Removes a progress listener from this factory.
@param pListener the progress listener | [
"Removes",
"a",
"progress",
"listener",
"from",
"this",
"factory",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/BufferedImageFactory.java#L300-L310 |
62,569 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java | SimpleAuthenticator.getPasswordAuthentication | protected PasswordAuthentication getPasswordAuthentication() {
// Don't worry, this is just a hack to figure out if we were able
// to set this Authenticator through the setDefault method.
if (!sInitialized && MAGIC.equals(getRequestingScheme()) && getRequestingPort() == FOURTYTWO) {
... | java | protected PasswordAuthentication getPasswordAuthentication() {
// Don't worry, this is just a hack to figure out if we were able
// to set this Authenticator through the setDefault method.
if (!sInitialized && MAGIC.equals(getRequestingScheme()) && getRequestingPort() == FOURTYTWO) {
... | [
"protected",
"PasswordAuthentication",
"getPasswordAuthentication",
"(",
")",
"{",
"// Don't worry, this is just a hack to figure out if we were able",
"// to set this Authenticator through the setDefault method.",
"if",
"(",
"!",
"sInitialized",
"&&",
"MAGIC",
".",
"equals",
"(",
... | Gets the PasswordAuthentication for the request. Called when password
authorization is needed.
@return The PasswordAuthentication collected from the user, or null if
none is provided. | [
"Gets",
"the",
"PasswordAuthentication",
"for",
"the",
"request",
".",
"Called",
"when",
"password",
"authorization",
"is",
"needed",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java#L120-L151 |
62,570 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java | SimpleAuthenticator.registerPasswordAuthentication | public PasswordAuthentication registerPasswordAuthentication(URL pURL, PasswordAuthentication pPA) {
return registerPasswordAuthentication(NetUtil.createInetAddressFromURL(pURL),
pURL.getPort(),
pURL.getProtocol(),
null, // Prompt/Realm
BASIC,
... | java | public PasswordAuthentication registerPasswordAuthentication(URL pURL, PasswordAuthentication pPA) {
return registerPasswordAuthentication(NetUtil.createInetAddressFromURL(pURL),
pURL.getPort(),
pURL.getProtocol(),
null, // Prompt/Realm
BASIC,
... | [
"public",
"PasswordAuthentication",
"registerPasswordAuthentication",
"(",
"URL",
"pURL",
",",
"PasswordAuthentication",
"pPA",
")",
"{",
"return",
"registerPasswordAuthentication",
"(",
"NetUtil",
".",
"createInetAddressFromURL",
"(",
"pURL",
")",
",",
"pURL",
".",
"ge... | Registers a PasswordAuthentication with a given URL address. | [
"Registers",
"a",
"PasswordAuthentication",
"with",
"a",
"given",
"URL",
"address",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java#L154-L161 |
62,571 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java | SimpleAuthenticator.registerPasswordAuthentication | public PasswordAuthentication registerPasswordAuthentication(InetAddress pAddress, int pPort, String pProtocol, String pPrompt, String pScheme, PasswordAuthentication pPA) {
/*
System.err.println("registerPasswordAuthentication");
System.err.println(pAddress);
System.err.println(pPort... | java | public PasswordAuthentication registerPasswordAuthentication(InetAddress pAddress, int pPort, String pProtocol, String pPrompt, String pScheme, PasswordAuthentication pPA) {
/*
System.err.println("registerPasswordAuthentication");
System.err.println(pAddress);
System.err.println(pPort... | [
"public",
"PasswordAuthentication",
"registerPasswordAuthentication",
"(",
"InetAddress",
"pAddress",
",",
"int",
"pPort",
",",
"String",
"pProtocol",
",",
"String",
"pPrompt",
",",
"String",
"pScheme",
",",
"PasswordAuthentication",
"pPA",
")",
"{",
"/*\n Syste... | Registers a PasswordAuthentication with a given net address. | [
"Registers",
"a",
"PasswordAuthentication",
"with",
"a",
"given",
"net",
"address",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java#L164-L175 |
62,572 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java | SimpleAuthenticator.unregisterPasswordAuthentication | public PasswordAuthentication unregisterPasswordAuthentication(URL pURL) {
return unregisterPasswordAuthentication(NetUtil.createInetAddressFromURL(pURL), pURL.getPort(), pURL.getProtocol(), null, BASIC);
} | java | public PasswordAuthentication unregisterPasswordAuthentication(URL pURL) {
return unregisterPasswordAuthentication(NetUtil.createInetAddressFromURL(pURL), pURL.getPort(), pURL.getProtocol(), null, BASIC);
} | [
"public",
"PasswordAuthentication",
"unregisterPasswordAuthentication",
"(",
"URL",
"pURL",
")",
"{",
"return",
"unregisterPasswordAuthentication",
"(",
"NetUtil",
".",
"createInetAddressFromURL",
"(",
"pURL",
")",
",",
"pURL",
".",
"getPort",
"(",
")",
",",
"pURL",
... | Unregisters a PasswordAuthentication with a given URL address. | [
"Unregisters",
"a",
"PasswordAuthentication",
"with",
"a",
"given",
"URL",
"address",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java#L178-L180 |
62,573 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java | SimpleAuthenticator.unregisterPasswordAuthentication | public PasswordAuthentication unregisterPasswordAuthentication(InetAddress pAddress, int pPort, String pProtocol, String pPrompt, String pScheme) {
return passwordAuthentications.remove(new AuthKey(pAddress, pPort, pProtocol, pPrompt, pScheme));
} | java | public PasswordAuthentication unregisterPasswordAuthentication(InetAddress pAddress, int pPort, String pProtocol, String pPrompt, String pScheme) {
return passwordAuthentications.remove(new AuthKey(pAddress, pPort, pProtocol, pPrompt, pScheme));
} | [
"public",
"PasswordAuthentication",
"unregisterPasswordAuthentication",
"(",
"InetAddress",
"pAddress",
",",
"int",
"pPort",
",",
"String",
"pProtocol",
",",
"String",
"pPrompt",
",",
"String",
"pScheme",
")",
"{",
"return",
"passwordAuthentications",
".",
"remove",
"... | Unregisters a PasswordAuthentication with a given net address. | [
"Unregisters",
"a",
"PasswordAuthentication",
"with",
"a",
"given",
"net",
"address",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/SimpleAuthenticator.java#L183-L185 |
62,574 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/BrowserHelperFilter.java | BrowserHelperFilter.setAcceptMappingsFile | @InitParam(name = "accept-mappings-file")
public void setAcceptMappingsFile(String pPropertiesFile) throws ServletConfigException {
// NOTE: Format is:
// <agent-name>=<reg-exp>
// <agent-name>.accept=<http-accept-header>
Properties mappings = new Properties();
try {
... | java | @InitParam(name = "accept-mappings-file")
public void setAcceptMappingsFile(String pPropertiesFile) throws ServletConfigException {
// NOTE: Format is:
// <agent-name>=<reg-exp>
// <agent-name>.accept=<http-accept-header>
Properties mappings = new Properties();
try {
... | [
"@",
"InitParam",
"(",
"name",
"=",
"\"accept-mappings-file\"",
")",
"public",
"void",
"setAcceptMappingsFile",
"(",
"String",
"pPropertiesFile",
")",
"throws",
"ServletConfigException",
"{",
"// NOTE: Format is:",
"// <agent-name>=<reg-exp>",
"// <agent-name>.accept=<http-acce... | Sets the accept-mappings for this filter
@param pPropertiesFile name of accept-mappings properties files
@throws ServletConfigException if the accept-mappings properties
file cannot be read. | [
"Sets",
"the",
"accept",
"-",
"mappings",
"for",
"this",
"filter"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/BrowserHelperFilter.java#L68-L87 |
62,575 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/TrimWhiteSpaceTag.java | TrimWhiteSpaceTag.doEndTag | public int doEndTag() throws JspException {
// Trim
String trimmed = truncateWS(bodyContent.getString());
try {
// Print trimmed content
//pageContext.getOut().print("<!--TWS-->\n");
pageContext.getOut().print(trimmed);
//pageContext.getOut(... | java | public int doEndTag() throws JspException {
// Trim
String trimmed = truncateWS(bodyContent.getString());
try {
// Print trimmed content
//pageContext.getOut().print("<!--TWS-->\n");
pageContext.getOut().print(trimmed);
//pageContext.getOut(... | [
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"// Trim\r",
"String",
"trimmed",
"=",
"truncateWS",
"(",
"bodyContent",
".",
"getString",
"(",
")",
")",
";",
"try",
"{",
"// Print trimmed content\r",
"//pageContext.getOut().print(\"<!--TWS-->\\n... | doEndTag implementation, truncates all whitespace.
@return {@code super.doEndTag()} | [
"doEndTag",
"implementation",
"truncates",
"all",
"whitespace",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/TrimWhiteSpaceTag.java#L36-L50 |
62,576 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/TrimWhiteSpaceTag.java | TrimWhiteSpaceTag.truncateWS | private static String truncateWS(String pStr) {
char[] chars = pStr.toCharArray();
int count = 0;
boolean lastWasWS = true; // Avoids leading WS
for (int i = 0; i < chars.length; i++) {
if (!Character.isWhitespace(chars[i])) {
// if char is not WS, jus... | java | private static String truncateWS(String pStr) {
char[] chars = pStr.toCharArray();
int count = 0;
boolean lastWasWS = true; // Avoids leading WS
for (int i = 0; i < chars.length; i++) {
if (!Character.isWhitespace(chars[i])) {
// if char is not WS, jus... | [
"private",
"static",
"String",
"truncateWS",
"(",
"String",
"pStr",
")",
"{",
"char",
"[",
"]",
"chars",
"=",
"pStr",
".",
"toCharArray",
"(",
")",
";",
"int",
"count",
"=",
"0",
";",
"boolean",
"lastWasWS",
"=",
"true",
";",
"// Avoids leading WS\r",
"f... | Truncates whitespace from the given string.
@todo Candidate for StringUtil? | [
"Truncates",
"whitespace",
"from",
"the",
"given",
"string",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/TrimWhiteSpaceTag.java#L58-L85 |
62,577 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/ImageFilter.java | ImageFilter.createImageServletResponse | private ImageServletResponse createImageServletResponse(final ServletRequest pRequest, final ServletResponse pResponse) {
if (pResponse instanceof ImageServletResponseImpl) {
ImageServletResponseImpl response = (ImageServletResponseImpl) pResponse;
// response.setRequest(pRequest);
... | java | private ImageServletResponse createImageServletResponse(final ServletRequest pRequest, final ServletResponse pResponse) {
if (pResponse instanceof ImageServletResponseImpl) {
ImageServletResponseImpl response = (ImageServletResponseImpl) pResponse;
// response.setRequest(pRequest);
... | [
"private",
"ImageServletResponse",
"createImageServletResponse",
"(",
"final",
"ServletRequest",
"pRequest",
",",
"final",
"ServletResponse",
"pResponse",
")",
"{",
"if",
"(",
"pResponse",
"instanceof",
"ImageServletResponseImpl",
")",
"{",
"ImageServletResponseImpl",
"resp... | Creates the image servlet response for this response.
@param pResponse the original response
@param pRequest the original request
@return the new response, or {@code pResponse} if the response is already wrapped
@see com.twelvemonkeys.servlet.image.ImageServletResponseWrapper | [
"Creates",
"the",
"image",
"servlet",
"response",
"for",
"this",
"response",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/ImageFilter.java#L151-L159 |
62,578 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/RotateFilter.java | RotateFilter.doFilter | protected RenderedImage doFilter(BufferedImage pImage, ServletRequest pRequest, ImageServletResponse pResponse) {
// Get angle
double ang = getAngle(pRequest);
// Get bounds
Rectangle2D rect = getBounds(pRequest, pImage, ang);
int width = (int) rect.getWidth();
in... | java | protected RenderedImage doFilter(BufferedImage pImage, ServletRequest pRequest, ImageServletResponse pResponse) {
// Get angle
double ang = getAngle(pRequest);
// Get bounds
Rectangle2D rect = getBounds(pRequest, pImage, ang);
int width = (int) rect.getWidth();
in... | [
"protected",
"RenderedImage",
"doFilter",
"(",
"BufferedImage",
"pImage",
",",
"ServletRequest",
"pRequest",
",",
"ImageServletResponse",
"pResponse",
")",
"{",
"// Get angle\r",
"double",
"ang",
"=",
"getAngle",
"(",
"pRequest",
")",
";",
"// Get bounds\r",
"Rectangl... | Reads the image from the requested URL, rotates it, and returns
it in the
Servlet stream. See above for details on parameters. | [
"Reads",
"the",
"image",
"from",
"the",
"requested",
"URL",
"rotates",
"it",
"and",
"returns",
"it",
"in",
"the",
"Servlet",
"stream",
".",
"See",
"above",
"for",
"details",
"on",
"parameters",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/RotateFilter.java#L106-L147 |
62,579 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/RotateFilter.java | RotateFilter.getAngle | private double getAngle(ServletRequest pReq) {
double angle = 0.0;
String str = pReq.getParameter(PARAM_ANGLE);
if (!StringUtil.isEmpty(str)) {
angle = Double.parseDouble(str);
// Convert to radians, if needed
str = pReq.getParameter(PARAM_ANGLE_UNITS)... | java | private double getAngle(ServletRequest pReq) {
double angle = 0.0;
String str = pReq.getParameter(PARAM_ANGLE);
if (!StringUtil.isEmpty(str)) {
angle = Double.parseDouble(str);
// Convert to radians, if needed
str = pReq.getParameter(PARAM_ANGLE_UNITS)... | [
"private",
"double",
"getAngle",
"(",
"ServletRequest",
"pReq",
")",
"{",
"double",
"angle",
"=",
"0.0",
";",
"String",
"str",
"=",
"pReq",
".",
"getParameter",
"(",
"PARAM_ANGLE",
")",
";",
"if",
"(",
"!",
"StringUtil",
".",
"isEmpty",
"(",
"str",
")",
... | Gets the angle of rotation. | [
"Gets",
"the",
"angle",
"of",
"rotation",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/RotateFilter.java#L153-L168 |
62,580 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/RotateFilter.java | RotateFilter.getBounds | private Rectangle2D getBounds(ServletRequest pReq, BufferedImage pImage,
double pAng) {
// Get dimensions of original image
int width = pImage.getWidth(); // loads the image
int height = pImage.getHeight();
// Test if we want to crop image (defaul... | java | private Rectangle2D getBounds(ServletRequest pReq, BufferedImage pImage,
double pAng) {
// Get dimensions of original image
int width = pImage.getWidth(); // loads the image
int height = pImage.getHeight();
// Test if we want to crop image (defaul... | [
"private",
"Rectangle2D",
"getBounds",
"(",
"ServletRequest",
"pReq",
",",
"BufferedImage",
"pImage",
",",
"double",
"pAng",
")",
"{",
"// Get dimensions of original image\r",
"int",
"width",
"=",
"pImage",
".",
"getWidth",
"(",
")",
";",
"// loads the image\r",
"in... | Get the bounding rectangle of the rotated image. | [
"Get",
"the",
"bounding",
"rectangle",
"of",
"the",
"rotated",
"image",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/RotateFilter.java#L174-L202 |
62,581 | haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/InverseColorMap.java | InverseColorMap.initIRGB | void initIRGB(int[] pTemp) {
final int x = (1 << TRUNCBITS); // 8 the size of 1 Dimension of each quantized cell
final int xsqr = 1 << (TRUNCBITS * 2); // 64 - twice the smallest step size vale of quantized colors
final int xsqr2 = xsqr + xsqr;
for (int i = 0; i < numColors;... | java | void initIRGB(int[] pTemp) {
final int x = (1 << TRUNCBITS); // 8 the size of 1 Dimension of each quantized cell
final int xsqr = 1 << (TRUNCBITS * 2); // 64 - twice the smallest step size vale of quantized colors
final int xsqr2 = xsqr + xsqr;
for (int i = 0; i < numColors;... | [
"void",
"initIRGB",
"(",
"int",
"[",
"]",
"pTemp",
")",
"{",
"final",
"int",
"x",
"=",
"(",
"1",
"<<",
"TRUNCBITS",
")",
";",
"// 8 the size of 1 Dimension of each quantized cell\r",
"final",
"int",
"xsqr",
"=",
"1",
"<<",
"(",
"TRUNCBITS",
"*",
"2",
")",
... | Simple inverse color table creation method.
@param pTemp temp array | [
"Simple",
"inverse",
"color",
"table",
"creation",
"method",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/InverseColorMap.java#L130-L181 |
62,582 | haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/ReflectUtil.java | ReflectUtil.unwrapType | public static Class unwrapType(Class pType) {
if (pType == Boolean.class) {
return Boolean.TYPE;
}
else if (pType == Byte.class) {
return Byte.TYPE;
}
else if (pType == Character.class) {
return Character.TYPE;
}
else ... | java | public static Class unwrapType(Class pType) {
if (pType == Boolean.class) {
return Boolean.TYPE;
}
else if (pType == Byte.class) {
return Byte.TYPE;
}
else if (pType == Character.class) {
return Character.TYPE;
}
else ... | [
"public",
"static",
"Class",
"unwrapType",
"(",
"Class",
"pType",
")",
"{",
"if",
"(",
"pType",
"==",
"Boolean",
".",
"class",
")",
"{",
"return",
"Boolean",
".",
"TYPE",
";",
"}",
"else",
"if",
"(",
"pType",
"==",
"Byte",
".",
"class",
")",
"{",
"... | Returns the primitive type for the given wrapper type.
@param pType the wrapper type
@return the primitive type
@throws IllegalArgumentException if {@code pType} is not a primitive
wrapper | [
"Returns",
"the",
"primitive",
"type",
"for",
"the",
"given",
"wrapper",
"type",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/ReflectUtil.java#L57-L84 |
62,583 | haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java | CompoundDocument.canRead | private static boolean canRead(final DataInput pInput, final boolean pReset) {
long pos = FREE_SID;
if (pReset) {
try {
if (pInput instanceof InputStream && ((InputStream) pInput).markSupported()) {
((InputStream) pInput).mark(8);
}
... | java | private static boolean canRead(final DataInput pInput, final boolean pReset) {
long pos = FREE_SID;
if (pReset) {
try {
if (pInput instanceof InputStream && ((InputStream) pInput).markSupported()) {
((InputStream) pInput).mark(8);
}
... | [
"private",
"static",
"boolean",
"canRead",
"(",
"final",
"DataInput",
"pInput",
",",
"final",
"boolean",
"pReset",
")",
"{",
"long",
"pos",
"=",
"FREE_SID",
";",
"if",
"(",
"pReset",
")",
"{",
"try",
"{",
"if",
"(",
"pInput",
"instanceof",
"InputStream",
... | It's probably safer to create one version for InputStream and one for File | [
"It",
"s",
"probably",
"safer",
"to",
"create",
"one",
"version",
"for",
"InputStream",
"and",
"one",
"for",
"File"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java#L189-L247 |
62,584 | haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java | CompoundDocument.getSIdChain | private SIdChain getSIdChain(final int pSId, final long pStreamSize) throws IOException {
SIdChain chain = new SIdChain();
int[] sat = isShortStream(pStreamSize) ? shortSAT : SAT;
int sid = pSId;
while (sid != END_OF_CHAIN_SID && sid != FREE_SID) {
chain.addSID(sid);... | java | private SIdChain getSIdChain(final int pSId, final long pStreamSize) throws IOException {
SIdChain chain = new SIdChain();
int[] sat = isShortStream(pStreamSize) ? shortSAT : SAT;
int sid = pSId;
while (sid != END_OF_CHAIN_SID && sid != FREE_SID) {
chain.addSID(sid);... | [
"private",
"SIdChain",
"getSIdChain",
"(",
"final",
"int",
"pSId",
",",
"final",
"long",
"pStreamSize",
")",
"throws",
"IOException",
"{",
"SIdChain",
"chain",
"=",
"new",
"SIdChain",
"(",
")",
";",
"int",
"[",
"]",
"sat",
"=",
"isShortStream",
"(",
"pStre... | Gets the SIdChain for the given stream Id
@param pSId the stream Id
@param pStreamSize the size of the stream, or -1 for system control streams
@return the SIdChain for the given stream Id
@throws IOException if an I/O exception occurs | [
"Gets",
"the",
"SIdChain",
"for",
"the",
"given",
"stream",
"Id"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java#L414-L426 |
62,585 | haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java | CompoundDocument.seekToSId | private void seekToSId(final int pSId, final long pStreamSize) throws IOException {
long pos;
if (isShortStream(pStreamSize)) {
// The short stream is not continuous...
Entry root = getRootEntry();
if (shortStreamSIdChain == null) {
shortStream... | java | private void seekToSId(final int pSId, final long pStreamSize) throws IOException {
long pos;
if (isShortStream(pStreamSize)) {
// The short stream is not continuous...
Entry root = getRootEntry();
if (shortStreamSIdChain == null) {
shortStream... | [
"private",
"void",
"seekToSId",
"(",
"final",
"int",
"pSId",
",",
"final",
"long",
"pStreamSize",
")",
"throws",
"IOException",
"{",
"long",
"pos",
";",
"if",
"(",
"isShortStream",
"(",
"pStreamSize",
")",
")",
"{",
"// The short stream is not continuous...\r",
... | Seeks to the start pos for the given stream Id
@param pSId the stream Id
@param pStreamSize the size of the stream, or -1 for system control streams
@throws IOException if an I/O exception occurs | [
"Seeks",
"to",
"the",
"start",
"pos",
"for",
"the",
"given",
"stream",
"Id"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java#L439-L476 |
62,586 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.initPropertyValue | protected Object initPropertyValue(String pValue, String pType, String pFormat) throws ClassNotFoundException {
// System.out.println("pValue=" + pValue + " pType=" + pType
// + " pFormat=" + pFormat);
// No value to convert
if (pValue == null) {
return null;
}
/... | java | protected Object initPropertyValue(String pValue, String pType, String pFormat) throws ClassNotFoundException {
// System.out.println("pValue=" + pValue + " pType=" + pType
// + " pFormat=" + pFormat);
// No value to convert
if (pValue == null) {
return null;
}
/... | [
"protected",
"Object",
"initPropertyValue",
"(",
"String",
"pValue",
",",
"String",
"pType",
",",
"String",
"pFormat",
")",
"throws",
"ClassNotFoundException",
"{",
"// System.out.println(\"pValue=\" + pValue + \" pType=\" + pType\r",
"// + \" pFormat=\" + pFormat);... | Initializes the value of a property.
@todo move init code to the parser?
@throws ClassNotFoundException if there is no class found for the given
type
@throws IllegalArgumentException if the value given, is not parseable
as the given type | [
"Initializes",
"the",
"value",
"of",
"a",
"property",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L331-L404 |
62,587 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.createInstance | private Object createInstance(Class pClass, Object pParam) {
Object value;
try {
// Create param and argument arrays
Class[] param = { pParam.getClass() };
Object[] arg = { pParam };
// Get constructor
Constructor constructor = pClass.getDeclaredConstructor(param);
... | java | private Object createInstance(Class pClass, Object pParam) {
Object value;
try {
// Create param and argument arrays
Class[] param = { pParam.getClass() };
Object[] arg = { pParam };
// Get constructor
Constructor constructor = pClass.getDeclaredConstructor(param);
... | [
"private",
"Object",
"createInstance",
"(",
"Class",
"pClass",
",",
"Object",
"pParam",
")",
"{",
"Object",
"value",
";",
"try",
"{",
"// Create param and argument arrays\r",
"Class",
"[",
"]",
"param",
"=",
"{",
"pParam",
".",
"getClass",
"(",
")",
"}",
";"... | Creates an object from the given class' single argument constructor.
@return The object created from the constructor.
If the constructor could not be invoked for any reason, null is
returned. | [
"Creates",
"an",
"object",
"from",
"the",
"given",
"class",
"single",
"argument",
"constructor",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L413-L431 |
62,588 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.invokeStaticMethod | private Object invokeStaticMethod(Class pClass, String pMethod, Object pParam) {
Object value = null;
try {
// Create param and argument arrays
Class[] param = { pParam.getClass() };
Object[] arg = { pParam };
// Get method
// *** If more than one such method is fou... | java | private Object invokeStaticMethod(Class pClass, String pMethod, Object pParam) {
Object value = null;
try {
// Create param and argument arrays
Class[] param = { pParam.getClass() };
Object[] arg = { pParam };
// Get method
// *** If more than one such method is fou... | [
"private",
"Object",
"invokeStaticMethod",
"(",
"Class",
"pClass",
",",
"String",
"pMethod",
",",
"Object",
"pParam",
")",
"{",
"Object",
"value",
"=",
"null",
";",
"try",
"{",
"// Create param and argument arrays\r",
"Class",
"[",
"]",
"param",
"=",
"{",
"pPa... | Creates an object from any given static method, given the parameter
@return The object returned by the static method.
If the return type of the method is a primitive type, it is wrapped in
the corresponding wrapper object (int is wrapped in an Integer).
If the return type of the method is void, null is returned.
If th... | [
"Creates",
"an",
"object",
"from",
"any",
"given",
"static",
"method",
"given",
"the",
"parameter"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L442-L467 |
62,589 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.setPropertyFormat | public synchronized String setPropertyFormat(String pKey, String pFormat) {
// Insert format
return StringUtil.valueOf(mFormats.put(pKey, pFormat));
} | java | public synchronized String setPropertyFormat(String pKey, String pFormat) {
// Insert format
return StringUtil.valueOf(mFormats.put(pKey, pFormat));
} | [
"public",
"synchronized",
"String",
"setPropertyFormat",
"(",
"String",
"pKey",
",",
"String",
"pFormat",
")",
"{",
"// Insert format\r",
"return",
"StringUtil",
".",
"valueOf",
"(",
"mFormats",
".",
"put",
"(",
"pKey",
",",
"pFormat",
")",
")",
";",
"}"
] | Sets the format of a property. This value is used for formatting the
value before it is stored as xml.
@param pKey a key in this hashtable.
@param pFormat a string representation of the format.
@return the previous format for the specified key or null if it did not
have one. | [
"Sets",
"the",
"format",
"of",
"a",
"property",
".",
"This",
"value",
"is",
"used",
"for",
"formatting",
"the",
"value",
"before",
"it",
"is",
"stored",
"as",
"xml",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L494-L498 |
62,590 | haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.insertElement | private static void insertElement(Document pDocument, String pName, Object pValue, String pFormat) {
// Get names of all elements we need
String[] names = StringUtil.toStringArray(pName, ".");
// Get value formatted as string
String value = null;
if (pValue != null) {
// ---
... | java | private static void insertElement(Document pDocument, String pName, Object pValue, String pFormat) {
// Get names of all elements we need
String[] names = StringUtil.toStringArray(pName, ".");
// Get value formatted as string
String value = null;
if (pValue != null) {
// ---
... | [
"private",
"static",
"void",
"insertElement",
"(",
"Document",
"pDocument",
",",
"String",
"pName",
",",
"Object",
"pValue",
",",
"String",
"pFormat",
")",
"{",
"// Get names of all elements we need\r",
"String",
"[",
"]",
"names",
"=",
"StringUtil",
".",
"toStrin... | Inserts elements to the given document one by one, and creates all its
parents if needed.
@param pDocument the document to insert to.
@param pName the name of the property element.
@param pValue the value of the property element.
@param pFormat
@todo I guess this implementation could use some optimisaztion, as
we do ... | [
"Inserts",
"elements",
"to",
"the",
"given",
"document",
"one",
"by",
"one",
"and",
"creates",
"all",
"its",
"parents",
"if",
"needed",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L791-L900 |
62,591 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java | XMLTransformTag.doEndTag | public int doEndTag() throws JspException {
// Get body content (trim is CRUCIAL, as some XML parsers are picky...)
String body = bodyContent.getString().trim();
// Do transformation
transform(new StreamSource(new ByteArrayInputStream(body.getBytes())));
return super.doE... | java | public int doEndTag() throws JspException {
// Get body content (trim is CRUCIAL, as some XML parsers are picky...)
String body = bodyContent.getString().trim();
// Do transformation
transform(new StreamSource(new ByteArrayInputStream(body.getBytes())));
return super.doE... | [
"public",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"// Get body content (trim is CRUCIAL, as some XML parsers are picky...)\r",
"String",
"body",
"=",
"bodyContent",
".",
"getString",
"(",
")",
".",
"trim",
"(",
")",
";",
"// Do transformation\r",
"tr... | doEndTag implementation, that will perform XML Transformation on the
body content.
@return super.doEndTag() | [
"doEndTag",
"implementation",
"that",
"will",
"perform",
"XML",
"Transformation",
"on",
"the",
"body",
"content",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java#L99-L107 |
62,592 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java | XMLTransformTag.transform | public void transform(Source pIn) throws JspException {
try {
// Create transformer
Transformer transformer = TransformerFactory.newInstance()
.newTransformer(getSource(mStylesheetURI));
// Store temporary output in a bytearray, as the transformer w... | java | public void transform(Source pIn) throws JspException {
try {
// Create transformer
Transformer transformer = TransformerFactory.newInstance()
.newTransformer(getSource(mStylesheetURI));
// Store temporary output in a bytearray, as the transformer w... | [
"public",
"void",
"transform",
"(",
"Source",
"pIn",
")",
"throws",
"JspException",
"{",
"try",
"{",
"// Create transformer\r",
"Transformer",
"transformer",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
".",
"newTransformer",
"(",
"getSource",
"(",
"mS... | Performs the transformation and writes the result to the JSP writer.
@param in the source document to transform. | [
"Performs",
"the",
"transformation",
"and",
"writes",
"the",
"result",
"to",
"the",
"JSP",
"writer",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java#L115-L142 |
62,593 | haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java | XMLTransformTag.getSource | private StreamSource getSource(String pURI)
throws IOException, MalformedURLException {
if (pURI != null && pURI.indexOf("://") < 0) {
// If local, get as stream
return new StreamSource(getResourceAsStream(pURI));
}
// ...else, create from URI string
... | java | private StreamSource getSource(String pURI)
throws IOException, MalformedURLException {
if (pURI != null && pURI.indexOf("://") < 0) {
// If local, get as stream
return new StreamSource(getResourceAsStream(pURI));
}
// ...else, create from URI string
... | [
"private",
"StreamSource",
"getSource",
"(",
"String",
"pURI",
")",
"throws",
"IOException",
",",
"MalformedURLException",
"{",
"if",
"(",
"pURI",
"!=",
"null",
"&&",
"pURI",
".",
"indexOf",
"(",
"\"://\"",
")",
"<",
"0",
")",
"{",
"// If local, get as stream\... | Returns a StreamSource object, for the given URI | [
"Returns",
"a",
"StreamSource",
"object",
"for",
"the",
"given",
"URI"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/XMLTransformTag.java#L148-L157 |
62,594 | haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java | IndexImage.createSolid | private static BufferedImage createSolid(BufferedImage pOriginal, Color pBackground) {
// Create a temporary image of same dimension and type
BufferedImage solid = new BufferedImage(pOriginal.getColorModel(), pOriginal.copyData(null), pOriginal.isAlphaPremultiplied(), null);
Graphics2D g = so... | java | private static BufferedImage createSolid(BufferedImage pOriginal, Color pBackground) {
// Create a temporary image of same dimension and type
BufferedImage solid = new BufferedImage(pOriginal.getColorModel(), pOriginal.copyData(null), pOriginal.isAlphaPremultiplied(), null);
Graphics2D g = so... | [
"private",
"static",
"BufferedImage",
"createSolid",
"(",
"BufferedImage",
"pOriginal",
",",
"Color",
"pBackground",
")",
"{",
"// Create a temporary image of same dimension and type\r",
"BufferedImage",
"solid",
"=",
"new",
"BufferedImage",
"(",
"pOriginal",
".",
"getColor... | Creates a copy of the given image, with a solid background
@param pOriginal the original image
@param pBackground the background color
@return a new {@code BufferedImage} | [
"Creates",
"a",
"copy",
"of",
"the",
"given",
"image",
"with",
"a",
"solid",
"background"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L1164-L1180 |
62,595 | haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java | IndexImage.applyAlpha | private static void applyAlpha(BufferedImage pImage, BufferedImage pAlpha) {
// Apply alpha as transparency, using threshold of 25%
for (int y = 0; y < pAlpha.getHeight(); y++) {
for (int x = 0; x < pAlpha.getWidth(); x++) {
// Get alpha component of pixel, if less than... | java | private static void applyAlpha(BufferedImage pImage, BufferedImage pAlpha) {
// Apply alpha as transparency, using threshold of 25%
for (int y = 0; y < pAlpha.getHeight(); y++) {
for (int x = 0; x < pAlpha.getWidth(); x++) {
// Get alpha component of pixel, if less than... | [
"private",
"static",
"void",
"applyAlpha",
"(",
"BufferedImage",
"pImage",
",",
"BufferedImage",
"pAlpha",
")",
"{",
"// Apply alpha as transparency, using threshold of 25%\r",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"pAlpha",
".",
"getHeight",
"(",
")",
... | Applies the alpha-component of the alpha image to the given image.
The given image is modified in place.
@param pImage the image to apply alpha to
@param pAlpha the image containing the alpha | [
"Applies",
"the",
"alpha",
"-",
"component",
"of",
"the",
"alpha",
"image",
"to",
"the",
"given",
"image",
".",
"The",
"given",
"image",
"is",
"modified",
"in",
"place",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L1189-L1201 |
62,596 | haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/FastByteArrayOutputStream.java | FastByteArrayOutputStream.toByteArray | @Override
public byte[] toByteArray() {
byte newBuf[] = new byte[count];
System.arraycopy(buf, 0, newBuf, 0, count);
return newBuf;
} | java | @Override
public byte[] toByteArray() {
byte newBuf[] = new byte[count];
System.arraycopy(buf, 0, newBuf, 0, count);
return newBuf;
} | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
")",
"{",
"byte",
"newBuf",
"[",
"]",
"=",
"new",
"byte",
"[",
"count",
"]",
";",
"System",
".",
"arraycopy",
"(",
"buf",
",",
"0",
",",
"newBuf",
",",
"0",
",",
"count",
")",
";",
... | Non-synchronized version of toByteArray | [
"Non",
"-",
"synchronized",
"version",
"of",
"toByteArray"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/FastByteArrayOutputStream.java#L114-L120 |
62,597 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/cache/CachedResponseImpl.java | CachedResponseImpl.writeHeadersTo | public void writeHeadersTo(final CacheResponse pResponse) {
String[] headers = getHeaderNames();
for (String header : headers) {
// HACK...
// Strip away internal headers
if (HTTPCache.HEADER_CACHED_TIME.equals(header)) {
continue;
}... | java | public void writeHeadersTo(final CacheResponse pResponse) {
String[] headers = getHeaderNames();
for (String header : headers) {
// HACK...
// Strip away internal headers
if (HTTPCache.HEADER_CACHED_TIME.equals(header)) {
continue;
}... | [
"public",
"void",
"writeHeadersTo",
"(",
"final",
"CacheResponse",
"pResponse",
")",
"{",
"String",
"[",
"]",
"headers",
"=",
"getHeaderNames",
"(",
")",
";",
"for",
"(",
"String",
"header",
":",
"headers",
")",
"{",
"// HACK...\r",
"// Strip away internal heade... | Writes the cached headers to the response
@param pResponse the response | [
"Writes",
"the",
"cached",
"headers",
"to",
"the",
"response"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/cache/CachedResponseImpl.java#L74-L98 |
62,598 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/cache/CachedResponseImpl.java | CachedResponseImpl.writeContentsTo | public void writeContentsTo(final OutputStream pStream) throws IOException {
if (content == null) {
throw new IOException("Cache is null, no content to write.");
}
content.writeTo(pStream);
} | java | public void writeContentsTo(final OutputStream pStream) throws IOException {
if (content == null) {
throw new IOException("Cache is null, no content to write.");
}
content.writeTo(pStream);
} | [
"public",
"void",
"writeContentsTo",
"(",
"final",
"OutputStream",
"pStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Cache is null, no content to write.\"",
")",
";",
"}",
"content",
... | Writes the cached content to the response
@param pStream the response stream
@throws java.io.IOException | [
"Writes",
"the",
"cached",
"content",
"to",
"the",
"response"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/cache/CachedResponseImpl.java#L106-L112 |
62,599 | haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/cache/CachedResponseImpl.java | CachedResponseImpl.getHeaderNames | public String[] getHeaderNames() {
Set<String> headers = this.headers.keySet();
return headers.toArray(new String[headers.size()]);
} | java | public String[] getHeaderNames() {
Set<String> headers = this.headers.keySet();
return headers.toArray(new String[headers.size()]);
} | [
"public",
"String",
"[",
"]",
"getHeaderNames",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"headers",
"=",
"this",
".",
"headers",
".",
"keySet",
"(",
")",
";",
"return",
"headers",
".",
"toArray",
"(",
"new",
"String",
"[",
"headers",
".",
"size",
"(... | Gets the header names of all headers set in this response.
@return an array of {@code String}s | [
"Gets",
"the",
"header",
"names",
"of",
"all",
"headers",
"set",
"in",
"this",
"response",
"."
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/cache/CachedResponseImpl.java#L119-L123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.