Package java.net

Examples of java.net.URI.toURL()


            File f = new File(uri);
            if (f.exists())
            {
                try
                {
                    return new MockRequestDispatcher(uri.toURL());
                }
                catch (MalformedURLException e)
                {
                    this.log(e.getMessage());
                    return null;
View Full Code Here


        URI uri = info.getUpdateLocation();
        Resource res = null;

        try
        {
            URL url = (uri != null) ? uri.toURL() : bundle.getLocation().toURI().toURL();
            if (name.contains("!"))
            {
                String[] split = name.split("!");
                url = new URL("jar:" + url + "!/" + split[1] + "." + artifact.getExt());
            }
View Full Code Here

        private URL getURL(ISigilBundle bundle) throws MalformedURLException
        {
            URI uri = bundle.getBundleInfo().getUpdateLocation();
            if (uri != null)
            {
                return uri.toURL();
            }
            else
            {
                File path = bundle.getLocation();
                if (path == null)
View Full Code Here

            ISigilBundle pb = ModelElementFactory.getInstance().newModelElement(
                ISigilBundle.class);
            pb.setBundleInfo(info);

            Map<Object, Object> meta = new HashMap<Object, Object>();
            ModuleDescriptor md = SigilParser.instance().parseDescriptor(uri.toURL());
            if (!bb.getId().equals(md.getModuleRevisionId().getName()))
            { // non-default artifact
                for (Artifact a : md.getAllArtifacts())
                {
                    if (a.getName().equals(bb.getId()))
View Full Code Here

                    defaultsCache.put(uri, dflt);
                    cached = true;
                }

                Properties p = new Properties();
                InputStream stream = uri.toURL().openStream();
                p.load(stream);
                stream.close();

                // expand variables in defaults
                for (Object k : p.keySet())
View Full Code Here

        URI uri;
        try
        {
            uri = new URI( targetPath );
            uri.toURL(); // check protocol
        }
        catch ( Exception e )
        {
            uri = null;
        }
View Full Code Here

            RepositoryImpl repository;

            File obrRepoFile = new File( repositoryXml );
            if ( obrRepoFile.isFile() )
            {
                repository = ( RepositoryImpl ) dmh.repository( repositoryXml.toURL() );
            }
            else
            {
                repository = new RepositoryImpl();
            }
View Full Code Here

        }
        else if ( urlTemplate != null )
        {
            URI parentDir = path.getParentFile().toURI();

            String absoluteDir = trim( root.toString(), parentDir.toURL().toString() );
            String relativeDir = trim( root.toString(), root.relativize( parentDir ).toString() );

            String url = urlTemplate.replaceAll( "%v", "" + resource.getVersion() );
            url = url.replaceAll( "%s", resource.getSymbolicName() );
            url = url.replaceAll( "%f", path.getName() );
View Full Code Here

        URI uri;
        try
        {
            uri = new URI( targetPath );
            uri.toURL(); // check protocol
        }
        catch ( Exception e )
        {
            uri = null;
        }
View Full Code Here

        }

        URI uri;
        try {
            uri = new URI(targetPath);
            uri.toURL(); // check protocol
        } catch (Exception e) {
            uri = null;
        }

        // fall-back to file-system approach
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.