Package java.net

Examples of java.net.URL.openStream()


              frontUrl+"/section/"
                + section.getId()
                + ".html?static=true&nocache=true");
          BufferedReader reader =
            new BufferedReader(
              new InputStreamReader(url.openStream()));
          String content = "<!-- �ON static export -->";
          String line = "";
          while (line != null) {
            line = reader.readLine();
            if (line != null) {
View Full Code Here


              frontUrl+"/publication/"
                + publication.getId()
                + ".html?static=true&nocache=true");
          BufferedReader reader =
            new BufferedReader(
              new InputStreamReader(url.openStream()));
          String content = "<!-- �ON static export -->";
          String line = "";
          while (line != null) {
            line = reader.readLine();
            if (line != null) {
View Full Code Here

      // add index
      URL url =
        new URL(
          frontUrl+"?static=true&nocache=true");
      BufferedReader reader =
        new BufferedReader(new InputStreamReader(url.openStream()));
      String content = "<!-- �ON static export -->";
      String line = "";
      while (line != null) {
        line = reader.readLine();
        if (line != null) {
View Full Code Here

      Enumeration<URL> urls = utils.getClass().getClassLoader().getResources(resourceName);
      boolean first = true;
      while (urls.hasMoreElements()) {
  URL url = urls.nextElement();
  if (first) {
    defaultProps.load(url.openStream());
    first = false;
  }
  else {
    Properties props = new Properties(defaultProps);
    props.load(url.openStream());
View Full Code Here

    defaultProps.load(url.openStream());
    first = false;
  }
  else {
    Properties props = new Properties(defaultProps);
    props.load(url.openStream());
    defaultProps = props;
  }
      }
    } catch (Exception ex) {
      System.err.println("Warning, unable to load properties file(s) from "
View Full Code Here

        String providerClassName = providerClass.getName();
        providerClassName = providerClassName.substring(providerClassName.indexOf('.')+1);
        URL servicesURL = loader.findResource("META-INF/services/" + providerClass.getName());
        if (servicesURL != null) {
            BufferedReader in
                = new BufferedReader(new InputStreamReader(servicesURL.openStream()));
            try {
                String className;
                while ((className = in.readLine()) != null) {
                    log.info("Loading the " + providerClassName + " implementation: " + className);
                    try {
View Full Code Here

        if (file.equalsIgnoreCase("-url"))
        {
      if (args.length > 1)
      {
        URL u = new URL(args[1]);
            Player player = new Player(new BufferedInputStream(u.openStream(), 2048));
            System.out.println("starting");
            player.play();
            System.out.println("ending");
      }
      else
View Full Code Here

       URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
      
       log.debug("Execute SQL from resource URL: "+url);
      
       String sql = getStringFromStream(url.openStream());
       sql = sql.replaceAll("(?m)^--([^\n]+)?$", ""); // Remove all commented lines
       final String[] statements ;
       if (useEOL) {
           statements = sql.split("[\n;]");
       } else {
View Full Code Here

                }
            } else {
                InputStream in = null;
                try {
          URL url = new URL(uri);
          in = new BufferedInputStream(url.openStream());
          info("Found config override URI " + uri);
          temp.load(in);
        } catch (MalformedURLException e) {
                    warning("URI for override properties is malformed, skipping: " + uri);
                    return;
View Full Code Here

        if (obj instanceof String) {
            try {
                // first try to interpret string as URL
                URL url = new URL(obj.toString());
                return getHtmlDocument(new InputStreamReader(url.openStream()));
            } catch (MalformedURLException nourl) {
                // if not a URL, maybe it is the XML itself
                return getHtmlDocument(new StringReader(obj.toString()));
            }
        } else if (obj instanceof InputStream) {
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.