test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8024678 Sdiff test/testlibrary/ctw/src/sun/hotspot/tools/ctw

test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java

Print this page
rev 5310 : [mq]: 8024678


  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package sun.hotspot.tools.ctw;
  25 
  26 import java.net.MalformedURLException;
  27 import java.net.URL;
  28 import java.net.URLClassLoader;
  29 import java.util.Set;
  30 import java.util.EnumSet;
  31 import java.util.HashSet;
  32 import java.util.concurrent.Executor;
  33 
  34 import java.io.*;
  35 import java.nio.file.*;
  36 import java.nio.file.attribute.*;
  37 
  38 /**
  39  * * Handler for dirs containing classes to compile.
  40  * @author igor.ignatyev@oracle.com
  41  */
  42 public class ClassPathDirEntry extends PathHandler {
  43 
  44     private final int rootLength = root.toString().length();
  45 
  46     public ClassPathDirEntry(Path root, Executor executor) {
  47         super(root, executor);
  48         try {
  49             URL url = root.toUri().toURL();
  50             setLoader(new URLClassLoader(new URL[]{url}));
  51         } catch (MalformedURLException e) {
  52             e.printStackTrace();
  53         }
  54     }
  55 
  56     @Override
  57     public void process() {
  58         System.out.println("# dir: " + root);
  59         if (!Files.exists(root)) {
  60             return;




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package sun.hotspot.tools.ctw;
  25 
  26 import java.net.MalformedURLException;
  27 import java.net.URL;
  28 import java.net.URLClassLoader;
  29 import java.util.Set;
  30 import java.util.EnumSet;
  31 import java.util.HashSet;
  32 import java.util.concurrent.Executor;
  33 
  34 import java.io.*;
  35 import java.nio.file.*;
  36 import java.nio.file.attribute.*;
  37 
  38 /**
  39  * Handler for dirs containing classes to compile.

  40  */
  41 public class ClassPathDirEntry extends PathHandler {
  42 
  43     private final int rootLength = root.toString().length();
  44 
  45     public ClassPathDirEntry(Path root, Executor executor) {
  46         super(root, executor);
  47         try {
  48             URL url = root.toUri().toURL();
  49             setLoader(new URLClassLoader(new URL[]{url}));
  50         } catch (MalformedURLException e) {
  51             e.printStackTrace();
  52         }
  53     }
  54 
  55     @Override
  56     public void process() {
  57         System.out.println("# dir: " + root);
  58         if (!Files.exists(root)) {
  59             return;


test/testlibrary/ctw/src/sun/hotspot/tools/ctw/ClassPathDirEntry.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File