Package com.avaje.ebeaninternal.server.lib.resource

Examples of com.avaje.ebeaninternal.server.lib.resource.FileResourceSource


    if (fileDir != null) {
      // explicitly stated so
      File dir = new File(fileDir);
      if (dir.exists()) {
        logger.info("ResourceManager initialised: type[file] [" + fileDir + "]");
        return new FileResourceSource(fileDir);
      } else {
        String msg = "ResourceManager could not find directory [" + fileDir + "]";
        throw new NotFoundException(msg);
      }
    }

    // try to guess the directory starting from the current working
    // directory, and searching to a maximum depth of 3 subdirectories
    File guessDir = DirectoryFinder.find(null, "WEB-INF", 3);
    if (guessDir != null) {
      // Typically this means we found the WEB-INF directory below the
      // current working directory
      logger.info("ResourceManager initialised: type[file] [" + guessDir.getPath() + "]");
      return new FileResourceSource(guessDir.getPath());
    }

    // default to the current working directory
    File workingDir = new File(".");
    return new FileResourceSource(workingDir);
  }
View Full Code Here

TOP

Related Classes of com.avaje.ebeaninternal.server.lib.resource.FileResourceSource

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.