Package java.net

Examples of java.net.URL


        } else if (inLineWSDL != null) {
            wsdlElement = (OMElement) inLineWSDL;
            wsdlFound = true;
        } else if (wsdlURI != null) {
            try {
              URL url = wsdlURI.toURL();
                publishWSDL = url.toString();

                OMNode node = SynapseConfigUtils.getOMElementFromURL(publishWSDL, synapseHome);
                if (node instanceof OMElement) {
                    wsdlElement = (OMElement) node;
                }
View Full Code Here


        entryElement.addAttribute(fac.createOMAttribute(
                "key", nullNS, entry.getKey().trim()));
        int type = entry.getType();
        if (type == Entry.URL_SRC) {
            URL srcUrl = entry.getSrc();
            if (srcUrl != null) {
                entryElement.addAttribute(fac.createOMAttribute(
                        "src", nullNS, srcUrl.toString().trim()));
            }
        } else if (type == Entry.INLINE_XML) {
            Object value = entry.getValue();
            if (value != null && value instanceof OMElement) {
                entryElement.addChild((OMElement) value);
View Full Code Here

     
    } else if (name.equals("base")) {
       
        // BASE HREF=
        try {
          this.baseURL = new URL(element.getAttribute("href"));
          log.info("baseUR="+baseURL);
        } catch (MalformedURLException e) { }
       
    } else if (name.equals("frame")) {
     
View Full Code Here

      } catch (UnsupportedEncodingException e) {
      }
    }
   
    try {
      URL u = null;
      if (this.baseURL != null) {
        u = new URL(this.baseURL,newURL);
      } else {
        u = new URL(url,newURL);
      }
      links.add(u);
    } catch (Exception e) {
      log.debug("error during link extraction: "+e.getMessage()+" "+newURL);
    }
View Full Code Here

       tx =  (UserTransaction)new InitialContext().lookup("UserTransaction");
       tx.begin();
      
       log.debug("Execute SQL from resource: "+resource);

       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

     * @param msgContext the message being sent
     * @throws AxisFault on error
     */
    private void sendAsyncRequest(EndpointReference epr, MessageContext msgContext) throws AxisFault {
        try {
            URL url = new URL(epr.getAddress());
            String host = url.getHost();
            int port = url.getPort();
            if (port == -1) {
                // use default
                if ("http".equals(url.getProtocol())) {
                    port = 80;
                } else if ("https".equals(url.getProtocol())) {
                    port = 443;
                }
            }
            HttpHost httpHost = new HttpHost(host, port, url.getProtocol());

            Axis2HttpRequest axis2Req = new Axis2HttpRequest(epr, httpHost, msgContext);
            Object timeout = msgContext.getProperty(NhttpConstants.SEND_TIMEOUT);
            if (timeout != null && timeout instanceof Long) {
                axis2Req.setTimeout( (int) ((Long) timeout).longValue());
View Full Code Here

/**
* Creates the actions used by menu items and toolbar widgets.
*/
protected void makeActions() {
    URL url = getClass().getClassLoader().getResource(PRINT_ICON);
    String str = I18N.get(I18N.MENU_FILE_PREFIX, "SwingLE.action_print");
    printAction = new AbstractAction(str, new ImageIcon(url, str)) {
  public void actionPerformed(ActionEvent e) { printReport(); }
  };
    printAction.putValue(Action.SHORT_DESCRIPTION, str);
View Full Code Here

public class JSONCodecTest extends TestCase {
  public static String END_POINT = "http://localhost:8080/unitTest/json/parameter";
 
  protected String postOnEndPoint(String postBody) throws MalformedURLException, IOException {
    HttpURLConnection connection = (HttpURLConnection) new URL(END_POINT).openConnection();
    connection.setRequestProperty("Content-Type", "application/json");
    connection.setDoOutput(true);
    connection.getOutputStream().write(postBody.getBytes());
    BufferedReader bufReader = new BufferedReader(new InputStreamReader(connection.getResponseCode() < 300 ? connection.getInputStream() :
      connection.getErrorStream()));
View Full Code Here

                    return;
                }
            } 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

  public void save_refer(SiteBean site, int ref_id, int ref_type, HttpServletRequest req){
    if(!saveRefer)
      return ;
    String refer = RequestUtils.getHeader(req, "refer");
    if(StringUtils.isNotEmpty(refer)){
      URL url;
      try {
        url = new URL(refer);
        String host = url.getHost();
        if(!StringUtils.equals(req.getServerName(),host)){
          ExternalReferBean rbean = new ExternalReferBean();
          rbean.setUrl(refer);
          rbean.setClientAddr(req.getRemoteAddr());
          rbean.setReferTime(new Date());
View Full Code Here

TOP

Related Classes of java.net.URL

Copyright © 2018 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.