Package java.net

Examples of java.net.MalformedURLException


        if (documentRoot != null)
        {
            if (!path.startsWith("/"))
            {
                throw new MalformedURLException("The specified path ('" + path
                        + "') does not start with a '/' character");
            }
            File resolved = new File(documentRoot, path.substring(1));
            if (resolved.exists())
            {
View Full Code Here


      // Fail if no valid key store was located
      if( url == null )
      {
         String msg = "Failed to find url=" + storeURL + " as a URL, file or resource";
         throw new MalformedURLException(msg);
      }
      return url;
   }
View Full Code Here

        } else if (urls.length == 2) {
            // URL!URL form
            bundleURL = new URL(urls[0]);
            metadataURL = new URL(urls[1]);
        } else {
            throw new MalformedURLException("The iPOJO url is not formatted correctly, ipojo:bundle_url[!metadata_url] expected");
        }

        logger.log(LOG_DEBUG, format("Extracted URL %s", url));

        // Dump the referenced bundle on disk
View Full Code Here

    return imageRegistry;
  }

  private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
    if (baseURL == null) {
      throw new MalformedURLException();
    }

    StringBuffer buffer = new StringBuffer();
    buffer.append("full"); //$NON-NLS-1$
    buffer.append('/');
View Full Code Here

    protected URLConnection openConnection(URL url) throws IOException
    {
        Object svc = getStreamHandlerService();
        if (svc == null)
        {
            throw new MalformedURLException("Unknown protocol: " + url.toString());
        }
        if (svc instanceof URLStreamHandlerService)
        {
            return ((URLStreamHandlerService) svc).openConnection(url);
        }
View Full Code Here

    protected URLConnection openConnection(URL url, java.net.Proxy proxy) throws IOException
    {
        Object svc = getStreamHandlerService();
        if (svc == null)
        {
            throw new MalformedURLException("Unknown protocol: " + url.toString());
        }
        if (svc instanceof URLStreamHandlerService)
        {
            Method method;
            try
View Full Code Here

     */
    private URL getRemoteObrInstallUrl(String path) throws IOException, InvalidSyntaxException
    {
        if( path == null || path.trim().length() == 0 )
        {
            throw new MalformedURLException( "Path cannot be null or empty. Syntax " + SYNTAX );
        }
        final String[] segments = path.split( "/" );
        if( segments.length > 2 )
        {
            throw new MalformedURLException( "Path cannot contain more then one '/'. Syntax  " + SYNTAX );
        }
        final StringBuffer buffer = new StringBuffer();
        // add bundle symbolic name filter
        buffer.append( "(symbolicname=" ).append( segments[ 0 ] ).append( ")" );
        if( !validateFilter( buffer.toString() ) )
        {
            throw new MalformedURLException( "Invalid symbolic name value." );
        }
        // add bundle version filter
        if( segments.length > 1 )
        {
            buffer.insert( 0, "(&" ).append( "(version=" ).append( segments[ 1 ] ).append( "))" );
            if( !validateFilter( buffer.toString() ) )
            {
                throw new MalformedURLException( "Invalid version value." );
            }
        }
        Resource[] discoverResources =
           m_reRepositoryAdmin.discoverResources(buffer.toString());
        if (discoverResources == null || discoverResources.length == 0)
View Full Code Here

         }

         return decodeStub(url, environment);
      }

      throw new MalformedURLException("Unsupported lookup " + url);
   }
View Full Code Here

         finally
         {
            if (ois != null) ois.close();
         }
      }
      throw new MalformedURLException("Unsupported binding: " + url);
   }
View Full Code Here

   {
      String path = url.getURLPath();
      if (path.startsWith(JNDI_CONTEXT))
      {
         String jndiURL = path.substring(JNDI_CONTEXT.length());
         if (jndiURL == null || jndiURL.length() == 0) throw new MalformedURLException("No JNDI URL specified: " + url);
         return jndiURL;
      }
      throw new MalformedURLException("Unsupported binding: " + url);
   }
View Full Code Here

TOP

Related Classes of java.net.MalformedURLException

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.