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


                        // it also has the right symbolic name
                        try {
                            new Version(bundleVersion);
                            // Do a file.toURI().toURL() to preserve special path characters
                            // see http://www.javalobby.org/java/forums/t19698.html
                            URL bundleUrl = new URL(null, jarFile.toURI().toURL().toString(), new URLStreamHandler() {

                                @Override
                                protected URLConnection openConnection(final URL u) throws IOException {
                                    return new URLConnection(u) {
                                        @Override
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

        // Now allow the URL handling to work.
        URLStreamHandlerFactory ushf = new URLStreamHandlerFactory(){
            public URLStreamHandler createURLStreamHandler(String protocol) {
                if (protocol.equalsIgnoreCase(LOOPBACK)){
                    return new URLStreamHandler(){
                        @Override
                        protected URLConnection openConnection(URL u) throws IOException {
                            return null;// not needed for HttpClient
                        }
                    };
View Full Code Here

   *  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
View Full Code Here

        final String localProtocolScheme = "inline";
        URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() {
            @Override
            public URLStreamHandler createURLStreamHandler(String protocol) {
                if (localProtocolScheme.equalsIgnoreCase(protocol)) {
                    return new URLStreamHandler() {
                        @Override
                        protected URLConnection openConnection(URL u) throws IOException {
                            return new URLConnection(u) {
                                @Override
                                public void connect() throws IOException {
View Full Code Here

            else
            {
                path = fsManager.resolveURI(file);
            }

            URLStreamHandler handler = new VFSURLStreamHandler(path);
            return new URL(null, path.getURI(), handler);
        }
        catch (FileSystemException fse)
        {
            throw new ConfigurationRuntimeException("Could not parse basePath: " + basePath
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.