Java Properties Load from File loadGradleResource(String fileName)

Here you can find the source of loadGradleResource(String fileName)

Description

This can load a gradle resource, such as a .properties file.

License

Academic Free License

Parameter

Parameter Description
fileName a parameter

Declaration

public static File loadGradleResource(String fileName) 

Method Source Code


//package com.java2s;
//License from project: Academic Free License 

import java.io.File;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Main {
    public static Logger LOGGER = LoggerFactory.getLogger("StaticLogger");

    /**/* w  ww. ja  v  a 2  s. com*/
     * This can load a gradle resource, such as a .properties file.
     * 
     * @param fileName
     * @return
     */
    public static File loadGradleResource(String fileName) {
        File junitFile = new File(fileName);
        if (junitFile.exists()) {
            LOGGER.info("The file '" + junitFile.getAbsolutePath() + "' exists.");
        } else {
            LOGGER.info("Problem loading Gradle resource: " + junitFile.getAbsolutePath());
        }
        return junitFile;
    }
}

Related

  1. loadEnv(final String configFilePath)
  2. loadErrorMap(InputStream resourceStream)
  3. loadEscaping(Properties prop, InputStream stream)
  4. loadFixedCommits()
  5. loadFixture(String fixtureId)
  6. loadHeader(String fileName)
  7. loadIncludes(String propertyName, boolean mandatory, File file, Properties configProps)
  8. loadInputAsString(InputStream is)
  9. loadInstallProps()