Package java.net

Examples of java.net.URLStreamHandler


     * @param factory Handler factory to use to generate the URLs
     */
    protected static URL[] convert(String input[],
                                   URLStreamHandlerFactory factory) {

        URLStreamHandler streamHandler = null;

        URL url[] = new URL[input.length];
        for (int i = 0; i < url.length; i++) {
            try {
                String protocol = parseProtocol(input[i]);
View Full Code Here


        if (debug >= 1)
            log("addRepository(" + repository + ")");

        // Add this repository to our underlying class loader
        try {
            URLStreamHandler streamHandler = null;
            String protocol = parseProtocol(repository);
            if (factory != null)
                streamHandler = factory.createURLStreamHandler(protocol);
            URL url = new URL(null, repository, streamHandler);
            super.addURL(url);
View Full Code Here

     * @exception IllegalArgumentException if the manifest of a JAR file
     *  cannot be processed correctly
     */
    protected void addRepositoryInternal(String repository) {

        URLStreamHandler streamHandler = null;
        String protocol = parseProtocol(repository);
        if (factory != null)
            streamHandler = factory.createURLStreamHandler(protocol);

        // Validate the manifest of a JAR file repository
View Full Code Here

     * @param factory Handler factory to use to generate the URLs
     */
    protected static URL[] convert(String input[],
                                   URLStreamHandlerFactory factory) {

        URLStreamHandler streamHandler = null;

        URL url[] = new URL[input.length];
        for (int i = 0; i < url.length; i++) {
            try {
                String protocol = parseProtocol(input[i]);
View Full Code Here

        try
        {
            String urlLocation = "archive://" + archive.getName() + "/" + beansXmlPath;

            return  new URL(null, urlLocation, new URLStreamHandler()
                        {
                            @Override
                            protected URLConnection openConnection(URL u) throws IOException
                            {
                                return new URLConnection(u)
View Full Code Here

  // Construct URL with special URLStreamHandler for proxying
  // ServletContext.getResourceAsStream()
  private static URL getUrlForResourceAsStream(final ExternalContext externalContext, String path)
      throws MalformedURLException {
    URLStreamHandler handler = new URLStreamHandler() {
      protected URLConnection openConnection(URL u) throws IOException {
        final String file = u.getFile();
        return new URLConnection(u) {
          public void connect() throws IOException {
          }
View Full Code Here

     */
    public URLStreamHandler createURLStreamHandler(String protocol) {
        List<URLStreamHandlerFactory> list = getList();

        for (Iterator<URLStreamHandlerFactory> i = list.iterator(); i.hasNext();) {
            URLStreamHandler handler = i.next().createURLStreamHandler(protocol);

            if (handler != null) {
                return handler;
            }
        }
View Full Code Here

            if (entryName != null)
      {
        final String target = ((entryName.startsWith("/")) ? entryName.substring(1) : entryName);
        final JarEntry entry = m_jar.getJarEntry(((m_prefix == null) ? "" : m_prefix) + target);
        if ( entry != null) {
                URL result = new URL(null, "jar:" + m_urlString + "!/" + ((m_prefix == null) ? "" : m_prefix) + target, new URLStreamHandler() {
                 
                 
                  protected URLConnection openConnection(final URL u) throws IOException {
                    return new java.net.JarURLConnection(u) {
                     
View Full Code Here

      for (final Map.Entry<ArchivePath, Node> entry : beansXmls.entrySet())
      {
         try
         {
            addWebBeansXmlLocation(
                  new URL(null, "archive:/" + entry.getKey().get(), new URLStreamHandler()
                  {
                     @Override
                     protected java.net.URLConnection openConnection(URL u) throws java.io.IOException
                     {
                        return new URLConnection(u)
View Full Code Here

    * @return The protocol handler or null if not found
    */
   public URLStreamHandler createURLStreamHandler(final String protocol)
   {
      // Check the handler map
      URLStreamHandler handler = (URLStreamHandler) handlerMap.get(protocol);
      if( handler != null )
         return handler;

      // Validate that createURLStreamHandler is not recursing
      String prevProtocol = (String) createURLStreamHandlerProtocol.get();
View Full Code Here

TOP

Related Classes of java.net.URLStreamHandler

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.