List of usage examples for java.util Hashtable Hashtable
public Hashtable()
From source file:Sampler.java
private void createOps() { mOps = new Hashtable(); createConvolutions(); createTransformations(); createLookups(); createRescales(); createColorOps(); }
From source file:com.softeffect.primemovers.ui.ClientApplication.java
public ClientApplication() { clientFacade = new AppClientFacade(); Hashtable domains = new Hashtable(); Domain statusDomain = new Domain("STATUS"); statusDomain.addDomainPair("ACTIVE", "Active"); statusDomain.addDomainPair("EXPIRED", "Expired"); domains.put(statusDomain.getDomainId(), statusDomain); Properties props = new Properties(); ClientSettings clientSettings = new ClientSettings(new EnglishOnlyResourceFactory("TZS", props, true), domains);//from w ww .ja v a 2 s . com ClientSettings.BACKGROUND = "background4.jpg"; ClientSettings.TREE_BACK = "treeback2.jpg"; ClientSettings.VIEW_BACKGROUND_SEL_COLOR = true; ClientSettings.VIEW_MANDATORY_SYMBOL = false; ClientSettings.FILTER_PANEL_ON_GRID = true; ClientSettings.ASK_BEFORE_CLOSE = true; ClientSettings.GRID_PROFILE_MANAGER = new FileGridProfileManager(); ClientSettings.LOOKUP_FRAME_CONTENT = LookupController.GRID_AND_FILTER_FRAME; ClientSettings.MDI_TOOLBAR = new DefaultToolBar(); LoginDialog d = new LoginDialog(null, false, this, "Authentication", "Login", 'L', "Exit", 'E', "Store Account", applicationInfo.getName()); }
From source file:in.mycp.controller.ReportsController.java
@RequestMapping(value = "/usageDept", produces = "text/html") public String usageDept(HttpServletRequest req, HttpServletResponse resp) { Hashtable<String, List> deptHash = new Hashtable<String, List>(); if (Commons.getCurrentSession() != null && Commons.getCurrentSession().getCompanyId() > 0) { Company c = Company.findCompany(Commons.getCurrentSession().getCompanyId()); req.setAttribute("currency", c.getCurrency()); Set<Department> depts = c.getDepartments(); for (Iterator iterator = depts.iterator(); iterator.hasNext();) { Department department = (Department) iterator.next(); deptHash.put(department.getName(), reportService.findAssets4Department(department.getId())); }//w ww. j a v a 2s . c om } else { List<Company> comps = Company.findAllCompanys(); req.setAttribute("currency", "All"); for (Iterator iterator = comps.iterator(); iterator.hasNext();) { Company company = (Company) iterator.next(); Set<Department> depts = company.getDepartments(); for (Iterator iterator1 = depts.iterator(); iterator1.hasNext();) { Department department = (Department) iterator1.next(); deptHash.put(department.getName() + " @ " + department.getCompany().getName(), reportService.findAssets4Department(department.getId())); } } } req.setAttribute("deptHash", deptHash); return "reports/usageDept"; }
From source file:edu.tsinghua.lumaqq.QQShowManager.java
/** * ?//from w w w . jav a2s. c o m * @param userDir */ private QQShowManager(String userDir) { QQ_SHOW_CACHE_DIR = userDir + "/qqshow/"; File file = new File(QQ_SHOW_CACHE_DIR); file.mkdirs(); cache = new Hashtable<Integer, Image>(); threads = new Hashtable<Integer, QQShowDownloadThread>(); listeners = new ArrayList<IQQShowListener>(); }
From source file:com.google.feedserver.authentication.SampleTokenManager.java
public SampleTokenManager() { authtokens = new Hashtable<String, String>(); }
From source file:org.fusesource.cloudmix.controller.bundle.JerseyServletFactory.java
public void afterPropertiesSet() throws Exception { // This property is needed for JAXB to properly operate inside OSGi System.setProperty("com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize", "true"); Dictionary<String, String> initParams = new Hashtable<String, String>(); initParams.put("com.sun.jersey.config.feature.Redirect", "true"); initParams.put("com.sun.jersey.config.feature.ImplicitViewables", "true"); initParams.put("com.sun.jersey.config.property.resourceConfigClass", "org.fusesource.cloudmix.controller.bundle.OSGiResourceConfig"); initParams.put("jersey_osgi.classnames", classNames); ClassLoader cl = Thread.currentThread().getContextClassLoader(); try {/*from ww w . j a v a 2 s. co m*/ Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); // TODO is there another way to do this now using the standard Jersey stuff? //SpringServlet jerseyServlet = new SpringServlet(applicationContext, authenticator); SpringServlet jerseyServlet = new SpringServlet(); httpService.registerServlet(rootContext, jerseyServlet, initParams, null); LOG.info("Registered servlet at: " + rootContext); LOG.info("With initialization : " + initParams); } finally { Thread.currentThread().setContextClassLoader(cl); } }
From source file:com.oracle.osgi.jmx.compendium.ConfigAdminManager.java
@SuppressWarnings("unchecked") public void addProperty(String pid, String name, String value, String type) throws IOException { Configuration config = admin.getConfiguration(pid, null); Dictionary properties = config.getProperties(); if (properties == null) { properties = new Hashtable(); }//from w w w .ja v a 2 s. co m properties.put(name, parse(value, type)); config.update(properties); }
From source file:com.alfaariss.oa.util.saml2.binding.BindingProperties.java
/** * Constructor. /*from ww w . ja v a2 s . co m*/ */ public BindingProperties() { _bindingProperties = new Hashtable<String, Properties>(); _bindings = new Vector<String>(); _sDefault = null; }
From source file:hd.controller.AddImageToProductServlet.java
/** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods.// ww w.j a v a 2 s. c om * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { boolean isMultipart = ServletFileUpload.isMultipartContent(request); if (!isMultipart) { //to do } else { FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = null; try { items = upload.parseRequest(request); } catch (FileUploadException e) { e.printStackTrace(); } Iterator iter = items.iterator(); Hashtable params = new Hashtable(); String fileName = null; while (iter.hasNext()) { FileItem item = (FileItem) iter.next(); if (item.isFormField()) { params.put(item.getFieldName(), item.getString("UTF-8")); } else if (!item.isFormField()) { try { long time = System.currentTimeMillis(); String itemName = item.getName(); fileName = time + itemName.substring(itemName.lastIndexOf("\\") + 1); String RealPath = getServletContext().getRealPath("/") + "images\\" + fileName; File savedFile = new File(RealPath); item.write(savedFile); } catch (Exception e) { e.printStackTrace(); } } } String productID = (String) params.get("txtProductId"); System.out.println(productID); String tilte = (String) params.get("newGalleryName"); String description = (String) params.get("GalleryDescription"); String url = "images/" + fileName; ProductDAO productDao = new ProductDAO(); ProductPhoto productPhoto = productDao.insertProductPhoto(tilte, description, url, productID); response.sendRedirect("MyProductDetailServlet?action=showDetail&txtProductID=" + productID); } } catch (Exception e) { e.printStackTrace(); } finally { out.close(); } }
From source file:net.hardisonbrewing.signingserver.ui.CodSigningScreen.java
public CodSigningScreen(JAD jad, SigningAuthority[] signingAuthorities) { this.jad = jad; this.signingAuthorities = signingAuthorities; COD[] cods = jad.getCODs();//from ww w .j av a 2 s . c o m signingAttempts = new SigningAttempt[cods.length * signingAuthorities.length]; authoritySigningAttempts = new Hashtable(); for (int i = 0, k = 0; i < cods.length; i++) { for (int j = 0; j < signingAuthorities.length; j++) { SigningAttempt signingAttempt = new SigningAttempt(); signingAttempt.cod = cods[i]; signingAttempt.signingAuthority = signingAuthorities[j]; String signingAuthorityKey = signingAttempt.signingAuthority.key; Vector vector = (Vector) authoritySigningAttempts.get(signingAuthorityKey); if (vector == null) { vector = new Vector(); authoritySigningAttempts.put(signingAuthorityKey, vector); } vector.addElement(signingAttempt); signingAttempts[k++] = signingAttempt; } } listField = new ListField(); listField.setCallback(new MyListFieldCallback()); listField.setSize(signingAttempts.length); listField.setRowHeight(30); add(listField); }