Examples of FileUtils


Examples of org.apache.openejb.loader.FileUtils

    public static File install(URL resource, String name, boolean overwrite) throws IOException {
        if (resource == null) return null;

        SystemInstance system = SystemInstance.get();
        FileUtils base = system.getBase();
        File conf = base.getDirectory("conf");

        if (!conf.exists()) return null;

        File file = new File(conf, name);
View Full Code Here

Examples of org.apache.openejb.loader.FileUtils

        service = new ServiceDaemon(service);
        return service;
    }

    private void overrideProperties(String serviceName, Properties serviceProperties) throws IOException {
        final FileUtils base = SystemInstance.get().getBase();

        // Override with file from conf dir
        final File conf = base.getDirectory("conf");
        if (conf.exists()) {
            File serviceConfig = new File(conf, serviceName + ".properties");
            if (!serviceConfig.exists()) {
                serviceConfig = new File(conf, "conf.d/" + serviceConfig.getName()); // name was already built so use it
            }
View Full Code Here

Examples of org.apache.openejb.loader.FileUtils

            }
        }
    }

    private void preprocessProperties(final Properties properties) {
        final FileUtils base = SystemInstance.get().getBase();
        final File confDir = new File(base.getDirectory(), "conf");
        final File baseDir = base.getDirectory();
        final File userDir = new File("foo").getParentFile();

        final File[] paths = {confDir, baseDir, userDir};

        final List<File> missing = new ArrayList<File>();
View Full Code Here

Examples of org.apache.openejb.loader.FileUtils

            }
        }

        // resolve jar locations //////////////////////////////////////  BEGIN  ///////

        final FileUtils base = SystemInstance.get().getBase();

        final List<URL> declaredAppsUrls = new ArrayList<URL>();
        try {
            for (final Deployments deployment : deployments) {
                DeploymentsResolver.loadFrom(deployment, base, declaredAppsUrls);
View Full Code Here

Examples of org.apache.openejb.loader.FileUtils

        }
        return toString(declaredAppsUrls);
    }

    public ArrayList<File> getModulesFromClassPath(List<String> declaredApps, final ClassLoader classLoader) {
        final FileUtils base = SystemInstance.get().getBase();
        if (declaredApps == null) {
            declaredApps = getDeclaredApps();
        }
        final List<URL> classpathAppsUrls = new ArrayList<URL>();
        DeploymentsResolver.loadFromClasspath(base, classpathAppsUrls, classLoader);
View Full Code Here

Examples of org.apache.openejb.loader.FileUtils

        return null;
    }

    private static File createCacheDir() {
        try {
            FileUtils openejbBase = SystemInstance.get().getBase();

            File dir = null;
            // if we are not embedded, cache (temp) dir is under base dir
            if (openejbBase.getDirectory("conf").exists()) {
                try {
                    dir = openejbBase.getDirectory("temp");
                } catch (IOException e) {
                    //Ignore
                }
            }
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

              loader = loader.getParent();
              if(loader == null)
                  throw new BuildException("Unable to find a URLClassLoader to which path may be added");
          }

              FileUtils fu = FileUtils.newFileUtils();
              for(Iterator iterator = paths.iterator(); iterator.hasNext();)
              {
                  Path path = (Path)iterator.next();
                  String pathElements[] = path.list();
                  int i = 0;
                  while(i < pathElements.length)
                  {
                      String pathElement = pathElements[i];
                      URL url;
            try {
              url = new URL(fu.toURI(pathElement));
            } catch (MalformedURLException e) {
              throw new BuildException("Unable to load class path at path="+pathElement, e);
            }
                      List urls = Arrays.asList(((URLClassLoader)loader).getURLs());
                      if (!urls.contains(url)) {
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

        executeTarget("cleanup");
    }

    public void testFilterSet() throws IOException {
        executeTarget("testFilterSet");
        FileUtils fileUtils = FileUtils.newFileUtils();
        File tmp  = new File(getProjectDir(), "move.filterset.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(fileUtils.contentEquals(tmp, check));
    }
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

        assertTrue(fileUtils.contentEquals(tmp, check));
    }

    public void testFilterChain() throws IOException {
        executeTarget("testFilterChain");
        FileUtils fileUtils = FileUtils.newFileUtils();
        File tmp  = new File(getProjectDir(), "move.filterchain.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(fileUtils.contentEquals(tmp, check));
    }
View Full Code Here

Examples of org.apache.tools.ant.util.FileUtils

        PrintStream newps = new PrintStream(new FileOutputStream(f2));
        System.setOut(newps);
        project.executeTarget("unforked");
        System.setOut(ps);
        newps.close();
        FileUtils fu = FileUtils.newFileUtils();
        assertTrue(fu.contentEquals(f1, f2));
    }
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.