Package java.util

Examples of java.util.Properties


  private Builder builder;

  public void bootStrap()
  {
    Properties properties = new Properties();

    try
    {
      properties = ConfigUtils.loadProperties("/strecks.properties");
    }
    catch (Exception e)
    {
      log.info("Configuration file strecks.properties not loaded. Using default builder");
    }

    String builder = properties.getProperty("builder.impl");
    if (builder == null)
    {
      builder = DefaultImplementations.BUILDER;
    }
View Full Code Here


  private InterceptorBuilder interceptorBuilder;

  public void build(String prefix)
  {
    String name = getFileName(prefix);
    Properties properties = ConfigUtils.loadProperties(name);
    this.implementationConfig = getImplementationConfig(properties);
    setActionCreator(ReflectHelper.createInstance(implementationConfig.getActionCreatorClassName(), ActionCreator.class));
    setDelegate(ReflectHelper.createInstance(implementationConfig.getDelegateClassName(), ControllerProcessorDelegate.class));
    setFormHandler(ReflectHelper.createInstance(implementationConfig.getFormHandlerClassName(), FormWrapper.class));
    setActionContextFactory(ReflectHelper.createInstance(implementationConfig.getContextFactoryClassName(),
View Full Code Here

  private Collection<AfterInterceptor> afterInterceptors = new LinkedHashSet<AfterInterceptor>();

  public void build(String prefix)
  {
    String fileName = getFileName(prefix);
    Properties properties = ConfigUtils.loadProperties(fileName);
    this.interceptorConfig = getInterceptorConfig(properties);
    createInterceptors(this.interceptorConfig);
  }
View Full Code Here

    public static void main(String[] args) throws IOException {
        new CheckI18N().start();
    }

    public void start() throws IOException {
        Properties english = new Properties();
        english.load(getClass().getResourceAsStream("messages.properties"));

        Properties de = new Properties();
        de.load(getClass().getResourceAsStream("messages_de.properties"));


//        Map<String, String> englishMap = FastMap.newInstance();
        Set<String> deKeys = FastSet.newInstance();
        Map<String, String> missingInDE = new TreeMap();
        Set<String> unusedInDE = FastSet.newInstance();

        for (Entry<Object, Object> entry : de.entrySet()) {
            deKeys.add(entry.getKey().toString());
        }

        for (Entry<Object, Object> entry : english.entrySet()) {
            if (!deKeys.contains(entry.getKey().toString()))
View Full Code Here

      if (selectedElement instanceof IFile) {
        _file = (IFile) selectedElement;
        if (_file.getFileExtension().equals("properties")) {
          IContainer container = _file.getParent();
          if (container.getName().startsWith("labels_")) {
            Properties props = WGADesignStructureHelper.loadLabel(_file);
            if (!props.isEmpty()) {
              _props = props;
              action.setEnabled(true);
            }
          }
        }
View Full Code Here

       MetaType metaType = mp.getMetaType();
       if (metaType.isProperties()) {
         return (PropertiesMetaValue)mp.getValue();
       }
       else if (metaType.isComposite()) {
        Properties props = new Properties();
        MapCompositeValueSupport map = (MapCompositeValueSupport) mp.getValue();
        MapCompositeMetaType type = map.getMetaType();
        for (String key : type.keySet()) {
          MetaValue value = map.get(key);
          props.setProperty(key, stringValue(value));
        }
        return props;
       }
       throw new IllegalArgumentException(prop+ " is not a properties type"); //$NON-NLS-1$
     }
View Full Code Here

    private void testFileRead() throws Exception {
        Connection conn = getConnection("functions");
        Statement stat = conn.createStatement();
        String fileName = getBaseDir() + "/test.txt";
        Properties prop = System.getProperties();
        OutputStream out = IOUtils.openFileOutputStream(fileName, false);
        prop.store(out, "");
        out.close();
        ResultSet rs = stat.executeQuery("SELECT LENGTH(FILE_READ('" + fileName + "')) LEN");
        rs.next();
        assertEquals(IOUtils.length(fileName), rs.getInt(1));
        rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "') PROP");
        rs.next();
        Properties p2 = new Properties();
        p2.load(rs.getBinaryStream(1));
        assertEquals(prop.size(), p2.size());
        rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "', NULL) PROP");
        rs.next();
        String ps = rs.getString(1);
        InputStreamReader r = new InputStreamReader(IOUtils.openFileInputStream(fileName));
        String ps2 = IOUtils.readStringAndClose(r, -1);
View Full Code Here

  }
 
  @Override
    @ManagementOperation(description="Execute a sql query", params={@ManagementParameter(name="vdbName"),@ManagementParameter(name="vdbVersion"), @ManagementParameter(name="command"), @ManagementParameter(name="timoutInMilli")}) 
  public List<List> executeQuery(final String vdbName, final int version, final String command, final long timoutInMilli) throws AdminException {
    Properties properties = new Properties();
    properties.setProperty(TeiidURL.JDBC.VDB_NAME, vdbName);
    properties.setProperty(TeiidURL.JDBC.VDB_VERSION, String.valueOf(version));
   
    String user = "JOPR ADMIN"; //$NON-NLS-1$
    LogManager.logDetail(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("admin_executing", user, command)); //$NON-NLS-1$
   
    SessionMetadata session = null;
View Full Code Here

       
        if (userName == null || userName.trim().length() == 0) {
            throw new IllegalArgumentException(JDBCPlugin.Util.getString("invalid_parameter")); //$NON-NLS-1$
        }
       
      final Properties p = new Properties();
      p.setProperty(TeiidURL.CONNECTION.APP_NAME, applicationName);
      p.setProperty(TeiidURL.CONNECTION.USER_NAME, userName);
        if (password != null) {
          p.setProperty(TeiidURL.CONNECTION.PASSWORD, new String(password));
        }
      p.setProperty(TeiidURL.CONNECTION.SERVER_URL, serverURL);
      return createAdmin(p);
    }
View Full Code Here

            if (providerURL == null) {
                  InitialContext ic  = new InitialContext();
                  return (ProfileService)ic.lookup(PROFILE_SERVICE_JNDI_NAME);
            }
           
            Properties env = new Properties();
            env.setProperty(Context.PROVIDER_URL, providerURL);
             
              // un-authenticated remote login
                env.setProperty(Context.INITIAL_CONTEXT_FACTORY, NAMING_CONTEXT_FACTORY);
                env.setProperty(Context.SECURITY_PRINCIPAL, user);
                env.setProperty(Context.SECURITY_CREDENTIALS, password);        
                env.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces"); //$NON-NLS-1$
                env.setProperty(JNP_DISABLE_DISCOVERY_JNP_INIT_PROP, "true"); //$NON-NLS-1$
                env.setProperty(JNP_TIMEOUT_JNP_INIT_PROP, String.valueOf(JNP_TIMEOUT));
                env.setProperty(JNP_SOTIMEOUT_JNP_INIT_PROP, String.valueOf(JNP_SO_TIMEOUT));
                env.setProperty(JNP_DISABLE_DISCOVERY_JNP_INIT_PROP, String.valueOf(JNP_DISABLE_DISCOVERY));
                env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); //$NON-NLS-1$ //$NON-NLS-2$
                InitialContext ic  = new InitialContext(env);
               
                try {
                  return (ProfileService)ic.lookup(PROFILE_SERVICE_JNDI_NAME);
                } catch(NamingException e) {
View Full Code Here

TOP

Related Classes of java.util.Properties

Copyright © 2015 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.