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
164,900
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java
ServerRedirectService.setSourceUrl
public void setSourceUrl(String newUrl, int id) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement( "UPDATE " + Constants.DB_TABLE_SERVERS + " SET " + Constants.SE...
java
public void setSourceUrl(String newUrl, int id) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement( "UPDATE " + Constants.DB_TABLE_SERVERS + " SET " + Constants.SE...
[ "public", "void", "setSourceUrl", "(", "String", "newUrl", ",", "int", "id", ")", "{", "PreparedStatement", "statement", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ")", "{", "statement", "=...
Set source url for a server @param newUrl new URL @param id Server ID
[ "Set", "source", "url", "for", "a", "server" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L476-L499
164,901
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java
ServerRedirectService.deleteRedirect
public void deleteRedirect(int id) { try { sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS + " WHERE " + Constants.GENERIC_ID + " = " + id + ";"); } catch (Exception e) { e.printStackTrace(); } }
java
public void deleteRedirect(int id) { try { sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS + " WHERE " + Constants.GENERIC_ID + " = " + id + ";"); } catch (Exception e) { e.printStackTrace(); } }
[ "public", "void", "deleteRedirect", "(", "int", "id", ")", "{", "try", "{", "sqlService", ".", "executeUpdate", "(", "\"DELETE FROM \"", "+", "Constants", ".", "DB_TABLE_SERVERS", "+", "\" WHERE \"", "+", "Constants", ".", "GENERIC_ID", "+", "\" = \"", "+", "i...
Deletes a redirect by id @param id redirect ID
[ "Deletes", "a", "redirect", "by", "id" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L568-L575
164,902
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java
ServerRedirectService.deleteServerGroup
public void deleteServerGroup(int id) { try { sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVER_GROUPS + " WHERE " + Constants.GENERIC_ID + " = " + id + ";"); sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS ...
java
public void deleteServerGroup(int id) { try { sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVER_GROUPS + " WHERE " + Constants.GENERIC_ID + " = " + id + ";"); sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS ...
[ "public", "void", "deleteServerGroup", "(", "int", "id", ")", "{", "try", "{", "sqlService", ".", "executeUpdate", "(", "\"DELETE FROM \"", "+", "Constants", ".", "DB_TABLE_SERVER_GROUPS", "+", "\" WHERE \"", "+", "Constants", ".", "GENERIC_ID", "+", "\" = \"", ...
Delete a server group by id @param id server group ID
[ "Delete", "a", "server", "group", "by", "id" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L582-L592
164,903
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java
ServerRedirectService.getProfilesForServerName
public Profile[] getProfilesForServerName(String serverName) throws Exception { int profileId = -1; ArrayList<Profile> returnProfiles = new ArrayList<Profile>(); PreparedStatement queryStatement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConn...
java
public Profile[] getProfilesForServerName(String serverName) throws Exception { int profileId = -1; ArrayList<Profile> returnProfiles = new ArrayList<Profile>(); PreparedStatement queryStatement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConn...
[ "public", "Profile", "[", "]", "getProfilesForServerName", "(", "String", "serverName", ")", "throws", "Exception", "{", "int", "profileId", "=", "-", "1", ";", "ArrayList", "<", "Profile", ">", "returnProfiles", "=", "new", "ArrayList", "<", "Profile", ">", ...
This returns all profiles associated with a server name @param serverName server Name @return profile UUID @throws Exception exception
[ "This", "returns", "all", "profiles", "associated", "with", "a", "server", "name" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L601-L644
164,904
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.getInstance
public static PluginManager getInstance() { if (_instance == null) { _instance = new PluginManager(); _instance.classInformation = new HashMap<String, ClassInformation>(); _instance.methodInformation = new HashMap<String, com.groupon.odo.proxylib.models.Method>(); ...
java
public static PluginManager getInstance() { if (_instance == null) { _instance = new PluginManager(); _instance.classInformation = new HashMap<String, ClassInformation>(); _instance.methodInformation = new HashMap<String, com.groupon.odo.proxylib.models.Method>(); ...
[ "public", "static", "PluginManager", "getInstance", "(", ")", "{", "if", "(", "_instance", "==", "null", ")", "{", "_instance", "=", "new", "PluginManager", "(", ")", ";", "_instance", ".", "classInformation", "=", "new", "HashMap", "<", "String", ",", "Cl...
Gets the current instance of plugin manager @return PluginManager
[ "Gets", "the", "current", "instance", "of", "plugin", "manager" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L72-L97
164,905
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.identifyClasses
public void identifyClasses(final String pluginDirectory) throws Exception { methodInformation.clear(); jarInformation.clear(); try { new FileTraversal() { public void onDirectory(final File d) { } public void onFile(final File f) { ...
java
public void identifyClasses(final String pluginDirectory) throws Exception { methodInformation.clear(); jarInformation.clear(); try { new FileTraversal() { public void onDirectory(final File d) { } public void onFile(final File f) { ...
[ "public", "void", "identifyClasses", "(", "final", "String", "pluginDirectory", ")", "throws", "Exception", "{", "methodInformation", ".", "clear", "(", ")", ";", "jarInformation", ".", "clear", "(", ")", ";", "try", "{", "new", "FileTraversal", "(", ")", "{...
This loads plugin file information into a hash for lazy loading later on @param pluginDirectory path of plugin @throws Exception exception
[ "This", "loads", "plugin", "file", "information", "into", "a", "hash", "for", "lazy", "loading", "later", "on" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L117-L186
164,906
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.getClassNameFromPath
private String getClassNameFromPath(String path) { String className = path.replace(".class", ""); // for *nix if (className.startsWith("/")) { className = className.substring(1, className.length()); } className = className.replace("/", "."); // for windows ...
java
private String getClassNameFromPath(String path) { String className = path.replace(".class", ""); // for *nix if (className.startsWith("/")) { className = className.substring(1, className.length()); } className = className.replace("/", "."); // for windows ...
[ "private", "String", "getClassNameFromPath", "(", "String", "path", ")", "{", "String", "className", "=", "path", ".", "replace", "(", "\".class\"", ",", "\"\"", ")", ";", "// for *nix", "if", "(", "className", ".", "startsWith", "(", "\"/\"", ")", ")", "{...
Create a classname from a given path @param path @return
[ "Create", "a", "classname", "from", "a", "given", "path" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L194-L210
164,907
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.loadClass
public void loadClass(String className) throws Exception { ClassInformation classInfo = classInformation.get(className); logger.info("Loading plugin.: {}, {}", className, classInfo.pluginPath); // get URL for proxylib // need to load this also otherwise the annotations cannot be found ...
java
public void loadClass(String className) throws Exception { ClassInformation classInfo = classInformation.get(className); logger.info("Loading plugin.: {}, {}", className, classInfo.pluginPath); // get URL for proxylib // need to load this also otherwise the annotations cannot be found ...
[ "public", "void", "loadClass", "(", "String", "className", ")", "throws", "Exception", "{", "ClassInformation", "classInfo", "=", "classInformation", ".", "get", "(", "className", ")", ";", "logger", ".", "info", "(", "\"Loading plugin.: {}, {}\"", ",", "className...
Loads the specified class name and stores it in the hash @param className class name @throws Exception exception
[ "Loads", "the", "specified", "class", "name", "and", "stores", "it", "in", "the", "hash" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L218-L248
164,908
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.callFunction
public void callFunction(String className, String methodName, PluginArguments pluginArgs, Object... args) throws Exception { Class<?> cls = getClass(className); ArrayList<Object> newArgs = new ArrayList<>(); newArgs.add(pluginArgs); com.groupon.odo.proxylib.models.Method m = preparePlug...
java
public void callFunction(String className, String methodName, PluginArguments pluginArgs, Object... args) throws Exception { Class<?> cls = getClass(className); ArrayList<Object> newArgs = new ArrayList<>(); newArgs.add(pluginArgs); com.groupon.odo.proxylib.models.Method m = preparePlug...
[ "public", "void", "callFunction", "(", "String", "className", ",", "String", "methodName", ",", "PluginArguments", "pluginArgs", ",", "Object", "...", "args", ")", "throws", "Exception", "{", "Class", "<", "?", ">", "cls", "=", "getClass", "(", "className", ...
Calls the specified function with the specified arguments. This is used for v2 response overrides @param className name of class @param methodName name of method @param pluginArgs plugin arguments @param args arguments to supply to function @throws Exception exception
[ "Calls", "the", "specified", "function", "with", "the", "specified", "arguments", ".", "This", "is", "used", "for", "v2", "response", "overrides" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L259-L267
164,909
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.getClass
private synchronized Class<?> getClass(String className) throws Exception { // see if we need to invalidate the class ClassInformation classInfo = classInformation.get(className); File classFile = new File(classInfo.pluginPath); if (classFile.lastModified() > classInfo.lastModified) { ...
java
private synchronized Class<?> getClass(String className) throws Exception { // see if we need to invalidate the class ClassInformation classInfo = classInformation.get(className); File classFile = new File(classInfo.pluginPath); if (classFile.lastModified() > classInfo.lastModified) { ...
[ "private", "synchronized", "Class", "<", "?", ">", "getClass", "(", "String", "className", ")", "throws", "Exception", "{", "// see if we need to invalidate the class", "ClassInformation", "classInfo", "=", "classInformation", ".", "get", "(", "className", ")", ";", ...
Obtain the class of a given className @param className @return @throws Exception
[ "Obtain", "the", "class", "of", "a", "given", "className" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L435-L460
164,910
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.getMethods
public String[] getMethods(String pluginClass) throws Exception { ArrayList<String> methodNames = new ArrayList<String>(); Method[] methods = getClass(pluginClass).getDeclaredMethods(); for (Method method : methods) { logger.info("Checking {}", method.getName()); com.gr...
java
public String[] getMethods(String pluginClass) throws Exception { ArrayList<String> methodNames = new ArrayList<String>(); Method[] methods = getClass(pluginClass).getDeclaredMethods(); for (Method method : methods) { logger.info("Checking {}", method.getName()); com.gr...
[ "public", "String", "[", "]", "getMethods", "(", "String", "pluginClass", ")", "throws", "Exception", "{", "ArrayList", "<", "String", ">", "methodNames", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "Method", "[", "]", "methods", "=", "ge...
Returns a string array of the methods loaded for a class @param pluginClass name of class @return string array of the methods loaded for the class @throws Exception exception
[ "Returns", "a", "string", "array", "of", "the", "methods", "loaded", "for", "a", "class" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L478-L503
164,911
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.getMethodsNotInGroup
public List<com.groupon.odo.proxylib.models.Method> getMethodsNotInGroup(int groupId) throws Exception { List<com.groupon.odo.proxylib.models.Method> allMethods = getAllMethods(); List<com.groupon.odo.proxylib.models.Method> methodsNotInGroup = new ArrayList<com.groupon.odo.proxylib.models.Method>(); ...
java
public List<com.groupon.odo.proxylib.models.Method> getMethodsNotInGroup(int groupId) throws Exception { List<com.groupon.odo.proxylib.models.Method> allMethods = getAllMethods(); List<com.groupon.odo.proxylib.models.Method> methodsNotInGroup = new ArrayList<com.groupon.odo.proxylib.models.Method>(); ...
[ "public", "List", "<", "com", ".", "groupon", ".", "odo", ".", "proxylib", ".", "models", ".", "Method", ">", "getMethodsNotInGroup", "(", "int", "groupId", ")", "throws", "Exception", "{", "List", "<", "com", ".", "groupon", ".", "odo", ".", "proxylib",...
returns all methods not in the group @param groupId Id of group @return List of Methods for a group @throws Exception exception
[ "returns", "all", "methods", "not", "in", "the", "group" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L562-L583
164,912
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.getPlugins
public Plugin[] getPlugins(Boolean onlyValid) { Configuration[] configurations = ConfigurationService.getInstance().getConfigurations(Constants.DB_TABLE_CONFIGURATION_PLUGIN_PATH); ArrayList<Plugin> plugins = new ArrayList<Plugin>(); if (configurations == null) { return new Plugin[...
java
public Plugin[] getPlugins(Boolean onlyValid) { Configuration[] configurations = ConfigurationService.getInstance().getConfigurations(Constants.DB_TABLE_CONFIGURATION_PLUGIN_PATH); ArrayList<Plugin> plugins = new ArrayList<Plugin>(); if (configurations == null) { return new Plugin[...
[ "public", "Plugin", "[", "]", "getPlugins", "(", "Boolean", "onlyValid", ")", "{", "Configuration", "[", "]", "configurations", "=", "ConfigurationService", ".", "getInstance", "(", ")", ".", "getConfigurations", "(", "Constants", ".", "DB_TABLE_CONFIGURATION_PLUGIN...
Returns the data about all of the plugins that are set @param onlyValid True to get only valid plugins, False for all @return array of Plugins set
[ "Returns", "the", "data", "about", "all", "of", "the", "plugins", "that", "are", "set" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L591-L620
164,913
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java
PluginManager.getResource
public byte[] getResource(String pluginName, String fileName) throws Exception { // TODO: This is going to be slow.. future improvement is to cache the data instead of searching all jars for (String jarFilename : jarInformation) { JarFile jarFile = new JarFile(new File(jarFilename)); ...
java
public byte[] getResource(String pluginName, String fileName) throws Exception { // TODO: This is going to be slow.. future improvement is to cache the data instead of searching all jars for (String jarFilename : jarInformation) { JarFile jarFile = new JarFile(new File(jarFilename)); ...
[ "public", "byte", "[", "]", "getResource", "(", "String", "pluginName", ",", "String", "fileName", ")", "throws", "Exception", "{", "// TODO: This is going to be slow.. future improvement is to cache the data instead of searching all jars", "for", "(", "String", "jarFilename", ...
Gets a static resource from a plugin @param pluginName - Name of the plugin(defined in the plugin manifest) @param fileName - Filename to fetch @return byte array of the resource @throws Exception exception
[ "Gets", "a", "static", "resource", "from", "a", "plugin" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PluginManager.java#L640-L677
164,914
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/HostsFileUtils.java
HostsFileUtils.changeHost
public static boolean changeHost(String hostName, boolean enable, boolean disable, boolean remove, boolean isEnabled, boolean exists) t...
java
public static boolean changeHost(String hostName, boolean enable, boolean disable, boolean remove, boolean isEnabled, boolean exists) t...
[ "public", "static", "boolean", "changeHost", "(", "String", "hostName", ",", "boolean", "enable", ",", "boolean", "disable", ",", "boolean", "remove", ",", "boolean", "isEnabled", ",", "boolean", "exists", ")", "throws", "Exception", "{", "// Open the file that is...
Only one boolean param should be true at a time for this function to return the proper results @param hostName @param enable @param disable @param remove @param isEnabled @param exists @return @throws Exception
[ "Only", "one", "boolean", "param", "should", "be", "true", "at", "a", "time", "for", "this", "function", "to", "return", "the", "proper", "results" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/HostsFileUtils.java#L74-L164
164,915
groupon/odo
proxyplugin/src/main/java/com/groupon/odo/plugin/PluginHelper.java
PluginHelper.getByteArrayDataAsString
public static String getByteArrayDataAsString(String contentEncoding, byte[] bytes) { ByteArrayOutputStream byteout = null; if (contentEncoding != null && contentEncoding.equals("gzip")) { // GZIP ByteArrayInputStream bytein = null; GZIPInputStream zis...
java
public static String getByteArrayDataAsString(String contentEncoding, byte[] bytes) { ByteArrayOutputStream byteout = null; if (contentEncoding != null && contentEncoding.equals("gzip")) { // GZIP ByteArrayInputStream bytein = null; GZIPInputStream zis...
[ "public", "static", "String", "getByteArrayDataAsString", "(", "String", "contentEncoding", ",", "byte", "[", "]", "bytes", ")", "{", "ByteArrayOutputStream", "byteout", "=", "null", ";", "if", "(", "contentEncoding", "!=", "null", "&&", "contentEncoding", ".", ...
Decodes stream data based on content encoding @param contentEncoding @param bytes @return String representing the stream data
[ "Decodes", "stream", "data", "based", "on", "content", "encoding" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyplugin/src/main/java/com/groupon/odo/plugin/PluginHelper.java#L137-L187
164,916
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java
BackupController.getBackup
@SuppressWarnings("deprecation") @RequestMapping(value = "/api/backup", method = RequestMethod.GET) public @ResponseBody String getBackup(Model model, HttpServletResponse response) throws Exception { response.addHeader("Content-Disposition", "attachment; filename=backup.json"); response....
java
@SuppressWarnings("deprecation") @RequestMapping(value = "/api/backup", method = RequestMethod.GET) public @ResponseBody String getBackup(Model model, HttpServletResponse response) throws Exception { response.addHeader("Content-Disposition", "attachment; filename=backup.json"); response....
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "@", "RequestMapping", "(", "value", "=", "\"/api/backup\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "@", "ResponseBody", "String", "getBackup", "(", "Model", "model", ",", "HttpServle...
Get all backup data @param model @return @throws Exception
[ "Get", "all", "backup", "data" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java#L64-L77
164,917
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java
BackupController.processBackup
@RequestMapping(value = "/api/backup", method = RequestMethod.POST) public @ResponseBody Backup processBackup(@RequestParam("fileData") MultipartFile fileData) throws Exception { // Method taken from: http://spring.io/guides/gs/uploading-files/ if (!fileData.isEmpty()) { try { ...
java
@RequestMapping(value = "/api/backup", method = RequestMethod.POST) public @ResponseBody Backup processBackup(@RequestParam("fileData") MultipartFile fileData) throws Exception { // Method taken from: http://spring.io/guides/gs/uploading-files/ if (!fileData.isEmpty()) { try { ...
[ "@", "RequestMapping", "(", "value", "=", "\"/api/backup\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "@", "ResponseBody", "Backup", "processBackup", "(", "@", "RequestParam", "(", "\"fileData\"", ")", "MultipartFile", "fileData", ")", "t...
Restore backup data @param fileData - json file with restore data @return @throws Exception
[ "Restore", "backup", "data" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/BackupController.java#L86-L105
164,918
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java
Client.enableHost
public static void enableHost(String hostName) throws Exception { Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port); com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME); impl.enableHost(hostName...
java
public static void enableHost(String hostName) throws Exception { Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port); com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME); impl.enableHost(hostName...
[ "public", "static", "void", "enableHost", "(", "String", "hostName", ")", "throws", "Exception", "{", "Registry", "myRegistry", "=", "LocateRegistry", ".", "getRegistry", "(", "\"127.0.0.1\"", ",", "port", ")", ";", "com", ".", "groupon", ".", "odo", ".", "p...
Enable a host @param hostName @throws Exception
[ "Enable", "a", "host" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java#L33-L38
164,919
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java
Client.isAvailable
public static boolean isAvailable() throws Exception { try { Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port); com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME); return tru...
java
public static boolean isAvailable() throws Exception { try { Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port); com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME); return tru...
[ "public", "static", "boolean", "isAvailable", "(", ")", "throws", "Exception", "{", "try", "{", "Registry", "myRegistry", "=", "LocateRegistry", ".", "getRegistry", "(", "\"127.0.0.1\"", ",", "port", ")", ";", "com", ".", "groupon", ".", "odo", ".", "proxyli...
Returns whether or not the host editor service is available @return @throws Exception
[ "Returns", "whether", "or", "not", "the", "host", "editor", "service", "is", "available" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/hostsedit/rmi/Client.java#L100-L108
164,920
javalite/activeweb
activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java
FreeMarkerTag.getContextPath
protected String getContextPath(){ if(context != null) return context; if(get("context_path") == null){ throw new ViewException("context_path missing - red alarm!"); } return get("context_path").toString(); }
java
protected String getContextPath(){ if(context != null) return context; if(get("context_path") == null){ throw new ViewException("context_path missing - red alarm!"); } return get("context_path").toString(); }
[ "protected", "String", "getContextPath", "(", ")", "{", "if", "(", "context", "!=", "null", ")", "return", "context", ";", "if", "(", "get", "(", "\"context_path\"", ")", "==", "null", ")", "{", "throw", "new", "ViewException", "(", "\"context_path missing -...
Returns this applications' context path. @return context path.
[ "Returns", "this", "applications", "context", "path", "." ]
f25f589da94852b6f5625182360732e0861794a6
https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java#L122-L130
164,921
javalite/activeweb
activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java
FreeMarkerTag.process
protected void process(String text, Map params, Writer writer){ try{ Template t = new Template("temp", new StringReader(text), FreeMarkerTL.getEnvironment().getConfiguration()); t.process(params, writer); }catch(Exception e){ throw new ViewException(e); ...
java
protected void process(String text, Map params, Writer writer){ try{ Template t = new Template("temp", new StringReader(text), FreeMarkerTL.getEnvironment().getConfiguration()); t.process(params, writer); }catch(Exception e){ throw new ViewException(e); ...
[ "protected", "void", "process", "(", "String", "text", ",", "Map", "params", ",", "Writer", "writer", ")", "{", "try", "{", "Template", "t", "=", "new", "Template", "(", "\"temp\"", ",", "new", "StringReader", "(", "text", ")", ",", "FreeMarkerTL", ".", ...
Processes text as a FreeMarker template. Usually used to process an inner body of a tag. @param text text of a template. @param params map with parameters for processing. @param writer writer to write output to.
[ "Processes", "text", "as", "a", "FreeMarker", "template", ".", "Usually", "used", "to", "process", "an", "inner", "body", "of", "a", "tag", "." ]
f25f589da94852b6f5625182360732e0861794a6
https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java#L140-L148
164,922
javalite/activeweb
activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java
FreeMarkerTag.getAllVariables
protected Map getAllVariables(){ try{ Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator(); Map vars = new HashMap(); while (names.hasNext()) { Object name =names.next(); vars.put(name, get(name.toString())); ...
java
protected Map getAllVariables(){ try{ Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator(); Map vars = new HashMap(); while (names.hasNext()) { Object name =names.next(); vars.put(name, get(name.toString())); ...
[ "protected", "Map", "getAllVariables", "(", ")", "{", "try", "{", "Iterator", "names", "=", "FreeMarkerTL", ".", "getEnvironment", "(", ")", ".", "getKnownVariableNames", "(", ")", ".", "iterator", "(", ")", ";", "Map", "vars", "=", "new", "HashMap", "(", ...
Returns a map of all variables in scope. @return map of all variables in scope.
[ "Returns", "a", "map", "of", "all", "variables", "in", "scope", "." ]
f25f589da94852b6f5625182360732e0861794a6
https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/FreeMarkerTag.java#L154-L166