Package java.net

Examples of java.net.URL.openStream()


            if(enm.hasMoreElements()) {
               URL url = (URL)enm.nextElement();
               String urlTxt = "loading file '" + url.getFile() + "'";
               log.fine(urlTxt);
               try {
                  ret = url.openStream();
               }
               catch(IOException ex) {
                  log.warning("init: could not read properties from '" + url.getFile() + "' : " + ex.getMessage());
               }
               while(enm.hasMoreElements() && !this.warnings.contains(path)) {
View Full Code Here


            // keyStore with my private key
               FileLocator locator = new FileLocator(glob);
               URL url = locator.findFileInXmlBlasterSearchPath((String)null, keyStore);
               if (url != null) {
                  InputStream in = url.openStream();
                  java.security.KeyStore ks = java.security.KeyStore.getInstance(storeType); // since JDK 1.2
                  ks.load(in, keyStorePassword.toCharArray());
                  kmf = javax.net.ssl.KeyManagerFactory.getInstance(javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm());
                  kmf.init(ks, keyStorePassword.toCharArray());
                  if (firstKey) {
View Full Code Here

            }
            {  // trustStore with others public keys
               FileLocator locator = new FileLocator(glob);
               URL url = locator.findFileInXmlBlasterSearchPath((String)null, trustStore);
               if (url != null) {
                  InputStream in = url.openStream();
                  java.security.KeyStore ks = java.security.KeyStore.getInstance(storeType);
                  ks.load(in, trustStorePassword.toCharArray());
                  tmf = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm());
                  tmf.init(ks);
                  if (firstTrust) {
View Full Code Here

            // keyStore with my private key
               FileLocator locator = new FileLocator(glob);
               URL url = locator.findFileInXmlBlasterSearchPath((String)null, keyStore);
               if (url != null) {
                  InputStream in = url.openStream();
                  java.security.KeyStore ks = java.security.KeyStore.getInstance(storeType); // since JDK 1.2
                  ks.load(in, keyStorePassword.toCharArray());
                  kmf = javax.net.ssl.KeyManagerFactory.getInstance(javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm());
                  kmf.init(ks, keyStorePassword.toCharArray());
                  if (firstKey) {
View Full Code Here

            }
            {  // trustStore with others public keys
               FileLocator locator = new FileLocator(glob);
               URL url = locator.findFileInXmlBlasterSearchPath((String)null, trustStore);
               if (url != null) {
                  InputStream in = url.openStream();
                  java.security.KeyStore ks = java.security.KeyStore.getInstance(storeType);
                  ks.load(in, trustStorePassword.toCharArray());
                  tmf = javax.net.ssl.TrustManagerFactory.getInstance(javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm());
                  tmf.init(ks);
                  if (firstTrust) {
View Full Code Here

         "the file 'xmlBlasterPlugins.xml' has not been found in the search path nor in the property 'pluginsFile'");
      }

      if (log.isLoggable(Level.FINE)) log.fine("readConfigFile: the file is '" + url.getFile() + "'");
      try {
         InputStream fis = url.openStream();
         InputSource inSource = new InputSource(fis);
         reset();
         init(url.toString(), inSource);
         PluginHolder ret = getObject();
         PluginConfig[] arr = ret.getAllPluginConfig(this.glob.getNodeId().getId());
View Full Code Here

            {
                logger.debug("loading properties from --> '" + propertiesUri + "'");
            }

            this.properties = new Properties();
            this.properties.load(propertiesUri.openStream());

            for (final Iterator iterator = this.properties.keySet().iterator(); iterator.hasNext();)
            {
                final String property = (String)iterator.next();
                final String value = this.properties.getProperty(property);
View Full Code Here

                                    xmlResource,
                                    xmlResourceName,
                                    path));
                        if (uri != null)
                        {
                            inputStream = uri.openStream();
                        }
                    }
                    catch (final IOException exception)
                    {
                        // - ignore
View Full Code Here

                        try
                        {
                            uri = ResourceUtils.getResource(path);
                            if (uri != null)
                            {
                                inputStream = uri.openStream();
                            }
                        }
                        catch (final IOException exception)
                        {
                            // - ignore
View Full Code Here

  public AreaFile3(String urlString) throws java.io.IOException, java.net.MalformedURLException {
    long timeStart = System.currentTimeMillis();

    URL url = URLStreamHandlerFactory.makeURL( urlString);
    DataInputStream af = new DataInputStream(new BufferedInputStream(url.openStream()));
    readMetaData( af);
    readData( af);

    /* long timeEnd = System.currentTimeMillis();
    if (DebugFlags.isSet("AreaFile/readTiming"))
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.