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
37,500
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/VFSUtils.java
VFSUtils.recursiveDelete
public static boolean recursiveDelete(VirtualFile root) { boolean ok = true; if (root.isDirectory()) { final List<VirtualFile> files = root.getChildren(); for (VirtualFile file : files) { ok &= recursiveDelete(file); } return ok && (root.de...
java
public static boolean recursiveDelete(VirtualFile root) { boolean ok = true; if (root.isDirectory()) { final List<VirtualFile> files = root.getChildren(); for (VirtualFile file : files) { ok &= recursiveDelete(file); } return ok && (root.de...
[ "public", "static", "boolean", "recursiveDelete", "(", "VirtualFile", "root", ")", "{", "boolean", "ok", "=", "true", ";", "if", "(", "root", ".", "isDirectory", "(", ")", ")", "{", "final", "List", "<", "VirtualFile", ">", "files", "=", "root", ".", "...
Attempt to recursively delete a virtual file. @param root the virtual file to delete @return {@code true} if the file was deleted
[ "Attempt", "to", "recursively", "delete", "a", "virtual", "file", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L692-L704
37,501
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/VFSUtils.java
VFSUtils.recursiveCopy
public static void recursiveCopy(File original, File destDir) throws IOException { final String name = original.getName(); final File destFile = new File(destDir, name); if (original.isDirectory()) { destFile.mkdir(); for (File file : original.listFiles()) { ...
java
public static void recursiveCopy(File original, File destDir) throws IOException { final String name = original.getName(); final File destFile = new File(destDir, name); if (original.isDirectory()) { destFile.mkdir(); for (File file : original.listFiles()) { ...
[ "public", "static", "void", "recursiveCopy", "(", "File", "original", ",", "File", "destDir", ")", "throws", "IOException", "{", "final", "String", "name", "=", "original", ".", "getName", "(", ")", ";", "final", "File", "destFile", "=", "new", "File", "("...
Recursively copy a file or directory from one location to another. @param original the original file or directory @param destDir the destination directory @throws IOException if an I/O error occurs before the copy is complete
[ "Recursively", "copy", "a", "file", "or", "directory", "from", "one", "location", "to", "another", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L713-L731
37,502
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/VFSUtils.java
VFSUtils.unzip
public static void unzip(File zipFile, File destDir) throws IOException { final ZipFile zip = new ZipFile(zipFile); try { final Set<File> createdDirs = new HashSet<File>(); final Enumeration<? extends ZipEntry> entries = zip.entries(); FILES_LOOP: while (e...
java
public static void unzip(File zipFile, File destDir) throws IOException { final ZipFile zip = new ZipFile(zipFile); try { final Set<File> createdDirs = new HashSet<File>(); final Enumeration<? extends ZipEntry> entries = zip.entries(); FILES_LOOP: while (e...
[ "public", "static", "void", "unzip", "(", "File", "zipFile", ",", "File", "destDir", ")", "throws", "IOException", "{", "final", "ZipFile", "zip", "=", "new", "ZipFile", "(", "zipFile", ")", ";", "try", "{", "final", "Set", "<", "File", ">", "createdDirs...
Expand a zip file to a destination directory. The directory must exist. If an error occurs, the destination directory may contain a partially-extracted archive, so cleanup is up to the caller. @param zipFile the zip file @param destDir the destination directory @throws IOException if an error occurs
[ "Expand", "a", "zip", "file", "to", "a", "destination", "directory", ".", "The", "directory", "must", "exist", ".", "If", "an", "error", "occurs", "the", "destination", "directory", "may", "contain", "a", "partially", "-", "extracted", "archive", "so", "clea...
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L873-L919
37,503
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/VFSUtils.java
VFSUtils.getMountSource
public static File getMountSource(Closeable handle) { if (handle instanceof MountHandle) { return MountHandle.class.cast(handle).getMountSource(); } return null; }
java
public static File getMountSource(Closeable handle) { if (handle instanceof MountHandle) { return MountHandle.class.cast(handle).getMountSource(); } return null; }
[ "public", "static", "File", "getMountSource", "(", "Closeable", "handle", ")", "{", "if", "(", "handle", "instanceof", "MountHandle", ")", "{", "return", "MountHandle", ".", "class", ".", "cast", "(", "handle", ")", ".", "getMountSource", "(", ")", ";", "}...
Return the mount source File for a given mount handle. @param handle The handle to get the source for @return The mount source file or null if the handle does not have a source, or is not a MountHandle
[ "Return", "the", "mount", "source", "File", "for", "a", "given", "mount", "handle", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L927-L930
37,504
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/util/FilterVirtualFileVisitor.java
FilterVirtualFileVisitor.checkAttributes
private static VisitorAttributes checkAttributes(VirtualFileFilter filter, VisitorAttributes attributes) { if (filter == null) { throw MESSAGES.nullArgument("filter"); } // Specified if (attributes != null) { return attributes; } // From the filter if (filter ...
java
private static VisitorAttributes checkAttributes(VirtualFileFilter filter, VisitorAttributes attributes) { if (filter == null) { throw MESSAGES.nullArgument("filter"); } // Specified if (attributes != null) { return attributes; } // From the filter if (filter ...
[ "private", "static", "VisitorAttributes", "checkAttributes", "(", "VirtualFileFilter", "filter", ",", "VisitorAttributes", "attributes", ")", "{", "if", "(", "filter", "==", "null", ")", "{", "throw", "MESSAGES", ".", "nullArgument", "(", "\"filter\"", ")", ";", ...
Check the attributes @param filter the filter @param attributes the attributes @return the attributes @throws IllegalArgumentException for a null filter
[ "Check", "the", "attributes" ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/FilterVirtualFileVisitor.java#L57-L67
37,505
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/util/FileNameVirtualFileFilter.java
FileNameVirtualFileFilter.getPathName
protected String getPathName(VirtualFile file) { try { // prefer the URI, as the pathName might // return an empty string for temp virtual files return file.toURI().toString(); } catch (Exception e) { return file.getPathName(); } }
java
protected String getPathName(VirtualFile file) { try { // prefer the URI, as the pathName might // return an empty string for temp virtual files return file.toURI().toString(); } catch (Exception e) { return file.getPathName(); } }
[ "protected", "String", "getPathName", "(", "VirtualFile", "file", ")", "{", "try", "{", "// prefer the URI, as the pathName might\r", "// return an empty string for temp virtual files\r", "return", "file", ".", "toURI", "(", ")", ".", "toString", "(", ")", ";", "}", "...
Get the path name for the VirtualFile. @param file the virtual file @return the path name
[ "Get", "the", "path", "name", "for", "the", "VirtualFile", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/FileNameVirtualFileFilter.java#L78-L86
37,506
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/util/automount/Automounter.java
Automounter.getMountConfig
private static MountConfig getMountConfig(MountOption[] mountOptions) { final MountConfig config = new MountConfig(); for (MountOption option : mountOptions) { option.applyTo(config); } return config; }
java
private static MountConfig getMountConfig(MountOption[] mountOptions) { final MountConfig config = new MountConfig(); for (MountOption option : mountOptions) { option.applyTo(config); } return config; }
[ "private", "static", "MountConfig", "getMountConfig", "(", "MountOption", "[", "]", "mountOptions", ")", "{", "final", "MountConfig", "config", "=", "new", "MountConfig", "(", ")", ";", "for", "(", "MountOption", "option", ":", "mountOptions", ")", "{", "optio...
Creates a MountConfig and applies the provided mount options @param mountOptions options to use for mounting @return a MountConfig
[ "Creates", "a", "MountConfig", "and", "applies", "the", "provided", "mount", "options" ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/automount/Automounter.java#L119-L125
37,507
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/util/automount/Automounter.java
Automounter.addHandle
public static boolean addHandle(VirtualFile owner, Closeable handle) { RegistryEntry entry = getEntry(owner); return entry.handles.add(handle); }
java
public static boolean addHandle(VirtualFile owner, Closeable handle) { RegistryEntry entry = getEntry(owner); return entry.handles.add(handle); }
[ "public", "static", "boolean", "addHandle", "(", "VirtualFile", "owner", ",", "Closeable", "handle", ")", "{", "RegistryEntry", "entry", "=", "getEntry", "(", "owner", ")", ";", "return", "entry", ".", "handles", ".", "add", "(", "handle", ")", ";", "}" ]
Add handle to owner, to be auto closed. @param owner the handle owner @param handle the handle @return add result
[ "Add", "handle", "to", "owner", "to", "be", "auto", "closed", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/automount/Automounter.java#L134-L137
37,508
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/util/automount/Automounter.java
Automounter.removeHandle
public static boolean removeHandle(VirtualFile owner, Closeable handle) { RegistryEntry entry = getEntry(owner); return entry.handles.remove(handle); }
java
public static boolean removeHandle(VirtualFile owner, Closeable handle) { RegistryEntry entry = getEntry(owner); return entry.handles.remove(handle); }
[ "public", "static", "boolean", "removeHandle", "(", "VirtualFile", "owner", ",", "Closeable", "handle", ")", "{", "RegistryEntry", "entry", "=", "getEntry", "(", "owner", ")", ";", "return", "entry", ".", "handles", ".", "remove", "(", "handle", ")", ";", ...
Remove handle from owner. @param owner the handle owner @param handle the handle @return remove result
[ "Remove", "handle", "from", "owner", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/automount/Automounter.java#L146-L149
37,509
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/util/automount/Automounter.java
Automounter.getEntry
static RegistryEntry getEntry(VirtualFile virtualFile) { if (virtualFile == null) { throw MESSAGES.nullArgument("VirutalFile"); } return rootEntry.find(virtualFile); }
java
static RegistryEntry getEntry(VirtualFile virtualFile) { if (virtualFile == null) { throw MESSAGES.nullArgument("VirutalFile"); } return rootEntry.find(virtualFile); }
[ "static", "RegistryEntry", "getEntry", "(", "VirtualFile", "virtualFile", ")", "{", "if", "(", "virtualFile", "==", "null", ")", "{", "throw", "MESSAGES", ".", "nullArgument", "(", "\"VirutalFile\"", ")", ";", "}", "return", "rootEntry", ".", "find", "(", "v...
Get the entry from the tree creating the entry if not present. @param virtualFile entry's owner file @return registry entry
[ "Get", "the", "entry", "from", "the", "tree", "creating", "the", "entry", "if", "not", "present", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/automount/Automounter.java#L200-L205
37,510
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/TempFileProvider.java
TempFileProvider.create
public static TempFileProvider create(final String providerType, final ScheduledExecutorService executor, final boolean cleanExisting) throws IOException { if (cleanExisting) { try { // The "clean existing" logic is as follows: // 1) Rename the root directory "foo" co...
java
public static TempFileProvider create(final String providerType, final ScheduledExecutorService executor, final boolean cleanExisting) throws IOException { if (cleanExisting) { try { // The "clean existing" logic is as follows: // 1) Rename the root directory "foo" co...
[ "public", "static", "TempFileProvider", "create", "(", "final", "String", "providerType", ",", "final", "ScheduledExecutorService", "executor", ",", "final", "boolean", "cleanExisting", ")", "throws", "IOException", "{", "if", "(", "cleanExisting", ")", "{", "try", ...
Create a temporary file provider for a given type. @param providerType The provider type string (used as a prefix in the temp file dir name) @param executor Executor which will be used to manage temp file provider tasks (like cleaning up/deleting the temp files when needed) @param cleanExisting If this is true, then t...
[ "Create", "a", "temporary", "file", "provider", "for", "a", "given", "type", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/TempFileProvider.java#L79-L110
37,511
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/TempFileProvider.java
TempFileProvider.createTempDir
public TempDir createTempDir(String originalName) throws IOException { if (!open.get()) { throw VFSMessages.MESSAGES.tempFileProviderClosed(); } final String name = createTempName(originalName + "-", ""); final File f = new File(providerRoot, name); for (int i = 0; i ...
java
public TempDir createTempDir(String originalName) throws IOException { if (!open.get()) { throw VFSMessages.MESSAGES.tempFileProviderClosed(); } final String name = createTempName(originalName + "-", ""); final File f = new File(providerRoot, name); for (int i = 0; i ...
[ "public", "TempDir", "createTempDir", "(", "String", "originalName", ")", "throws", "IOException", "{", "if", "(", "!", "open", ".", "get", "(", ")", ")", "{", "throw", "VFSMessages", ".", "MESSAGES", ".", "tempFileProviderClosed", "(", ")", ";", "}", "fin...
Create a temp directory, into which temporary files may be placed. @param originalName the original file name @return the temp directory @throws IOException for any error
[ "Create", "a", "temp", "directory", "into", "which", "temporary", "files", "may", "be", "placed", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/TempFileProvider.java#L131-L143
37,512
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/VirtualJarInputStream.java
VirtualJarInputStream.openCurrent
private void openCurrent(VirtualFile current) throws IOException { if (current.isDirectory()) { currentEntryStream = VFSUtils.emptyStream(); } else { currentEntryStream = current.openStream(); } }
java
private void openCurrent(VirtualFile current) throws IOException { if (current.isDirectory()) { currentEntryStream = VFSUtils.emptyStream(); } else { currentEntryStream = current.openStream(); } }
[ "private", "void", "openCurrent", "(", "VirtualFile", "current", ")", "throws", "IOException", "{", "if", "(", "current", ".", "isDirectory", "(", ")", ")", "{", "currentEntryStream", "=", "VFSUtils", ".", "emptyStream", "(", ")", ";", "}", "else", "{", "c...
Open the current virtual file as the current JarEntry stream. @param current @throws IOException
[ "Open", "the", "current", "virtual", "file", "as", "the", "current", "JarEntry", "stream", "." ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarInputStream.java#L219-L225
37,513
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java
PkRSS.get
public List<Article> get(String url) { if(url.equals(KEY_FAVORITES)) return getFavorites(); return articleMap.get(url); }
java
public List<Article> get(String url) { if(url.equals(KEY_FAVORITES)) return getFavorites(); return articleMap.get(url); }
[ "public", "List", "<", "Article", ">", "get", "(", "String", "url", ")", "{", "if", "(", "url", ".", "equals", "(", "KEY_FAVORITES", ")", ")", "return", "getFavorites", "(", ")", ";", "return", "articleMap", ".", "get", "(", "url", ")", ";", "}" ]
Looks up the specified URL String from the saved HashMap. @param url Safe URL to look up loaded articles from. May also be {@link PkRSS#KEY_FAVORITES}. @return A {@link List} containing all loaded articles associated with that URL. May be null if no such URL has yet been loaded.
[ "Looks", "up", "the", "specified", "URL", "String", "from", "the", "saved", "HashMap", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java#L201-L206
37,514
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java
PkRSS.deleteAllFavorites
public void deleteAllFavorites() { long time = System.currentTimeMillis(); log("Deleting all favorites..."); favoriteDatabase.deleteAll(); log("Deleting all favorites took " + (System.currentTimeMillis() - time) + "ms"); }
java
public void deleteAllFavorites() { long time = System.currentTimeMillis(); log("Deleting all favorites..."); favoriteDatabase.deleteAll(); log("Deleting all favorites took " + (System.currentTimeMillis() - time) + "ms"); }
[ "public", "void", "deleteAllFavorites", "(", ")", "{", "long", "time", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "log", "(", "\"Deleting all favorites...\"", ")", ";", "favoriteDatabase", ".", "deleteAll", "(", ")", ";", "log", "(", "\"Deleting a...
Clears the favorites database.
[ "Clears", "the", "favorites", "database", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java#L371-L376
37,515
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java
PkRSS.insert
private void insert(String url, List<Article> newArticles) { if(!articleMap.containsKey(url)) articleMap.put(url, new ArrayList<Article>()); List<Article> articleList = articleMap.get(url); articleList.addAll(newArticles); log("New size for " + url + " is " + articleList.size()); }
java
private void insert(String url, List<Article> newArticles) { if(!articleMap.containsKey(url)) articleMap.put(url, new ArrayList<Article>()); List<Article> articleList = articleMap.get(url); articleList.addAll(newArticles); log("New size for " + url + " is " + articleList.size()); }
[ "private", "void", "insert", "(", "String", "url", ",", "List", "<", "Article", ">", "newArticles", ")", "{", "if", "(", "!", "articleMap", ".", "containsKey", "(", "url", ")", ")", "articleMap", ".", "put", "(", "url", ",", "new", "ArrayList", "<", ...
Inserts the passed list into the article map database. This will be cleared once the instance dies. @param url URL to associate this list with. @param newArticles Article list to store.
[ "Inserts", "the", "passed", "list", "into", "the", "article", "map", "database", ".", "This", "will", "be", "cleared", "once", "the", "instance", "dies", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java#L425-L433
37,516
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java
PkRSS.getRead
private void getRead() { // Execute on background thread as we don't know how large this is new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { int size = mPrefs.getInt("READ_ARRAY_SIZE", 0); boolean value; if(size < 1) return null; for(int i = 0...
java
private void getRead() { // Execute on background thread as we don't know how large this is new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { int size = mPrefs.getInt("READ_ARRAY_SIZE", 0); boolean value; if(size < 1) return null; for(int i = 0...
[ "private", "void", "getRead", "(", ")", "{", "// Execute on background thread as we don't know how large this is", "new", "AsyncTask", "<", "Void", ",", "Void", ",", "Void", ">", "(", ")", "{", "@", "Override", "protected", "Void", "doInBackground", "(", "Void", "...
Asynchronously loads read data.
[ "Asynchronously", "loads", "read", "data", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java#L438-L457
37,517
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java
PkRSS.writeRead
private void writeRead() { // Execute on background thread as we don't know how large this is new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { // Get editor & basic variables SharedPreferences.Editor editor = mPrefs.edit(); int size = readList.size(); ...
java
private void writeRead() { // Execute on background thread as we don't know how large this is new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { // Get editor & basic variables SharedPreferences.Editor editor = mPrefs.edit(); int size = readList.size(); ...
[ "private", "void", "writeRead", "(", ")", "{", "// Execute on background thread as we don't know how large this is", "new", "AsyncTask", "<", "Void", ",", "Void", ",", "Void", ">", "(", ")", "{", "@", "Override", "protected", "Void", "doInBackground", "(", "Void", ...
Asynchronously saves read data.
[ "Asynchronously", "saves", "read", "data", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/PkRSS.java#L462-L485
37,518
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/parser/AtomParser.java
AtomParser.pullImageLink
private String pullImageLink(String encoded) { try { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new StringReader(encoded)); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { if (ev...
java
private String pullImageLink(String encoded) { try { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new StringReader(encoded)); int eventType = xpp.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { if (ev...
[ "private", "String", "pullImageLink", "(", "String", "encoded", ")", "{", "try", "{", "XmlPullParserFactory", "factory", "=", "XmlPullParserFactory", ".", "newInstance", "(", ")", ";", "XmlPullParser", "xpp", "=", "factory", ".", "newPullParser", "(", ")", ";", ...
Pulls an image URL from an encoded String. @param encoded The String which to extract an image URL from. @return The first image URL found on the encoded String. May return an empty String if none were found.
[ "Pulls", "an", "image", "URL", "from", "an", "encoded", "String", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/parser/AtomParser.java#L189-L212
37,519
STIXProject/java-stix
src/main/java/org/mitre/stix/STIXSchema.java
STIXSchema.validate
public boolean validate(URL url) throws SAXException { String xmlText = null; try { xmlText = IOUtils.toString(url.openStream()); } catch (IOException e) { throw new RuntimeException(e); } return validate(xmlText); }
java
public boolean validate(URL url) throws SAXException { String xmlText = null; try { xmlText = IOUtils.toString(url.openStream()); } catch (IOException e) { throw new RuntimeException(e); } return validate(xmlText); }
[ "public", "boolean", "validate", "(", "URL", "url", ")", "throws", "SAXException", "{", "String", "xmlText", "=", "null", ";", "try", "{", "xmlText", "=", "IOUtils", ".", "toString", "(", "url", ".", "openStream", "(", ")", ")", ";", "}", "catch", "(",...
Validate XML text retrieved from URL @param url The URL object for the XML to be validated. @return boolean True If the xmlText validates against the schema @throws SAXException If the a validation ErrorHandler has not been set, and validation throws a SAXException
[ "Validate", "XML", "text", "retrieved", "from", "URL" ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/STIXSchema.java#L196-L207
37,520
STIXProject/java-stix
src/main/java/org/mitre/stix/STIXSchema.java
STIXSchema.validate
public boolean validate(String xmlText) throws SAXException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); // This section removes the schema hint as we have the schema docs // otherwise exceptions may be thrown try { DocumentBuilder b = factory...
java
public boolean validate(String xmlText) throws SAXException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); // This section removes the schema hint as we have the schema docs // otherwise exceptions may be thrown try { DocumentBuilder b = factory...
[ "public", "boolean", "validate", "(", "String", "xmlText", ")", "throws", "SAXException", "{", "DocumentBuilderFactory", "factory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "factory", ".", "setNamespaceAware", "(", "true", ")", ";", "// Th...
Validate an XML text String against the STIX schema @param xmlText A string of XML text to be validated @return boolean True If the xmlText validates against the schema @throws SAXException If the a validation ErrorHandler has not been set, and validation throws a SAXException
[ "Validate", "an", "XML", "text", "String", "against", "the", "STIX", "schema" ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/STIXSchema.java#L219-L274
37,521
STIXProject/java-stix
src/main/java/org/mitre/stix/STIXSchema.java
STIXSchema.getNamespaceURI
public static String getNamespaceURI(Object obj) { Package pkg = obj.getClass().getPackage(); XmlSchema xmlSchemaAnnotation = pkg.getAnnotation(XmlSchema.class); return xmlSchemaAnnotation.namespace(); }
java
public static String getNamespaceURI(Object obj) { Package pkg = obj.getClass().getPackage(); XmlSchema xmlSchemaAnnotation = pkg.getAnnotation(XmlSchema.class); return xmlSchemaAnnotation.namespace(); }
[ "public", "static", "String", "getNamespaceURI", "(", "Object", "obj", ")", "{", "Package", "pkg", "=", "obj", ".", "getClass", "(", ")", ".", "getPackage", "(", ")", ";", "XmlSchema", "xmlSchemaAnnotation", "=", "pkg", ".", "getAnnotation", "(", "XmlSchema"...
Return the namespace URI from the package for the class of the object. @param obj Expects a JAXB model object. @return Name of the XML namespace.
[ "Return", "the", "namespace", "URI", "from", "the", "package", "for", "the", "class", "of", "the", "object", "." ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/STIXSchema.java#L307-L314
37,522
STIXProject/java-stix
src/main/java/org/mitre/stix/STIXSchema.java
STIXSchema.getName
public static String getName(Object obj) { try { return obj.getClass().getAnnotation(XmlRootElement.class).name(); } catch (NullPointerException e) { return obj.getClass().getAnnotation(XmlType.class).name(); } }
java
public static String getName(Object obj) { try { return obj.getClass().getAnnotation(XmlRootElement.class).name(); } catch (NullPointerException e) { return obj.getClass().getAnnotation(XmlType.class).name(); } }
[ "public", "static", "String", "getName", "(", "Object", "obj", ")", "{", "try", "{", "return", "obj", ".", "getClass", "(", ")", ".", "getAnnotation", "(", "XmlRootElement", ".", "class", ")", ".", "name", "(", ")", ";", "}", "catch", "(", "NullPointer...
Return the name from the JAXB model object. @param obj Expects a JAXB model object. @return element name
[ "Return", "the", "name", "from", "the", "JAXB", "model", "object", "." ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/STIXSchema.java#L323-L329
37,523
STIXProject/java-stix
src/main/java/org/mitre/stix/STIXSchema.java
STIXSchema.getQualifiedName
public static QName getQualifiedName(Object obj) { return new QName(STIXSchema.getNamespaceURI(obj), STIXSchema.getName(obj)); }
java
public static QName getQualifiedName(Object obj) { return new QName(STIXSchema.getNamespaceURI(obj), STIXSchema.getName(obj)); }
[ "public", "static", "QName", "getQualifiedName", "(", "Object", "obj", ")", "{", "return", "new", "QName", "(", "STIXSchema", ".", "getNamespaceURI", "(", "obj", ")", ",", "STIXSchema", ".", "getName", "(", "obj", ")", ")", ";", "}" ]
Return the QualifiedNam from the JAXB model object. @param obj Expects a JAXB model object. @return Qualified dName as defined by JAXB model
[ "Return", "the", "QualifiedNam", "from", "the", "JAXB", "model", "object", "." ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/STIXSchema.java#L338-L341
37,524
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/RequestCreator.java
RequestCreator.nextPage
public RequestCreator nextPage() { Request request = data.build(); String url = request.url; int page = request.page; if(request.search != null) url += "?s=" + request.search; Map<String, Integer> pageTracker = singleton.getPageTracker(); if(pageTracker.containsKey(url)) page = pageTracker.get(url);...
java
public RequestCreator nextPage() { Request request = data.build(); String url = request.url; int page = request.page; if(request.search != null) url += "?s=" + request.search; Map<String, Integer> pageTracker = singleton.getPageTracker(); if(pageTracker.containsKey(url)) page = pageTracker.get(url);...
[ "public", "RequestCreator", "nextPage", "(", ")", "{", "Request", "request", "=", "data", ".", "build", "(", ")", ";", "String", "url", "=", "request", ".", "url", ";", "int", "page", "=", "request", ".", "page", ";", "if", "(", "request", ".", "sear...
Loads the next page of the current RSS feed. If no page was previously loaded, this will request the first page.
[ "Loads", "the", "next", "page", "of", "the", "current", "RSS", "feed", ".", "If", "no", "page", "was", "previously", "loaded", "this", "will", "request", "the", "first", "page", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/RequestCreator.java#L104-L118
37,525
STIXProject/java-stix
src/main/java/org/mitre/stix/DocumentUtilities.java
DocumentUtilities.toDocument
public static Document toDocument(JAXBElement<?> jaxbElement, boolean prettyPrint) { Document document = null; try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory .newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementCont...
java
public static Document toDocument(JAXBElement<?> jaxbElement, boolean prettyPrint) { Document document = null; try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory .newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementCont...
[ "public", "static", "Document", "toDocument", "(", "JAXBElement", "<", "?", ">", "jaxbElement", ",", "boolean", "prettyPrint", ")", "{", "Document", "document", "=", "null", ";", "try", "{", "DocumentBuilderFactory", "documentBuilderFactory", "=", "DocumentBuilderFa...
Returns a Document for a JAXBElement @param jaxbElement JAXB representation of an XML Element @param prettyPrint True for pretty print, otherwise false @return The Document representation
[ "Returns", "a", "Document", "for", "a", "JAXBElement" ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/DocumentUtilities.java#L111-L166
37,526
STIXProject/java-stix
src/main/java/org/mitre/stix/DocumentUtilities.java
DocumentUtilities.toXMLString
public static String toXMLString(JAXBElement<?> jaxbElement, boolean prettyPrint) { Document document = toDocument(jaxbElement); return toXMLString(document, prettyPrint); }
java
public static String toXMLString(JAXBElement<?> jaxbElement, boolean prettyPrint) { Document document = toDocument(jaxbElement); return toXMLString(document, prettyPrint); }
[ "public", "static", "String", "toXMLString", "(", "JAXBElement", "<", "?", ">", "jaxbElement", ",", "boolean", "prettyPrint", ")", "{", "Document", "document", "=", "toDocument", "(", "jaxbElement", ")", ";", "return", "toXMLString", "(", "document", ",", "pre...
Returns a String for a JAXBElement @param jaxbElement JAXB representation of an XML Element to be printed. @param prettyPrint True for pretty print, otherwise false @return String containing the XML mark-up.
[ "Returns", "a", "String", "for", "a", "JAXBElement" ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/DocumentUtilities.java#L177-L184
37,527
STIXProject/java-stix
src/main/java/org/mitre/stix/DocumentUtilities.java
DocumentUtilities.traverse
private final static void traverse(Element element, ElementVisitor visitor) { visitor.visit(element); NodeList children = element.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node.getNodeType() != Node.ELEMENT_NODE) continue; traverse((Eleme...
java
private final static void traverse(Element element, ElementVisitor visitor) { visitor.visit(element); NodeList children = element.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node.getNodeType() != Node.ELEMENT_NODE) continue; traverse((Eleme...
[ "private", "final", "static", "void", "traverse", "(", "Element", "element", ",", "ElementVisitor", "visitor", ")", "{", "visitor", ".", "visit", "(", "element", ")", ";", "NodeList", "children", "=", "element", ".", "getChildNodes", "(", ")", ";", "for", ...
Used to traverse an XML document. @param element Represents an element in an XML document. @param visitor Code to be executed.
[ "Used", "to", "traverse", "an", "XML", "document", "." ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/DocumentUtilities.java#L264-L278
37,528
STIXProject/java-stix
src/main/java/org/mitre/stix/DocumentUtilities.java
DocumentUtilities.toDocument
public static Document toDocument(String xml) { try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory .newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementContentWhitespace(true); documentBuilderFactory.isIgnoringComments(); ...
java
public static Document toDocument(String xml) { try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory .newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementContentWhitespace(true); documentBuilderFactory.isIgnoringComments(); ...
[ "public", "static", "Document", "toDocument", "(", "String", "xml", ")", "{", "try", "{", "DocumentBuilderFactory", "documentBuilderFactory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "documentBuilderFactory", ".", "setNamespaceAware", "(", "tr...
Creates a Document from XML String @param xml The XML String @return The Document representation
[ "Creates", "a", "Document", "from", "XML", "String" ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/DocumentUtilities.java#L394-L424
37,529
STIXProject/java-stix
src/main/java/org/mitre/stix/DocumentUtilities.java
DocumentUtilities.stripFormattingfromXMLString
public static String stripFormattingfromXMLString(String xml) { try { Document document = DocumentUtilities.toDocument(xml); DOMImplementationRegistry registry = DOMImplementationRegistry .newInstance(); DOMImplementationLS domImplementationLS = (DOMImplementationLS) registry .getDOMImplementation...
java
public static String stripFormattingfromXMLString(String xml) { try { Document document = DocumentUtilities.toDocument(xml); DOMImplementationRegistry registry = DOMImplementationRegistry .newInstance(); DOMImplementationLS domImplementationLS = (DOMImplementationLS) registry .getDOMImplementation...
[ "public", "static", "String", "stripFormattingfromXMLString", "(", "String", "xml", ")", "{", "try", "{", "Document", "document", "=", "DocumentUtilities", ".", "toDocument", "(", "xml", ")", ";", "DOMImplementationRegistry", "registry", "=", "DOMImplementationRegistr...
Strips formatting from an XML String @param xml The XML String to reformatted @return The XML String as on line.
[ "Strips", "formatting", "from", "an", "XML", "String" ]
796b1314253fac3ebafca347f6eeb2c51ba4b009
https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/DocumentUtilities.java#L433-L470
37,530
square/pagerduty-incidents
src/main/java/com/squareup/pagerduty/incidents/PagerDuty.java
PagerDuty.create
public static PagerDuty create(String apiKey) { Retrofit retrofit = new Retrofit.Builder() // .baseUrl(HOST) // .addConverterFactory(GsonConverterFactory.create()) .build(); return create(apiKey, retrofit); }
java
public static PagerDuty create(String apiKey) { Retrofit retrofit = new Retrofit.Builder() // .baseUrl(HOST) // .addConverterFactory(GsonConverterFactory.create()) .build(); return create(apiKey, retrofit); }
[ "public", "static", "PagerDuty", "create", "(", "String", "apiKey", ")", "{", "Retrofit", "retrofit", "=", "new", "Retrofit", ".", "Builder", "(", ")", "//", ".", "baseUrl", "(", "HOST", ")", "//", ".", "addConverterFactory", "(", "GsonConverterFactory", "."...
Create a new instance using the specified API key.
[ "Create", "a", "new", "instance", "using", "the", "specified", "API", "key", "." ]
81f29c2bd5b08c8a2f0d2abd2083f23d150fc8dd
https://github.com/square/pagerduty-incidents/blob/81f29c2bd5b08c8a2f0d2abd2083f23d150fc8dd/src/main/java/com/squareup/pagerduty/incidents/PagerDuty.java#L30-L36
37,531
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/FavoriteDatabase.java
FavoriteDatabase.add
public void add(Article article) { // Get Write Access SQLiteDatabase db = this.getWritableDatabase(); // Build Content Values ContentValues values = new ContentValues(); values.put(KEY_TAGS, TextUtils.join("_PCX_", article.getTags())); values.put(KEY_MEDIA_CONTENT, Article.MediaContent.toByteArray(article...
java
public void add(Article article) { // Get Write Access SQLiteDatabase db = this.getWritableDatabase(); // Build Content Values ContentValues values = new ContentValues(); values.put(KEY_TAGS, TextUtils.join("_PCX_", article.getTags())); values.put(KEY_MEDIA_CONTENT, Article.MediaContent.toByteArray(article...
[ "public", "void", "add", "(", "Article", "article", ")", "{", "// Get Write Access", "SQLiteDatabase", "db", "=", "this", ".", "getWritableDatabase", "(", ")", ";", "// Build Content Values", "ContentValues", "values", "=", "new", "ContentValues", "(", ")", ";", ...
Inserts an Article object to this database. @param article Object to save into database.
[ "Inserts", "an", "Article", "object", "to", "this", "database", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/FavoriteDatabase.java#L84-L105
37,532
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/FavoriteDatabase.java
FavoriteDatabase.delete
public void delete(Article article) { SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_ARTICLES, KEY_ID + " = ?", new String[] {String.valueOf(article.getId())}); db.close(); }
java
public void delete(Article article) { SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_ARTICLES, KEY_ID + " = ?", new String[] {String.valueOf(article.getId())}); db.close(); }
[ "public", "void", "delete", "(", "Article", "article", ")", "{", "SQLiteDatabase", "db", "=", "this", ".", "getWritableDatabase", "(", ")", ";", "db", ".", "delete", "(", "TABLE_ARTICLES", ",", "KEY_ID", "+", "\" = ?\"", ",", "new", "String", "[", "]", "...
Removes a specified Article from this database based on its ID value. @param article Article to remove. May contain dummy data as long as the id is valid.
[ "Removes", "a", "specified", "Article", "from", "this", "database", "based", "on", "its", "ID", "value", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/FavoriteDatabase.java#L189-L193
37,533
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/FavoriteDatabase.java
FavoriteDatabase.deleteAll
public void deleteAll() { SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_ARTICLES, null, null); db.close(); }
java
public void deleteAll() { SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_ARTICLES, null, null); db.close(); }
[ "public", "void", "deleteAll", "(", ")", "{", "SQLiteDatabase", "db", "=", "this", ".", "getWritableDatabase", "(", ")", ";", "db", ".", "delete", "(", "TABLE_ARTICLES", ",", "null", ",", "null", ")", ";", "db", ".", "close", "(", ")", ";", "}" ]
Removes ALL content stored in this database!
[ "Removes", "ALL", "content", "stored", "in", "this", "database!" ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/FavoriteDatabase.java#L198-L202
37,534
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/Article.java
Article.putExtra
public Article putExtra(String key, String value) { this.extras.putString(key, value); return this; }
java
public Article putExtra(String key, String value) { this.extras.putString(key, value); return this; }
[ "public", "Article", "putExtra", "(", "String", "key", ",", "String", "value", ")", "{", "this", ".", "extras", ".", "putString", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a given value into a Bundle associated with this Article instance. @param key A String key. @param value Value to insert.
[ "Inserts", "a", "given", "value", "into", "a", "Bundle", "associated", "with", "this", "Article", "instance", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/Article.java#L118-L121
37,535
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/Article.java
Article.addMediaContent
public Article addMediaContent(MediaContent mediaContent) { if(mediaContent == null) return this; if(this.mediaContentVec == null) this.mediaContentVec = new Vector<>(); this.mediaContentVec.add(mediaContent); return this; }
java
public Article addMediaContent(MediaContent mediaContent) { if(mediaContent == null) return this; if(this.mediaContentVec == null) this.mediaContentVec = new Vector<>(); this.mediaContentVec.add(mediaContent); return this; }
[ "public", "Article", "addMediaContent", "(", "MediaContent", "mediaContent", ")", "{", "if", "(", "mediaContent", "==", "null", ")", "return", "this", ";", "if", "(", "this", ".", "mediaContentVec", "==", "null", ")", "this", ".", "mediaContentVec", "=", "ne...
Adds a single media content item to the list @param mediaContent The media content object to add
[ "Adds", "a", "single", "media", "content", "item", "to", "the", "list" ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/Article.java#L188-L198
37,536
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/Article.java
Article.removeMediaContent
public Article removeMediaContent(MediaContent mediaContent) { if(mediaContent == null || this.mediaContentVec == null) return this; this.mediaContentVec.remove(mediaContent); return this; }
java
public Article removeMediaContent(MediaContent mediaContent) { if(mediaContent == null || this.mediaContentVec == null) return this; this.mediaContentVec.remove(mediaContent); return this; }
[ "public", "Article", "removeMediaContent", "(", "MediaContent", "mediaContent", ")", "{", "if", "(", "mediaContent", "==", "null", "||", "this", ".", "mediaContentVec", "==", "null", ")", "return", "this", ";", "this", ".", "mediaContentVec", ".", "remove", "(...
Removes a single media content item from the list @param mediaContent The media content object to remove
[ "Removes", "a", "single", "media", "content", "item", "from", "the", "list" ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/Article.java#L204-L211
37,537
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/Article.java
Article.markRead
public boolean markRead(boolean read) { if (PkRSS.getInstance() == null) return false; PkRSS.getInstance().markRead(id, read); return true; }
java
public boolean markRead(boolean read) { if (PkRSS.getInstance() == null) return false; PkRSS.getInstance().markRead(id, read); return true; }
[ "public", "boolean", "markRead", "(", "boolean", "read", ")", "{", "if", "(", "PkRSS", ".", "getInstance", "(", ")", "==", "null", ")", "return", "false", ";", "PkRSS", ".", "getInstance", "(", ")", ".", "markRead", "(", "id", ",", "read", ")", ";", ...
Adds this article's id to the read index. @param read Whether or not to mark it as read. @return {@code true} if successful, {@code false} if otherwise.
[ "Adds", "this", "article", "s", "id", "to", "the", "read", "index", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/Article.java#L405-L410
37,538
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/Article.java
Article.saveFavorite
public boolean saveFavorite(boolean favorite) { if (PkRSS.getInstance() == null) return false; return PkRSS.getInstance().saveFavorite(this, favorite); }
java
public boolean saveFavorite(boolean favorite) { if (PkRSS.getInstance() == null) return false; return PkRSS.getInstance().saveFavorite(this, favorite); }
[ "public", "boolean", "saveFavorite", "(", "boolean", "favorite", ")", "{", "if", "(", "PkRSS", ".", "getInstance", "(", ")", "==", "null", ")", "return", "false", ";", "return", "PkRSS", ".", "getInstance", "(", ")", ".", "saveFavorite", "(", "this", ","...
Adds this article into the favorites database. @param favorite Whether to add it or remove it. @return {@code true} if successful, {@code false} if otherwise.
[ "Adds", "this", "article", "into", "the", "favorites", "database", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/Article.java#L434-L438
37,539
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/parser/Rss2Parser.java
Rss2Parser.handleNode
private boolean handleNode(String tag, Article article) { try { if(xmlParser.next() != XmlPullParser.TEXT) return false; if (tag.equalsIgnoreCase("link")) article.setSource(Uri.parse(xmlParser.getText())); else if (tag.equalsIgnoreCase("title")) article.setTitle(xmlParser.getText()); else if ...
java
private boolean handleNode(String tag, Article article) { try { if(xmlParser.next() != XmlPullParser.TEXT) return false; if (tag.equalsIgnoreCase("link")) article.setSource(Uri.parse(xmlParser.getText())); else if (tag.equalsIgnoreCase("title")) article.setTitle(xmlParser.getText()); else if ...
[ "private", "boolean", "handleNode", "(", "String", "tag", ",", "Article", "article", ")", "{", "try", "{", "if", "(", "xmlParser", ".", "next", "(", ")", "!=", "XmlPullParser", ".", "TEXT", ")", "return", "false", ";", "if", "(", "tag", ".", "equalsIgn...
Handles a node from the tag node and assigns it to the correct article value. @param tag The tag which to handle. @param article Article object to assign the node value to. @return True if a proper tag was given or handled. False if improper tag was given or if an exception if triggered.
[ "Handles", "a", "node", "from", "the", "tag", "node", "and", "assigns", "it", "to", "the", "correct", "article", "value", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/parser/Rss2Parser.java#L130-L166
37,540
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/parser/Rss2Parser.java
Rss2Parser.handleMediaContent
private void handleMediaContent(String tag, Article article) { String url = xmlParser.getAttributeValue(null, "url"); if(url == null) { throw new IllegalArgumentException("Url argument must not be null"); } Article.MediaContent mc = new Article.MediaContent(); article.addMediaContent(mc); mc.setUrl(url)...
java
private void handleMediaContent(String tag, Article article) { String url = xmlParser.getAttributeValue(null, "url"); if(url == null) { throw new IllegalArgumentException("Url argument must not be null"); } Article.MediaContent mc = new Article.MediaContent(); article.addMediaContent(mc); mc.setUrl(url)...
[ "private", "void", "handleMediaContent", "(", "String", "tag", ",", "Article", "article", ")", "{", "String", "url", "=", "xmlParser", ".", "getAttributeValue", "(", "null", ",", "\"url\"", ")", ";", "if", "(", "url", "==", "null", ")", "{", "throw", "ne...
Parses the media content of the entry @param tag The tag which to handle. @param article Article object to assign the node value to.
[ "Parses", "the", "media", "content", "of", "the", "entry" ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/parser/Rss2Parser.java#L173-L235
37,541
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/Utils.java
Utils.deleteDir
public static boolean deleteDir(File dir) { if (dir != null && dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { if (!deleteDir(new File(dir, children[i]))) return false; } } return dir.delete(); }
java
public static boolean deleteDir(File dir) { if (dir != null && dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { if (!deleteDir(new File(dir, children[i]))) return false; } } return dir.delete(); }
[ "public", "static", "boolean", "deleteDir", "(", "File", "dir", ")", "{", "if", "(", "dir", "!=", "null", "&&", "dir", ".", "isDirectory", "(", ")", ")", "{", "String", "[", "]", "children", "=", "dir", ".", "list", "(", ")", ";", "for", "(", "in...
Deletes the specified directory. Returns true if successful, false if not. @param dir Directory to delete. @return {@code true} if successful, {@code false} if otherwise.
[ "Deletes", "the", "specified", "directory", ".", "Returns", "true", "if", "successful", "false", "if", "not", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/Utils.java#L20-L29
37,542
Pkmmte/PkRSS
pkrss/src/main/java/com/pkmmte/pkrss/Utils.java
Utils.createDefaultDownloader
public static Downloader createDefaultDownloader(Context context) { Downloader downloaderInstance = null; try { Class.forName("com.squareup.okhttp.OkHttpClient"); downloaderInstance = new OkHttpDownloader(context); } catch (ClassNotFoundException ignored) {} try { Class.forName("okhttp3.OkHttpClient...
java
public static Downloader createDefaultDownloader(Context context) { Downloader downloaderInstance = null; try { Class.forName("com.squareup.okhttp.OkHttpClient"); downloaderInstance = new OkHttpDownloader(context); } catch (ClassNotFoundException ignored) {} try { Class.forName("okhttp3.OkHttpClient...
[ "public", "static", "Downloader", "createDefaultDownloader", "(", "Context", "context", ")", "{", "Downloader", "downloaderInstance", "=", "null", ";", "try", "{", "Class", ".", "forName", "(", "\"com.squareup.okhttp.OkHttpClient\"", ")", ";", "downloaderInstance", "=...
Creates a Downloader object depending on the dependencies present. @param context Application context. @return {@link OkHttp3Downloader} or {@link OkHttpDownloader} if the OkHttp library is present, {@link DefaultDownloader} if not.
[ "Creates", "a", "Downloader", "object", "depending", "on", "the", "dependencies", "present", "." ]
0bc536d3bad1dade4538616f71c3a8f068eac89a
https://github.com/Pkmmte/PkRSS/blob/0bc536d3bad1dade4538616f71c3a8f068eac89a/pkrss/src/main/java/com/pkmmte/pkrss/Utils.java#L38-L58
37,543
sephiroth74/Android-Easing
library/src/main/java/it/sephiroth/android/library/easing/EasingManager.java
EasingManager.start
public void start( Class<? extends Easing> clazz, EaseType type, double fromValue, double endValue, int durationMillis, long delayMillis ) { if ( !mRunning ) { mEasing = createInstance( clazz ); if( null == mEasing ){ return; } mMethod = getEasingMethod( mEasing, type ); if( mMethod == null...
java
public void start( Class<? extends Easing> clazz, EaseType type, double fromValue, double endValue, int durationMillis, long delayMillis ) { if ( !mRunning ) { mEasing = createInstance( clazz ); if( null == mEasing ){ return; } mMethod = getEasingMethod( mEasing, type ); if( mMethod == null...
[ "public", "void", "start", "(", "Class", "<", "?", "extends", "Easing", ">", "clazz", ",", "EaseType", "type", ",", "double", "fromValue", ",", "double", "endValue", ",", "int", "durationMillis", ",", "long", "delayMillis", ")", "{", "if", "(", "!", "mRu...
Start the easing with a delay @param clazz the Easing class to be used for the interpolation @param type the Easing Type @param fromValue the start value of the easing @param endValue the end value of the easing @param durationMillis the duration in ms of the easing @param delayMillis the delay
[ "Start", "the", "easing", "with", "a", "delay" ]
89caead2e0da4287631250e1dbb182d51b66055b
https://github.com/sephiroth74/Android-Easing/blob/89caead2e0da4287631250e1dbb182d51b66055b/library/src/main/java/it/sephiroth/android/library/easing/EasingManager.java#L78-L116
37,544
DJCordhose/jmte
src/com/floreysoft/jmte/ModelBuilder.java
ModelBuilder.mergeLists
public static List<Map<String, Object>> mergeLists(String[] names, List<Object>... lists) { List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); if (lists.length != 0) { // first check if all looks good int expectedSize = lists[0].size(); for (int i = 1; i < lists.length;...
java
public static List<Map<String, Object>> mergeLists(String[] names, List<Object>... lists) { List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); if (lists.length != 0) { // first check if all looks good int expectedSize = lists[0].size(); for (int i = 1; i < lists.length;...
[ "public", "static", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "mergeLists", "(", "String", "[", "]", "names", ",", "List", "<", "Object", ">", "...", "lists", ")", "{", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", ...
Merges any number of named lists into a single one containing their combined values. Can be very handy in case of a servlet request which might contain several lists of parameters that you want to iterate over in a combined way. @param names the names of the variables in the following lists @param lists the lists cont...
[ "Merges", "any", "number", "of", "named", "lists", "into", "a", "single", "one", "containing", "their", "combined", "values", ".", "Can", "be", "very", "handy", "in", "case", "of", "a", "servlet", "request", "which", "might", "contain", "several", "lists", ...
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/ModelBuilder.java#L92-L121
37,545
DJCordhose/jmte
src/com/floreysoft/jmte/util/MiniParser.java
MiniParser.append
private void append(StringBuilder buffer, char c) { // version manually simplified // final boolean shouldAppend = rawOutput || escaped // || (c != quoteChar && c != escapeChar); // final boolean newEscaped = c == escapeChar && !escaped; // final boolean newQuoted = (c == quoteChar && !escaped) ? !quot...
java
private void append(StringBuilder buffer, char c) { // version manually simplified // final boolean shouldAppend = rawOutput || escaped // || (c != quoteChar && c != escapeChar); // final boolean newEscaped = c == escapeChar && !escaped; // final boolean newQuoted = (c == quoteChar && !escaped) ? !quot...
[ "private", "void", "append", "(", "StringBuilder", "buffer", ",", "char", "c", ")", "{", "// version manually simplified\r", "// final boolean shouldAppend = rawOutput || escaped\r", "// || (c != quoteChar && c != escapeChar);\r", "// final boolean newEscaped = c == escapeChar && !escape...
the heart of it all
[ "the", "heart", "of", "it", "all" ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/MiniParser.java#L277-L327
37,546
DJCordhose/jmte
src/com/floreysoft/jmte/Engine.java
Engine.variablesAvailable
public boolean variablesAvailable(Map<String, Object> model, String... vars) { final TemplateContext context = new TemplateContext(null, null, null, new ScopedMap(model), modelAdaptor, this, new SilentErrorHandler(), null); for (String var : vars) { final IfToken token = new IfToken(var, false); if (...
java
public boolean variablesAvailable(Map<String, Object> model, String... vars) { final TemplateContext context = new TemplateContext(null, null, null, new ScopedMap(model), modelAdaptor, this, new SilentErrorHandler(), null); for (String var : vars) { final IfToken token = new IfToken(var, false); if (...
[ "public", "boolean", "variablesAvailable", "(", "Map", "<", "String", ",", "Object", ">", "model", ",", "String", "...", "vars", ")", "{", "final", "TemplateContext", "context", "=", "new", "TemplateContext", "(", "null", ",", "null", ",", "null", ",", "ne...
Checks if all given variables are there and if so, that they evaluate to true inside an if.
[ "Checks", "if", "all", "given", "variables", "are", "there", "and", "if", "so", "that", "they", "evaluate", "to", "true", "inside", "an", "if", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/Engine.java#L120-L130
37,547
DJCordhose/jmte
src/com/floreysoft/jmte/Engine.java
Engine.getUsedVariables
@Deprecated() public synchronized Set<String> getUsedVariables(String template) { Template templateImpl = getTemplate(template, null); return templateImpl.getUsedVariables(); }
java
@Deprecated() public synchronized Set<String> getUsedVariables(String template) { Template templateImpl = getTemplate(template, null); return templateImpl.getUsedVariables(); }
[ "@", "Deprecated", "(", ")", "public", "synchronized", "Set", "<", "String", ">", "getUsedVariables", "(", "String", "template", ")", "{", "Template", "templateImpl", "=", "getTemplate", "(", "template", ",", "null", ")", ";", "return", "templateImpl", ".", ...
Gets all variables used in the given template. @deprecated use {@link #getUsedVariableDescriptions(String)} instead
[ "Gets", "all", "variables", "used", "in", "the", "given", "template", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/Engine.java#L239-L243
37,548
DJCordhose/jmte
src/com/floreysoft/jmte/Engine.java
Engine.getUsedVariableDescriptions
public synchronized List<VariableDescription> getUsedVariableDescriptions(String template) { Template templateImpl = getTemplate(template, null); return templateImpl.getUsedVariableDescriptions(); }
java
public synchronized List<VariableDescription> getUsedVariableDescriptions(String template) { Template templateImpl = getTemplate(template, null); return templateImpl.getUsedVariableDescriptions(); }
[ "public", "synchronized", "List", "<", "VariableDescription", ">", "getUsedVariableDescriptions", "(", "String", "template", ")", "{", "Template", "templateImpl", "=", "getTemplate", "(", "template", ",", "null", ")", ";", "return", "templateImpl", ".", "getUsedVari...
Gets all variables used in the given template as a detailed description.
[ "Gets", "all", "variables", "used", "in", "the", "given", "template", "as", "a", "detailed", "description", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/Engine.java#L249-L252
37,549
DJCordhose/jmte
src/com/floreysoft/jmte/TemplateContext.java
TemplateContext.pop
public Token pop() { if (scopes.isEmpty()) { return null; } else { Token token = scopes.remove(scopes.size() - 1); return token; } }
java
public Token pop() { if (scopes.isEmpty()) { return null; } else { Token token = scopes.remove(scopes.size() - 1); return token; } }
[ "public", "Token", "pop", "(", ")", "{", "if", "(", "scopes", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "else", "{", "Token", "token", "=", "scopes", ".", "remove", "(", "scopes", ".", "size", "(", ")", "-", "1", ")", ";",...
Pops a token from the scope stack.
[ "Pops", "a", "token", "from", "the", "scope", "stack", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/TemplateContext.java#L57-L64
37,550
DJCordhose/jmte
src/com/floreysoft/jmte/TemplateContext.java
TemplateContext.peek
public Token peek() { if (scopes.isEmpty()) { return null; } else { Token token = scopes.get(scopes.size() - 1); return token; } }
java
public Token peek() { if (scopes.isEmpty()) { return null; } else { Token token = scopes.get(scopes.size() - 1); return token; } }
[ "public", "Token", "peek", "(", ")", "{", "if", "(", "scopes", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "else", "{", "Token", "token", "=", "scopes", ".", "get", "(", "scopes", ".", "size", "(", ")", "-", "1", ")", ";", ...
Gets the top element from the stack without removing it.
[ "Gets", "the", "top", "element", "from", "the", "stack", "without", "removing", "it", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/TemplateContext.java#L69-L76
37,551
DJCordhose/jmte
src/com/floreysoft/jmte/TemplateContext.java
TemplateContext.notifyProcessListener
public void notifyProcessListener(Token token, Action action) { if (processListener != null) { processListener.log(this, token, action); } }
java
public void notifyProcessListener(Token token, Action action) { if (processListener != null) { processListener.log(this, token, action); } }
[ "public", "void", "notifyProcessListener", "(", "Token", "token", ",", "Action", "action", ")", "{", "if", "(", "processListener", "!=", "null", ")", "{", "processListener", ".", "log", "(", "this", ",", "token", ",", "action", ")", ";", "}", "}" ]
Allows you to send additional notifications of executed processing steps. @param token the token that is handled @param action the action that is executed on the action
[ "Allows", "you", "to", "send", "additional", "notifications", "of", "executed", "processing", "steps", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/TemplateContext.java#L100-L104
37,552
DJCordhose/jmte
src/com/floreysoft/jmte/util/Util.java
Util.streamToString
public static String streamToString(InputStream is, String charsetName) { try { Reader r = null; try { r = new BufferedReader(new InputStreamReader(is, charsetName)); return readerToString(r); } finally { if (r != null) { try { r.close(); } catch (IOException e) { ...
java
public static String streamToString(InputStream is, String charsetName) { try { Reader r = null; try { r = new BufferedReader(new InputStreamReader(is, charsetName)); return readerToString(r); } finally { if (r != null) { try { r.close(); } catch (IOException e) { ...
[ "public", "static", "String", "streamToString", "(", "InputStream", "is", ",", "String", "charsetName", ")", "{", "try", "{", "Reader", "r", "=", "null", ";", "try", "{", "r", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "is", ",", ...
Transforms a stream into a string. @param is the stream to be transformed @param charsetName encoding of the file @return the string containing the content of the stream
[ "Transforms", "a", "stream", "into", "a", "string", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/Util.java#L124-L142
37,553
DJCordhose/jmte
src/com/floreysoft/jmte/util/Util.java
Util.resourceToString
public static String resourceToString(String resourceName, String charsetName) { InputStream templateStream = Thread.currentThread() .getContextClassLoader().getResourceAsStream(resourceName); String template = Util.streamToString(templateStream, "UTF-8"); return template; }
java
public static String resourceToString(String resourceName, String charsetName) { InputStream templateStream = Thread.currentThread() .getContextClassLoader().getResourceAsStream(resourceName); String template = Util.streamToString(templateStream, "UTF-8"); return template; }
[ "public", "static", "String", "resourceToString", "(", "String", "resourceName", ",", "String", "charsetName", ")", "{", "InputStream", "templateStream", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "getResourceAsStream...
Loads a stream from the classpath and transforms it into a string. @param resourceName the name of the resource to be transformed @param charsetName encoding of the resource @return the string containing the content of the resource @see ClassLoader#getResourceAsStream(String)
[ "Loads", "a", "stream", "from", "the", "classpath", "and", "transforms", "it", "into", "a", "string", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/Util.java#L154-L160
37,554
DJCordhose/jmte
src/com/floreysoft/jmte/util/Util.java
Util.readerToString
public static String readerToString(Reader reader) { try { StringBuilder sb = new StringBuilder(); char[] buf = new char[1024]; int numRead = 0; while ((numRead = reader.read(buf)) != -1) { sb.append(buf, 0, numRead); } return sb.toString(); } catch (Exception e) { throw new Runti...
java
public static String readerToString(Reader reader) { try { StringBuilder sb = new StringBuilder(); char[] buf = new char[1024]; int numRead = 0; while ((numRead = reader.read(buf)) != -1) { sb.append(buf, 0, numRead); } return sb.toString(); } catch (Exception e) { throw new Runti...
[ "public", "static", "String", "readerToString", "(", "Reader", "reader", ")", "{", "try", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "char", "[", "]", "buf", "=", "new", "char", "[", "1024", "]", ";", "int", "numRead", "=",...
Transforms a reader into a string. @param reader the reader to be transformed @return the string containing the content of the reader
[ "Transforms", "a", "reader", "into", "a", "string", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/Util.java#L169-L182
37,555
DJCordhose/jmte
src/com/floreysoft/jmte/util/Util.java
Util.arrayAsList
@SuppressWarnings({ "unchecked", "rawtypes" }) public static List<Object> arrayAsList(Object value) { if (value instanceof List) { return (List<Object>) value; } List list = null; if (value instanceof int[]) { list = new ArrayList(); int[] array = (int[]) value; for (int i : array) { ...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public static List<Object> arrayAsList(Object value) { if (value instanceof List) { return (List<Object>) value; } List list = null; if (value instanceof int[]) { list = new ArrayList(); int[] array = (int[]) value; for (int i : array) { ...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "static", "List", "<", "Object", ">", "arrayAsList", "(", "Object", "value", ")", "{", "if", "(", "value", "instanceof", "List", ")", "{", "return", "(", "List", ...
Transforms any array to a matching list @param value something that might be an array @return List representation if passed in value was an array, <code>null</code> otherwise
[ "Transforms", "any", "array", "to", "a", "matching", "list" ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/Util.java#L208-L267
37,556
DJCordhose/jmte
src/com/floreysoft/jmte/util/Util.java
Util.trimFront
public static String trimFront(String input) { int i = 0; while (i < input.length() && Character.isWhitespace(input.charAt(i))) i++; return input.substring(i); }
java
public static String trimFront(String input) { int i = 0; while (i < input.length() && Character.isWhitespace(input.charAt(i))) i++; return input.substring(i); }
[ "public", "static", "String", "trimFront", "(", "String", "input", ")", "{", "int", "i", "=", "0", ";", "while", "(", "i", "<", "input", ".", "length", "(", ")", "&&", "Character", ".", "isWhitespace", "(", "input", ".", "charAt", "(", "i", ")", ")...
Trims off white space from the beginning of a string. @param input the string to be trimmed @return the trimmed string
[ "Trims", "off", "white", "space", "from", "the", "beginning", "of", "a", "string", "." ]
7334e6d111cc2198c5cf69ee336584ab9e192fe5
https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/util/Util.java#L294-L299
37,557
pantsbuild/jarjar
src/main/java/org/pantsbuild/jarjar/misplaced/MisplacedClassProcessorFactory.java
MisplacedClassProcessorFactory.getProcessorForName
public MisplacedClassProcessor getProcessorForName(String name) { if (name == null) { return getDefaultProcessor(); } switch (Strategy.valueOf(name.toUpperCase())) { case FATAL: return new FatalMisplacedClassProcessor(); case MOVE: return new MoveMisplacedClassProcessor(); case OMIT...
java
public MisplacedClassProcessor getProcessorForName(String name) { if (name == null) { return getDefaultProcessor(); } switch (Strategy.valueOf(name.toUpperCase())) { case FATAL: return new FatalMisplacedClassProcessor(); case MOVE: return new MoveMisplacedClassProcessor(); case OMIT...
[ "public", "MisplacedClassProcessor", "getProcessorForName", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "getDefaultProcessor", "(", ")", ";", "}", "switch", "(", "Strategy", ".", "valueOf", "(", "name", ".", "toUpper...
Creates a MisplacedClassProcessor according for the given strategy name. @param name The case-insensitive user-level strategy name (see the STRATEGY_* constants). @return The MisplacedClassProcessor corresponding to the strategy name, or the result of getDefaultProcessor() if name is null. @throws IllegalArgumentExcep...
[ "Creates", "a", "MisplacedClassProcessor", "according", "for", "the", "given", "strategy", "name", "." ]
57845dc73d3e2c9b916ae4a788cfa12114fd7df1
https://github.com/pantsbuild/jarjar/blob/57845dc73d3e2c9b916ae4a788cfa12114fd7df1/src/main/java/org/pantsbuild/jarjar/misplaced/MisplacedClassProcessorFactory.java#L51-L64
37,558
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/ReadUtil.java
ReadUtil.safeRead
public static int safeRead(final InputStream inputStream, final byte[] buffer) throws IOException { int readBytes = inputStream.read(buffer); if(readBytes == -1) { return -1; } if(readBytes < buffer.length) { int offset = readBytes; int left = buffer.l...
java
public static int safeRead(final InputStream inputStream, final byte[] buffer) throws IOException { int readBytes = inputStream.read(buffer); if(readBytes == -1) { return -1; } if(readBytes < buffer.length) { int offset = readBytes; int left = buffer.l...
[ "public", "static", "int", "safeRead", "(", "final", "InputStream", "inputStream", ",", "final", "byte", "[", "]", "buffer", ")", "throws", "IOException", "{", "int", "readBytes", "=", "inputStream", ".", "read", "(", "buffer", ")", ";", "if", "(", "readBy...
Read a number of bytes from the stream and store it in the buffer, and fix the problem with "incomplete" reads by doing another read if we don't have all of the data yet. @param inputStream the input stream to read from @param buffer where to store the data @return the number of bytes read (should be == length if...
[ "Read", "a", "number", "of", "bytes", "from", "the", "stream", "and", "store", "it", "in", "the", "buffer", "and", "fix", "the", "problem", "with", "incomplete", "reads", "by", "doing", "another", "read", "if", "we", "don", "t", "have", "all", "of", "t...
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/ReadUtil.java#L51-L74
37,559
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/ReadUtil.java
ReadUtil.eofIsNext
public static boolean eofIsNext(final RawPacket rawPacket) { final ByteBuffer buf = rawPacket.getByteBuffer(); return (buf.get(0) == (byte)0xfe && buf.capacity() < 9); }
java
public static boolean eofIsNext(final RawPacket rawPacket) { final ByteBuffer buf = rawPacket.getByteBuffer(); return (buf.get(0) == (byte)0xfe && buf.capacity() < 9); }
[ "public", "static", "boolean", "eofIsNext", "(", "final", "RawPacket", "rawPacket", ")", "{", "final", "ByteBuffer", "buf", "=", "rawPacket", ".", "getByteBuffer", "(", ")", ";", "return", "(", "buf", ".", "get", "(", "0", ")", "==", "(", "byte", ")", ...
Checks whether the next packet is EOF. @param rawPacket the raw packet @return true if the packet is an EOF packet
[ "Checks", "whether", "the", "next", "packet", "is", "EOF", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/ReadUtil.java#L81-L85
37,560
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/packet/RawPacket.java
RawPacket.nextPacket
static RawPacket nextPacket(final InputStream is) throws IOException { byte[] lengthBuffer = readLengthSeq(is); int length = (lengthBuffer[0] & 0xff) + ((lengthBuffer[1] & 0xff) << 8) + ((lengthBuffer[2] & 0xff) << 16); if (length == -1) { return null; } if (length <...
java
static RawPacket nextPacket(final InputStream is) throws IOException { byte[] lengthBuffer = readLengthSeq(is); int length = (lengthBuffer[0] & 0xff) + ((lengthBuffer[1] & 0xff) << 8) + ((lengthBuffer[2] & 0xff) << 16); if (length == -1) { return null; } if (length <...
[ "static", "RawPacket", "nextPacket", "(", "final", "InputStream", "is", ")", "throws", "IOException", "{", "byte", "[", "]", "lengthBuffer", "=", "readLengthSeq", "(", "is", ")", ";", "int", "length", "=", "(", "lengthBuffer", "[", "0", "]", "&", "0xff", ...
Get the next packet from the stream @param is the input stream to read the next packet from @return The next packet from the stream, or NULL if the stream is closed @throws java.io.IOException if an error occurs while reading data
[ "Get", "the", "next", "packet", "from", "the", "stream" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/packet/RawPacket.java#L50-L72
37,561
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzleStatement.java
DrizzleStatement.execute
public boolean execute(final String query) throws SQLException { startTimer(); try { if (queryResult != null) { queryResult.close(); } queryResult = protocol.executeQuery(queryFactory.createQuery(query)); if (queryResult.getResultSetType() ...
java
public boolean execute(final String query) throws SQLException { startTimer(); try { if (queryResult != null) { queryResult.close(); } queryResult = protocol.executeQuery(queryFactory.createQuery(query)); if (queryResult.getResultSetType() ...
[ "public", "boolean", "execute", "(", "final", "String", "query", ")", "throws", "SQLException", "{", "startTimer", "(", ")", ";", "try", "{", "if", "(", "queryResult", "!=", "null", ")", "{", "queryResult", ".", "close", "(", ")", ";", "}", "queryResult"...
executes a query. @param query the query @return true if there was a result set, false otherwise. @throws SQLException
[ "executes", "a", "query", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleStatement.java#L204-L222
37,562
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/query/parameters/BlobStreamingParameter.java
BlobStreamingParameter.writeTo
public final int writeTo(final OutputStream os,int offset, int maxWriteSize) throws IOException { int bytesToWrite = Math.min(blobReference.getBytes().length - offset, maxWriteSize); os.write(blobReference.getBytes(), offset, blobReference.getBytes().length); return bytesToWrite; }
java
public final int writeTo(final OutputStream os,int offset, int maxWriteSize) throws IOException { int bytesToWrite = Math.min(blobReference.getBytes().length - offset, maxWriteSize); os.write(blobReference.getBytes(), offset, blobReference.getBytes().length); return bytesToWrite; }
[ "public", "final", "int", "writeTo", "(", "final", "OutputStream", "os", ",", "int", "offset", ",", "int", "maxWriteSize", ")", "throws", "IOException", "{", "int", "bytesToWrite", "=", "Math", ".", "min", "(", "blobReference", ".", "getBytes", "(", ")", "...
Writes the parameter to an outputstream. @param os the outputstream to write to @throws java.io.IOException if we cannot write to the stream
[ "Writes", "the", "parameter", "to", "an", "outputstream", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/query/parameters/BlobStreamingParameter.java#L62-L66
37,563
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/Reader.java
Reader.readString
public String readString(final String charset) throws IOException { byte ch; int cnt = 0; final byte [] byteArrBuff = new byte[byteBuffer.remaining()]; while (byteBuffer.remaining() > 0 && ((ch = byteBuffer.get()) != 0)) { byteArrBuff[cnt++] = ch; } return new...
java
public String readString(final String charset) throws IOException { byte ch; int cnt = 0; final byte [] byteArrBuff = new byte[byteBuffer.remaining()]; while (byteBuffer.remaining() > 0 && ((ch = byteBuffer.get()) != 0)) { byteArrBuff[cnt++] = ch; } return new...
[ "public", "String", "readString", "(", "final", "String", "charset", ")", "throws", "IOException", "{", "byte", "ch", ";", "int", "cnt", "=", "0", ";", "final", "byte", "[", "]", "byteArrBuff", "=", "new", "byte", "[", "byteBuffer", ".", "remaining", "("...
Reads a string from the buffer, looks for a 0 to end the string @param charset the charset to use, for example ASCII @return the read string @throws java.io.IOException if it is not possible to create the string from the buffer
[ "Reads", "a", "string", "from", "the", "buffer", "looks", "for", "a", "0", "to", "end", "the", "string" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/Reader.java#L53-L61
37,564
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/queryresults/DrizzleQueryResult.java
DrizzleQueryResult.getValueObject
public ValueObject getValueObject(final int i) throws NoSuchColumnException { if (i < 0 || i > resultSet.get(rowPointer).size()) { throw new NoSuchColumnException("No such column: " + i); } return resultSet.get(rowPointer).get(i); }
java
public ValueObject getValueObject(final int i) throws NoSuchColumnException { if (i < 0 || i > resultSet.get(rowPointer).size()) { throw new NoSuchColumnException("No such column: " + i); } return resultSet.get(rowPointer).get(i); }
[ "public", "ValueObject", "getValueObject", "(", "final", "int", "i", ")", "throws", "NoSuchColumnException", "{", "if", "(", "i", "<", "0", "||", "i", ">", "resultSet", ".", "get", "(", "rowPointer", ")", ".", "size", "(", ")", ")", "{", "throw", "new"...
gets the value at position i in the result set. i starts at zero! @param i index, starts at 0 @return
[ "gets", "the", "value", "at", "position", "i", "in", "the", "result", "set", ".", "i", "starts", "at", "zero!" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/queryresults/DrizzleQueryResult.java#L89-L94
37,565
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/Utils.java
Utils.sqlEscapeString
public static String sqlEscapeString(final String str) { StringBuilder buffer = new StringBuilder(str.length() * 2); boolean neededEscaping = false; for (int i = 0; i < str.length(); i++) { final char c = str.charAt(i); if (needsEscaping((byte) c)) { neede...
java
public static String sqlEscapeString(final String str) { StringBuilder buffer = new StringBuilder(str.length() * 2); boolean neededEscaping = false; for (int i = 0; i < str.length(); i++) { final char c = str.charAt(i); if (needsEscaping((byte) c)) { neede...
[ "public", "static", "String", "sqlEscapeString", "(", "final", "String", "str", ")", "{", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", "str", ".", "length", "(", ")", "*", "2", ")", ";", "boolean", "neededEscaping", "=", "false", ";", "for"...
escapes the given string, new string length is at most twice the length of str @param str the string to escape @return an escaped string
[ "escapes", "the", "given", "string", "new", "string", "length", "is", "at", "most", "twice", "the", "length", "of", "str" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/Utils.java#L98-L110
37,566
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/Utils.java
Utils.unpackTime
public static long unpackTime(final int packedTime) { final int hours = (packedTime & MASK_HOURS); final int minutes = (packedTime & MASK_MINUTES) >> (START_BIT_MINUTES); final int seconds = (packedTime & MASK_SECONDS) >> (START_BIT_SECONDS); final int millis = (packedTime & MASK_MILLISE...
java
public static long unpackTime(final int packedTime) { final int hours = (packedTime & MASK_HOURS); final int minutes = (packedTime & MASK_MINUTES) >> (START_BIT_MINUTES); final int seconds = (packedTime & MASK_SECONDS) >> (START_BIT_SECONDS); final int millis = (packedTime & MASK_MILLISE...
[ "public", "static", "long", "unpackTime", "(", "final", "int", "packedTime", ")", "{", "final", "int", "hours", "=", "(", "packedTime", "&", "MASK_HOURS", ")", ";", "final", "int", "minutes", "=", "(", "packedTime", "&", "MASK_MINUTES", ")", ">>", "(", "...
unpacks an integer packed by packTime @param packedTime the packed time @return a millisecond time @see Utils#packTime(long)
[ "unpacks", "an", "integer", "packed", "by", "packTime" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/Utils.java#L319-L329
37,567
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/Utils.java
Utils.isJava5
public static boolean isJava5() { if (!java5Determined) { try { java.util.Arrays.copyOf(new byte[0], 0); isJava5 = false; } catch (java.lang.NoSuchMethodError e) { isJava5 = true; } java5Determined = true; }...
java
public static boolean isJava5() { if (!java5Determined) { try { java.util.Arrays.copyOf(new byte[0], 0); isJava5 = false; } catch (java.lang.NoSuchMethodError e) { isJava5 = true; } java5Determined = true; }...
[ "public", "static", "boolean", "isJava5", "(", ")", "{", "if", "(", "!", "java5Determined", ")", "{", "try", "{", "java", ".", "util", ".", "Arrays", ".", "copyOf", "(", "new", "byte", "[", "0", "]", ",", "0", ")", ";", "isJava5", "=", "false", "...
Returns if it is a Java version up to Java 5. @return true if the VM is <= Java 5
[ "Returns", "if", "it", "is", "a", "Java", "version", "up", "to", "Java", "5", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/Utils.java#L372-L383
37,568
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java
DrizzlePreparedStatement.setTime
public void setTime(final int parameterIndex, final Time x) throws SQLException { if(x == null) { setNull(parameterIndex, Types.TIME); return; } setParameter(parameterIndex, new TimeParameter(x.getTime())); }
java
public void setTime(final int parameterIndex, final Time x) throws SQLException { if(x == null) { setNull(parameterIndex, Types.TIME); return; } setParameter(parameterIndex, new TimeParameter(x.getTime())); }
[ "public", "void", "setTime", "(", "final", "int", "parameterIndex", ",", "final", "Time", "x", ")", "throws", "SQLException", "{", "if", "(", "x", "==", "null", ")", "{", "setNull", "(", "parameterIndex", ",", "Types", ".", "TIME", ")", ";", "return", ...
Since Drizzle has no TIME datatype, time in milliseconds is stored in a packed integer @param parameterIndex the first parameter is 1, the second is 2, ... @param x the parameter value @throws java.sql.SQLException if parameterIndex does not correspond to a parameter marker in the SQL statement; if a data...
[ "Since", "Drizzle", "has", "no", "TIME", "datatype", "time", "in", "milliseconds", "is", "stored", "in", "a", "packed", "integer" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L1154-L1162
37,569
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/mysql/MySQLProtocol.java
MySQLProtocol.createDrizzleQueryResult
private QueryResult createDrizzleQueryResult(final ResultSetPacket packet) throws IOException, QueryException { final List<ColumnInformation> columnInformation = new ArrayList<ColumnInformation>(); for (int i = 0; i < packet.getFieldCount(); i++) { final RawPacket rawPacket = packetFetcher.g...
java
private QueryResult createDrizzleQueryResult(final ResultSetPacket packet) throws IOException, QueryException { final List<ColumnInformation> columnInformation = new ArrayList<ColumnInformation>(); for (int i = 0; i < packet.getFieldCount(); i++) { final RawPacket rawPacket = packetFetcher.g...
[ "private", "QueryResult", "createDrizzleQueryResult", "(", "final", "ResultSetPacket", "packet", ")", "throws", "IOException", ",", "QueryException", "{", "final", "List", "<", "ColumnInformation", ">", "columnInformation", "=", "new", "ArrayList", "<", "ColumnInformati...
create a DrizzleQueryResult - precondition is that a result set packet has been read @param packet the result set packet from the server @return a DrizzleQueryResult @throws java.io.IOException when something goes wrong while reading/writing from the server
[ "create", "a", "DrizzleQueryResult", "-", "precondition", "is", "that", "a", "result", "set", "packet", "has", "been", "read" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/mysql/MySQLProtocol.java#L297-L332
37,570
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/internal/common/AbstractValueObject.java
AbstractValueObject.getTime
public Time getTime() throws ParseException { if (rawBytes == null) { return null; } String rawValue = getString(); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); sdf.setLenient(false); final java.util.Date utilTime = sdf.parse(rawValue); re...
java
public Time getTime() throws ParseException { if (rawBytes == null) { return null; } String rawValue = getString(); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); sdf.setLenient(false); final java.util.Date utilTime = sdf.parse(rawValue); re...
[ "public", "Time", "getTime", "(", ")", "throws", "ParseException", "{", "if", "(", "rawBytes", "==", "null", ")", "{", "return", "null", ";", "}", "String", "rawValue", "=", "getString", "(", ")", ";", "SimpleDateFormat", "sdf", "=", "new", "SimpleDateForm...
Since drizzle has no TIME datatype, JDBC Time is stored in a packed integer @return the time @throws java.text.ParseException @see Utils#packTime(long) @see Utils#unpackTime(int)
[ "Since", "drizzle", "has", "no", "TIME", "datatype", "JDBC", "Time", "is", "stored", "in", "a", "packed", "integer" ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/AbstractValueObject.java#L145-L155
37,571
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzleConnection.java
DrizzleConnection.prepareStatement
public PreparedStatement prepareStatement(final String sql) throws SQLException { if (parameterizedBatchHandlerFactory == null) { this.parameterizedBatchHandlerFactory = new DefaultParameterizedBatchHandlerFactory(); } final String strippedQuery = Utils.stripQuery(sql); retur...
java
public PreparedStatement prepareStatement(final String sql) throws SQLException { if (parameterizedBatchHandlerFactory == null) { this.parameterizedBatchHandlerFactory = new DefaultParameterizedBatchHandlerFactory(); } final String strippedQuery = Utils.stripQuery(sql); retur...
[ "public", "PreparedStatement", "prepareStatement", "(", "final", "String", "sql", ")", "throws", "SQLException", "{", "if", "(", "parameterizedBatchHandlerFactory", "==", "null", ")", "{", "this", ".", "parameterizedBatchHandlerFactory", "=", "new", "DefaultParameterize...
creates a new prepared statement. Only client side prepared statement emulation right now. @param sql the query. @return a prepared statement. @throws SQLException if there is a problem preparing the statement.
[ "creates", "a", "new", "prepared", "statement", ".", "Only", "client", "side", "prepared", "statement", "emulation", "right", "now", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L119-L129
37,572
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzleConnection.java
DrizzleConnection.getAutoCommit
public boolean getAutoCommit() throws SQLException { Statement stmt = createStatement(); ResultSet rs = stmt.executeQuery("select @@autocommit"); rs.next(); boolean autocommit = rs.getBoolean(1); rs.close(); stmt.close(); return autocommit; }
java
public boolean getAutoCommit() throws SQLException { Statement stmt = createStatement(); ResultSet rs = stmt.executeQuery("select @@autocommit"); rs.next(); boolean autocommit = rs.getBoolean(1); rs.close(); stmt.close(); return autocommit; }
[ "public", "boolean", "getAutoCommit", "(", ")", "throws", "SQLException", "{", "Statement", "stmt", "=", "createStatement", "(", ")", ";", "ResultSet", "rs", "=", "stmt", ".", "executeQuery", "(", "\"select @@autocommit\"", ")", ";", "rs", ".", "next", "(", ...
returns true if statements on this connection are auto commited. @return true if auto commit is on. @throws SQLException
[ "returns", "true", "if", "statements", "on", "this", "connection", "are", "auto", "commited", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L178-L186
37,573
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzleConnection.java
DrizzleConnection.close
public void close() throws SQLException { if (isClosed()) return; try { this.timeoutExecutor.shutdown(); protocol.close(); } catch (QueryException e) { throw SQLExceptionMapper.get(e); } }
java
public void close() throws SQLException { if (isClosed()) return; try { this.timeoutExecutor.shutdown(); protocol.close(); } catch (QueryException e) { throw SQLExceptionMapper.get(e); } }
[ "public", "void", "close", "(", ")", "throws", "SQLException", "{", "if", "(", "isClosed", "(", ")", ")", "return", ";", "try", "{", "this", ".", "timeoutExecutor", ".", "shutdown", "(", ")", ";", "protocol", ".", "close", "(", ")", ";", "}", "catch"...
close the connection. @throws SQLException if there is a problem talking to the server.
[ "close", "the", "connection", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L228-L238
37,574
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzleConnection.java
DrizzleConnection.getMetaData
public DatabaseMetaData getMetaData() throws SQLException { return new CommonDatabaseMetaData.Builder(protocol.getDatabaseType(), this). url("jdbc:drizzle://" + protocol.getHost() + ":" + protocol.getPort() + "/" + protocol.getDatabase()). ...
java
public DatabaseMetaData getMetaData() throws SQLException { return new CommonDatabaseMetaData.Builder(protocol.getDatabaseType(), this). url("jdbc:drizzle://" + protocol.getHost() + ":" + protocol.getPort() + "/" + protocol.getDatabase()). ...
[ "public", "DatabaseMetaData", "getMetaData", "(", ")", "throws", "SQLException", "{", "return", "new", "CommonDatabaseMetaData", ".", "Builder", "(", "protocol", ".", "getDatabaseType", "(", ")", ",", "this", ")", ".", "url", "(", "\"jdbc:drizzle://\"", "+", "pr...
returns the meta data about the database. @return meta data about the db. @throws SQLException if there is a problem creating the meta data.
[ "returns", "the", "meta", "data", "about", "the", "database", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L256-L265
37,575
krummas/DrizzleJDBC
src/main/java/org/drizzle/jdbc/DrizzleConnection.java
DrizzleConnection.startBinlogDump
public List<RawPacket> startBinlogDump(final int position, final String logfile) throws SQLException { try { return this.protocol.startBinlogDump(position, logfile); } catch (BinlogDumpException e) { throw SQLExceptionMapper.getSQLException("Could not dump binlog", e); } ...
java
public List<RawPacket> startBinlogDump(final int position, final String logfile) throws SQLException { try { return this.protocol.startBinlogDump(position, logfile); } catch (BinlogDumpException e) { throw SQLExceptionMapper.getSQLException("Could not dump binlog", e); } ...
[ "public", "List", "<", "RawPacket", ">", "startBinlogDump", "(", "final", "int", "position", ",", "final", "String", "logfile", ")", "throws", "SQLException", "{", "try", "{", "return", "this", ".", "protocol", ".", "startBinlogDump", "(", "position", ",", "...
returns a list of binlog entries. @param position the position to start at @param logfile the log file to use @return a list of rawpackets from the server @throws SQLException if there is a problem talking to the server.
[ "returns", "a", "list", "of", "binlog", "entries", "." ]
716f31fd71f3cc289edf69844d8117deb86d98d6
https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L1259-L1265
37,576
sagiegurari/fax4j
src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java
WindowsProcessFaxClientSpi.addCommandLineArgument
protected void addCommandLineArgument(StringBuilder buffer,String argument,String value) { if((value!=null)&&(value.length()>0)) { buffer.append(argument); buffer.append(Fax4jExeConstants.SPACE_STR); buffer.append(Fax4jExeConstants.VALUE_WRAPPER); buff...
java
protected void addCommandLineArgument(StringBuilder buffer,String argument,String value) { if((value!=null)&&(value.length()>0)) { buffer.append(argument); buffer.append(Fax4jExeConstants.SPACE_STR); buffer.append(Fax4jExeConstants.VALUE_WRAPPER); buff...
[ "protected", "void", "addCommandLineArgument", "(", "StringBuilder", "buffer", ",", "String", "argument", ",", "String", "value", ")", "{", "if", "(", "(", "value", "!=", "null", ")", "&&", "(", "value", ".", "length", "(", ")", ">", "0", ")", ")", "{"...
This function adds the given command line argument to the buffer. @param buffer The buffer @param argument The argument @param value The argument value
[ "This", "function", "adds", "the", "given", "command", "line", "argument", "to", "the", "buffer", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java#L299-L310
37,577
sagiegurari/fax4j
src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java
WindowsProcessFaxClientSpi.createProcessCommand
protected String createProcessCommand(String commandArguments) { //create command StringBuilder buffer=new StringBuilder(500); buffer.append("\""); buffer.append(this.fax4jExecutableFileLocation); buffer.append("\""); buffer.append(Fax4jExeConstants.SPACE_STR); ...
java
protected String createProcessCommand(String commandArguments) { //create command StringBuilder buffer=new StringBuilder(500); buffer.append("\""); buffer.append(this.fax4jExecutableFileLocation); buffer.append("\""); buffer.append(Fax4jExeConstants.SPACE_STR); ...
[ "protected", "String", "createProcessCommand", "(", "String", "commandArguments", ")", "{", "//create command", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", "500", ")", ";", "buffer", ".", "append", "(", "\"\\\"\"", ")", ";", "buffer", ".", "appe...
This function creates and returns the fax4j.exe command. @param commandArguments The command line arguments @return The fax4j.exe command
[ "This", "function", "creates", "and", "returns", "the", "fax4j", ".", "exe", "command", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java#L319-L331
37,578
sagiegurari/fax4j
src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java
WindowsProcessFaxClientSpi.createProcessCommandArgumentsForSubmitFaxJob
protected String createProcessCommandArgumentsForSubmitFaxJob(FaxJob faxJob) { //get values from fax job String targetAddress=faxJob.getTargetAddress(); String targetName=faxJob.getTargetName(); String senderName=faxJob.getSenderName(); File file=faxJob.getFile(); Str...
java
protected String createProcessCommandArgumentsForSubmitFaxJob(FaxJob faxJob) { //get values from fax job String targetAddress=faxJob.getTargetAddress(); String targetName=faxJob.getTargetName(); String senderName=faxJob.getSenderName(); File file=faxJob.getFile(); Str...
[ "protected", "String", "createProcessCommandArgumentsForSubmitFaxJob", "(", "FaxJob", "faxJob", ")", "{", "//get values from fax job", "String", "targetAddress", "=", "faxJob", ".", "getTargetAddress", "(", ")", ";", "String", "targetName", "=", "faxJob", ".", "getTarge...
This function creates and returns the command line arguments for the fax4j external exe when running the submit fax job action. @param faxJob The fax job object @return The full command line arguments line
[ "This", "function", "creates", "and", "returns", "the", "command", "line", "arguments", "for", "the", "fax4j", "external", "exe", "when", "running", "the", "submit", "fax", "job", "action", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java#L341-L375
37,579
sagiegurari/fax4j
src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java
WindowsProcessFaxClientSpi.createProcessCommandArgumentsForExistingFaxJob
protected String createProcessCommandArgumentsForExistingFaxJob(String faxActionTypeArgument,FaxJob faxJob) { //get values from fax job String faxJobID=faxJob.getID(); //init buffer StringBuilder buffer=new StringBuilder(); //create command line arguments ...
java
protected String createProcessCommandArgumentsForExistingFaxJob(String faxActionTypeArgument,FaxJob faxJob) { //get values from fax job String faxJobID=faxJob.getID(); //init buffer StringBuilder buffer=new StringBuilder(); //create command line arguments ...
[ "protected", "String", "createProcessCommandArgumentsForExistingFaxJob", "(", "String", "faxActionTypeArgument", ",", "FaxJob", "faxJob", ")", "{", "//get values from fax job", "String", "faxJobID", "=", "faxJob", ".", "getID", "(", ")", ";", "//init buffer", "StringBuild...
This function creates and returns the command line arguments for the fax4j external exe when running an action on an existing fax job. @param faxActionTypeArgument The fax action type argument @param faxJob The fax job object @return The full command line arguments line
[ "This", "function", "creates", "and", "returns", "the", "command", "line", "arguments", "for", "the", "fax4j", "external", "exe", "when", "running", "an", "action", "on", "an", "existing", "fax", "job", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsProcessFaxClientSpi.java#L387-L404
37,580
sagiegurari/fax4j
src/main/java/org/fax4j/bridge/AbstractVendorPolicy.java
AbstractVendorPolicy.initialize
public final synchronized void initialize(Object flowOwner) { if(this.initialized) { throw new FaxException("Vendor policy already initialized."); } if(flowOwner==null) { throw new FaxException("Flow owner not provided."); } /...
java
public final synchronized void initialize(Object flowOwner) { if(this.initialized) { throw new FaxException("Vendor policy already initialized."); } if(flowOwner==null) { throw new FaxException("Flow owner not provided."); } /...
[ "public", "final", "synchronized", "void", "initialize", "(", "Object", "flowOwner", ")", "{", "if", "(", "this", ".", "initialized", ")", "{", "throw", "new", "FaxException", "(", "\"Vendor policy already initialized.\"", ")", ";", "}", "if", "(", "flowOwner", ...
This function initializes the vendor policy. @param flowOwner The flow owner (the servlet, CLI main, ....)
[ "This", "function", "initializes", "the", "vendor", "policy", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/bridge/AbstractVendorPolicy.java#L73-L93
37,581
sagiegurari/fax4j
src/main/java/org/fax4j/spi/phaxio/PhaxioFaxClientSpi.java
PhaxioFaxClientSpi.createHTTPClientConfiguration
@Override protected HTTPClientConfiguration createHTTPClientConfiguration() { CommonHTTPClientConfiguration configuration=new CommonHTTPClientConfiguration(); configuration.setHostName("api.phaxio.com"); configuration.setSSL(true); configuration.setMethod(FaxActionType.SUBMIT_FAX...
java
@Override protected HTTPClientConfiguration createHTTPClientConfiguration() { CommonHTTPClientConfiguration configuration=new CommonHTTPClientConfiguration(); configuration.setHostName("api.phaxio.com"); configuration.setSSL(true); configuration.setMethod(FaxActionType.SUBMIT_FAX...
[ "@", "Override", "protected", "HTTPClientConfiguration", "createHTTPClientConfiguration", "(", ")", "{", "CommonHTTPClientConfiguration", "configuration", "=", "new", "CommonHTTPClientConfiguration", "(", ")", ";", "configuration", ".", "setHostName", "(", "\"api.phaxio.com\"...
This function creates and returns the HTTP configuration object. @return The HTTP configuration object
[ "This", "function", "creates", "and", "returns", "the", "HTTP", "configuration", "object", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/phaxio/PhaxioFaxClientSpi.java#L153-L164
37,582
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java
AbstractMappingHTTPResponseHandler.updateFaxJob
public void updateFaxJob(FaxJob faxJob,HTTPResponse httpResponse,FaxActionType faxActionType) { //get path String path=this.getPathToResponseData(faxActionType); //get fax job ID String id=this.findValue(httpResponse,path); if(id!=null) { faxJob....
java
public void updateFaxJob(FaxJob faxJob,HTTPResponse httpResponse,FaxActionType faxActionType) { //get path String path=this.getPathToResponseData(faxActionType); //get fax job ID String id=this.findValue(httpResponse,path); if(id!=null) { faxJob....
[ "public", "void", "updateFaxJob", "(", "FaxJob", "faxJob", ",", "HTTPResponse", "httpResponse", ",", "FaxActionType", "faxActionType", ")", "{", "//get path", "String", "path", "=", "this", ".", "getPathToResponseData", "(", "faxActionType", ")", ";", "//get fax job...
Updates the fax job based on the data from the HTTP response data. @param faxJob The fax job object @param httpResponse The HTTP response @param faxActionType The fax action type
[ "Updates", "the", "fax", "job", "based", "on", "the", "data", "from", "the", "HTTP", "response", "data", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java#L172-L184
37,583
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java
AbstractMappingHTTPResponseHandler.getFaxJobStatus
public FaxJobStatus getFaxJobStatus(HTTPResponse httpResponse) { //get path String path=this.getPathToResponseData(FaxActionType.GET_FAX_JOB_STATUS); //get fax job status string String faxJobStatusStr=this.findValue(httpResponse,path); FaxJobStatus faxJobStatus=FaxJ...
java
public FaxJobStatus getFaxJobStatus(HTTPResponse httpResponse) { //get path String path=this.getPathToResponseData(FaxActionType.GET_FAX_JOB_STATUS); //get fax job status string String faxJobStatusStr=this.findValue(httpResponse,path); FaxJobStatus faxJobStatus=FaxJ...
[ "public", "FaxJobStatus", "getFaxJobStatus", "(", "HTTPResponse", "httpResponse", ")", "{", "//get path", "String", "path", "=", "this", ".", "getPathToResponseData", "(", "FaxActionType", ".", "GET_FAX_JOB_STATUS", ")", ";", "//get fax job status string", "String", "fa...
This function extracts the fax job status from the HTTP response data. @param httpResponse The HTTP response @return The fax job status
[ "This", "function", "extracts", "the", "fax", "job", "status", "from", "the", "HTTP", "response", "data", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java#L193-L212
37,584
sagiegurari/fax4j
src/main/java/org/fax4j/spi/vbs/VBSProcessOutputValidator.java
VBSProcessOutputValidator.getVBSFailedLineErrorMessage
protected String getVBSFailedLineErrorMessage(String errorPut) { String message=""; if(errorPut!=null) { String prefix=".vbs("; int start=errorPut.indexOf(prefix); if(start!=-1) { start=start+prefix.length(); int...
java
protected String getVBSFailedLineErrorMessage(String errorPut) { String message=""; if(errorPut!=null) { String prefix=".vbs("; int start=errorPut.indexOf(prefix); if(start!=-1) { start=start+prefix.length(); int...
[ "protected", "String", "getVBSFailedLineErrorMessage", "(", "String", "errorPut", ")", "{", "String", "message", "=", "\"\"", ";", "if", "(", "errorPut", "!=", "null", ")", "{", "String", "prefix", "=", "\".vbs(\"", ";", "int", "start", "=", "errorPut", ".",...
This function returns the VBS error line for the exception message. @param errorPut The error put @return The message
[ "This", "function", "returns", "the", "VBS", "error", "line", "for", "the", "exception", "message", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/vbs/VBSProcessOutputValidator.java#L38-L74
37,585
sagiegurari/fax4j
src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java
LogFaxClientSpiInterceptor.logEvent
protected void logEvent(FaxClientSpiProxyEventType eventType,Method method,Object[] arguments,Object output,Throwable throwable) { //init log data int amount=3; int argumentsAmount=0; if(arguments!=null) { argumentsAmount=arguments.length; } if(eve...
java
protected void logEvent(FaxClientSpiProxyEventType eventType,Method method,Object[] arguments,Object output,Throwable throwable) { //init log data int amount=3; int argumentsAmount=0; if(arguments!=null) { argumentsAmount=arguments.length; } if(eve...
[ "protected", "void", "logEvent", "(", "FaxClientSpiProxyEventType", "eventType", ",", "Method", "method", ",", "Object", "[", "]", "arguments", ",", "Object", "output", ",", "Throwable", "throwable", ")", "{", "//init log data", "int", "amount", "=", "3", ";", ...
This function logs the event. @param eventType The event type @param method The method invoked @param arguments The method arguments @param output The method output @param throwable The throwable while invoking the method
[ "This", "function", "logs", "the", "event", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java#L90-L148
37,586
sagiegurari/fax4j
src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java
LogFaxClientSpiInterceptor.preMethodInvocation
public final void preMethodInvocation(Method method,Object[] arguments) { this.logEvent(FaxClientSpiProxyEventType.PRE_EVENT_TYPE,method,arguments,null,null); }
java
public final void preMethodInvocation(Method method,Object[] arguments) { this.logEvent(FaxClientSpiProxyEventType.PRE_EVENT_TYPE,method,arguments,null,null); }
[ "public", "final", "void", "preMethodInvocation", "(", "Method", "method", ",", "Object", "[", "]", "arguments", ")", "{", "this", ".", "logEvent", "(", "FaxClientSpiProxyEventType", ".", "PRE_EVENT_TYPE", ",", "method", ",", "arguments", ",", "null", ",", "nu...
This function is invoked by the fax client SPI proxy before invoking the method in the fax client SPI itself. @param method The method invoked @param arguments The method arguments
[ "This", "function", "is", "invoked", "by", "the", "fax", "client", "SPI", "proxy", "before", "invoking", "the", "method", "in", "the", "fax", "client", "SPI", "itself", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java#L159-L162
37,587
sagiegurari/fax4j
src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java
LogFaxClientSpiInterceptor.postMethodInvocation
public final void postMethodInvocation(Method method,Object[] arguments,Object output) { this.logEvent(FaxClientSpiProxyEventType.POST_EVENT_TYPE,method,arguments,output,null); }
java
public final void postMethodInvocation(Method method,Object[] arguments,Object output) { this.logEvent(FaxClientSpiProxyEventType.POST_EVENT_TYPE,method,arguments,output,null); }
[ "public", "final", "void", "postMethodInvocation", "(", "Method", "method", ",", "Object", "[", "]", "arguments", ",", "Object", "output", ")", "{", "this", ".", "logEvent", "(", "FaxClientSpiProxyEventType", ".", "POST_EVENT_TYPE", ",", "method", ",", "argument...
This function is invoked by the fax client SPI proxy after invoking the method in the fax client SPI itself. @param method The method invoked @param arguments The method arguments @param output The method output
[ "This", "function", "is", "invoked", "by", "the", "fax", "client", "SPI", "proxy", "after", "invoking", "the", "method", "in", "the", "fax", "client", "SPI", "itself", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java#L175-L178
37,588
sagiegurari/fax4j
src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java
LogFaxClientSpiInterceptor.onMethodInvocationError
public final void onMethodInvocationError(Method method,Object[] arguments,Throwable throwable) { this.logEvent(FaxClientSpiProxyEventType.ERROR_EVENT_TYPE,method,arguments,null,throwable); }
java
public final void onMethodInvocationError(Method method,Object[] arguments,Throwable throwable) { this.logEvent(FaxClientSpiProxyEventType.ERROR_EVENT_TYPE,method,arguments,null,throwable); }
[ "public", "final", "void", "onMethodInvocationError", "(", "Method", "method", ",", "Object", "[", "]", "arguments", ",", "Throwable", "throwable", ")", "{", "this", ".", "logEvent", "(", "FaxClientSpiProxyEventType", ".", "ERROR_EVENT_TYPE", ",", "method", ",", ...
This function is invoked by the fax client SPI proxy in of an error while invoking the method in the fax client SPI itself. @param method The method invoked @param arguments The method arguments @param throwable The throwable while invoking the method
[ "This", "function", "is", "invoked", "by", "the", "fax", "client", "SPI", "proxy", "in", "of", "an", "error", "while", "invoking", "the", "method", "in", "the", "fax", "client", "SPI", "itself", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/LogFaxClientSpiInterceptor.java#L191-L194
37,589
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.getPriority
public FaxJobPriority getPriority() { int priority=Job.PRIORITY_NORMAL; try { priority=this.JOB.getPriority(); } catch(Exception exception) { throw new FaxException("Error while extracting job priority.",exception); } FaxJobPri...
java
public FaxJobPriority getPriority() { int priority=Job.PRIORITY_NORMAL; try { priority=this.JOB.getPriority(); } catch(Exception exception) { throw new FaxException("Error while extracting job priority.",exception); } FaxJobPri...
[ "public", "FaxJobPriority", "getPriority", "(", ")", "{", "int", "priority", "=", "Job", ".", "PRIORITY_NORMAL", ";", "try", "{", "priority", "=", "this", ".", "JOB", ".", "getPriority", "(", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{...
This function returns the priority. @return The priority
[ "This", "function", "returns", "the", "priority", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L110-L134
37,590
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.setPriority
public void setPriority(FaxJobPriority priority) { try { if(priority==FaxJobPriority.HIGH_PRIORITY) { this.JOB.setPriority(Job.PRIORITY_HIGH); } else { this.JOB.setPriority(Job.PRIORITY_NORMAL); }...
java
public void setPriority(FaxJobPriority priority) { try { if(priority==FaxJobPriority.HIGH_PRIORITY) { this.JOB.setPriority(Job.PRIORITY_HIGH); } else { this.JOB.setPriority(Job.PRIORITY_NORMAL); }...
[ "public", "void", "setPriority", "(", "FaxJobPriority", "priority", ")", "{", "try", "{", "if", "(", "priority", "==", "FaxJobPriority", ".", "HIGH_PRIORITY", ")", "{", "this", ".", "JOB", ".", "setPriority", "(", "Job", ".", "PRIORITY_HIGH", ")", ";", "}"...
This function sets the priority. @param priority The priority
[ "This", "function", "sets", "the", "priority", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L142-L159
37,591
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.getTargetAddress
public String getTargetAddress() { String value=null; try { value=this.JOB.getDialstring(); } catch(Exception exception) { throw new FaxException("Error while extracting job target address.",exception); } return value; }
java
public String getTargetAddress() { String value=null; try { value=this.JOB.getDialstring(); } catch(Exception exception) { throw new FaxException("Error while extracting job target address.",exception); } return value; }
[ "public", "String", "getTargetAddress", "(", ")", "{", "String", "value", "=", "null", ";", "try", "{", "value", "=", "this", ".", "JOB", ".", "getDialstring", "(", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "throw", "new", "FaxEx...
This function returns the fax job target address. @return The fax job target address
[ "This", "function", "returns", "the", "fax", "job", "target", "address", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L166-L179
37,592
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.setTargetAddress
public void setTargetAddress(String targetAddress) { try { this.JOB.setDialstring(targetAddress); } catch(Exception exception) { throw new FaxException("Error while setting job target address.",exception); } }
java
public void setTargetAddress(String targetAddress) { try { this.JOB.setDialstring(targetAddress); } catch(Exception exception) { throw new FaxException("Error while setting job target address.",exception); } }
[ "public", "void", "setTargetAddress", "(", "String", "targetAddress", ")", "{", "try", "{", "this", ".", "JOB", ".", "setDialstring", "(", "targetAddress", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "throw", "new", "FaxException", "(", ...
This function sets the fax job target address. @param targetAddress The fax job target address
[ "This", "function", "sets", "the", "fax", "job", "target", "address", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L187-L197
37,593
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.getSenderName
public String getSenderName() { String value=null; try { value=this.JOB.getFromUser(); } catch(Exception exception) { throw new FaxException("Error while extracting job sender name.",exception); } return value; }
java
public String getSenderName() { String value=null; try { value=this.JOB.getFromUser(); } catch(Exception exception) { throw new FaxException("Error while extracting job sender name.",exception); } return value; }
[ "public", "String", "getSenderName", "(", ")", "{", "String", "value", "=", "null", ";", "try", "{", "value", "=", "this", ".", "JOB", ".", "getFromUser", "(", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "throw", "new", "FaxExcepti...
This function returns the fax job sender name. @return The fax job sender name
[ "This", "function", "returns", "the", "fax", "job", "sender", "name", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L225-L238
37,594
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.setSenderName
public void setSenderName(String senderName) { try { this.JOB.setFromUser(senderName); } catch(Exception exception) { throw new FaxException("Error while setting job sender name.",exception); } }
java
public void setSenderName(String senderName) { try { this.JOB.setFromUser(senderName); } catch(Exception exception) { throw new FaxException("Error while setting job sender name.",exception); } }
[ "public", "void", "setSenderName", "(", "String", "senderName", ")", "{", "try", "{", "this", ".", "JOB", ".", "setFromUser", "(", "senderName", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "throw", "new", "FaxException", "(", "\"Error ...
This function sets the fax job sender name. @param senderName The fax job sender name
[ "This", "function", "sets", "the", "fax", "job", "sender", "name", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L246-L256
37,595
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java
HylaFaxJob.setProperty
public void setProperty(String key,String value) { try { this.JOB.setProperty(key,value); } catch(Exception exception) { throw new FaxException("Error while setting job property.",exception); } }
java
public void setProperty(String key,String value) { try { this.JOB.setProperty(key,value); } catch(Exception exception) { throw new FaxException("Error while setting job property.",exception); } }
[ "public", "void", "setProperty", "(", "String", "key", ",", "String", "value", ")", "{", "try", "{", "this", ".", "JOB", ".", "setProperty", "(", "key", ",", "value", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "throw", "new", "F...
This function sets the fax job property. @param key The property key @param value The property value
[ "This", "function", "sets", "the", "fax", "job", "property", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxJob.java#L308-L318
37,596
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/TemplateFaxJob2HTTPRequestConverter.java
TemplateFaxJob2HTTPRequestConverter.formatHTTPResource
protected String formatHTTPResource(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,FaxJob faxJob) { //get resource String resourceTemplate=faxClientSpi.getHTTPResource(faxActionType); //format resource String resource=SpiUtil.formatTemplate(resourceTemplate,faxJob...
java
protected String formatHTTPResource(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,FaxJob faxJob) { //get resource String resourceTemplate=faxClientSpi.getHTTPResource(faxActionType); //format resource String resource=SpiUtil.formatTemplate(resourceTemplate,faxJob...
[ "protected", "String", "formatHTTPResource", "(", "HTTPFaxClientSpi", "faxClientSpi", ",", "FaxActionType", "faxActionType", ",", "FaxJob", "faxJob", ")", "{", "//get resource", "String", "resourceTemplate", "=", "faxClientSpi", ".", "getHTTPResource", "(", "faxActionType...
This function formats the HTTP resource. @param faxClientSpi The HTTP fax client SPI @param faxActionType The fax action type @param faxJob The fax job object @return The formatted HTTP resource
[ "This", "function", "formats", "the", "HTTP", "resource", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/TemplateFaxJob2HTTPRequestConverter.java#L308-L317
37,597
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/TemplateFaxJob2HTTPRequestConverter.java
TemplateFaxJob2HTTPRequestConverter.formatHTTPURLParameters
protected String formatHTTPURLParameters(HTTPFaxClientSpi faxClientSpi,FaxJob faxJob) { //get URL parameters String urlParametersTemplate=faxClientSpi.getHTTPURLParameters(); //format URL parameters String urlParameters=SpiUtil.formatTemplate(urlParametersTemplate,faxJob,Spi...
java
protected String formatHTTPURLParameters(HTTPFaxClientSpi faxClientSpi,FaxJob faxJob) { //get URL parameters String urlParametersTemplate=faxClientSpi.getHTTPURLParameters(); //format URL parameters String urlParameters=SpiUtil.formatTemplate(urlParametersTemplate,faxJob,Spi...
[ "protected", "String", "formatHTTPURLParameters", "(", "HTTPFaxClientSpi", "faxClientSpi", ",", "FaxJob", "faxJob", ")", "{", "//get URL parameters", "String", "urlParametersTemplate", "=", "faxClientSpi", ".", "getHTTPURLParameters", "(", ")", ";", "//format URL parameters...
This function formats the HTTP URL parameters. @param faxClientSpi The HTTP fax client SPI @param faxJob The fax job object @return The formatted HTTP URL parameters
[ "This", "function", "formats", "the", "HTTP", "URL", "parameters", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/TemplateFaxJob2HTTPRequestConverter.java#L328-L337
37,598
sagiegurari/fax4j
src/main/java/org/fax4j/util/LibraryConfigurationLoader.java
LibraryConfigurationLoader.loadProperties
private static void loadProperties(Properties properties,InputStream inputStream,boolean internal) { try { properties.load(inputStream); LibraryConfigurationLoader.closeResource(inputStream); } catch(Exception exception) { LibraryConfigurat...
java
private static void loadProperties(Properties properties,InputStream inputStream,boolean internal) { try { properties.load(inputStream); LibraryConfigurationLoader.closeResource(inputStream); } catch(Exception exception) { LibraryConfigurat...
[ "private", "static", "void", "loadProperties", "(", "Properties", "properties", ",", "InputStream", "inputStream", ",", "boolean", "internal", ")", "{", "try", "{", "properties", ".", "load", "(", "inputStream", ")", ";", "LibraryConfigurationLoader", ".", "closeR...
This function loads the properties from the input stream to the provided properties object. @param properties The target properties object @param inputStream The input stream to the configuration file @param internal True internal, else external
[ "This", "function", "loads", "the", "properties", "from", "the", "input", "stream", "to", "the", "provided", "properties", "object", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/LibraryConfigurationLoader.java#L67-L84
37,599
sagiegurari/fax4j
src/main/java/org/fax4j/util/LibraryConfigurationLoader.java
LibraryConfigurationLoader.readInternalConfiguration
public static Properties readInternalConfiguration() { //init properties Properties properties=new Properties(); //get class loader ClassLoader classLoader=ReflectionHelper.getThreadContextClassLoader(); //load internal properties InputStream inputStream=cla...
java
public static Properties readInternalConfiguration() { //init properties Properties properties=new Properties(); //get class loader ClassLoader classLoader=ReflectionHelper.getThreadContextClassLoader(); //load internal properties InputStream inputStream=cla...
[ "public", "static", "Properties", "readInternalConfiguration", "(", ")", "{", "//init properties", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "//get class loader", "ClassLoader", "classLoader", "=", "ReflectionHelper", ".", "getThreadContextClass...
This function reads and returns the internal fax4j properties. @return The fax4j.properties data
[ "This", "function", "reads", "and", "returns", "the", "internal", "fax4j", "properties", "." ]
42fa51acabe7bf279e27ab3dd1cf76146b27955f
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/LibraryConfigurationLoader.java#L91-L104