Package com.impetus.annovention.resource

Examples of com.impetus.annovention.resource.ClassFileIterator


        } else if (url.getProtocol().equals("file")) {
          String path = url.getPath();
          String newPath = path.replace((CharSequence)"%2520", " ");
          File f = new File(newPath);
            if (f.isDirectory()) {
                return new ClassFileIterator(f, filter);
            } else {
              throw new RuntimeException("bug, how is this not a directory="+f.getAbsolutePath());
            }
        } else {
            throw new IOException("Unable to understand protocol: " + resource.getProtocol());
View Full Code Here


        } else if (url.getProtocol().equals("file")) {
          String path = url.getPath();
          String newPath = path.replace((CharSequence)"%2520", " ");
          File f = new File(newPath);
            if (f.isDirectory()) {
                return new ClassFileIterator(f, filter);
            } else {
              throw new RuntimeException("bug, how is this not a directory="+f.getAbsolutePath());
            }
        } else if (url.getProtocol().equals("vfs")) {
            URLConnection conn = new URL(urlString).openConnection();
            VirtualFile vf = (VirtualFile) conn.getContent();
            File contentsFile = vf.getPhysicalFile();
            File dir = contentsFile.getParentFile();
            String fileName = vf.getName();
            File physicalFile = new File(dir, fileName);
            if (urlString.indexOf("jar") > 0) {
                // Its a jar
                InputStream is = new FileInputStream(physicalFile);
                return new JarFileIterator(is, filter);
            } else {
                // Its a directory
                return new ClassFileIterator(physicalFile, filter);
            }

        } else {
            throw new IOException("Unable to understand protocol: " + resource.getProtocol());
        }
View Full Code Here

        } else if (url.getProtocol().equals("file")) {
          String path = url.getPath();
          String newPath = path.replace((CharSequence)"%2520", " ");
          File f = new File(newPath);
            if (f.isDirectory()) {
                return new ClassFileIterator(f, filter);
            } else {
              throw new RuntimeException("bug, how is this not a directory="+f.getAbsolutePath());
            }
        } else {
            throw new IOException("Unable to understand protocol: " + resource.getProtocol());
View Full Code Here

TOP

Related Classes of com.impetus.annovention.resource.ClassFileIterator

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.