/** * @param projectPath * @return * @throws MojoExecutionException */ public static String getGitConfigFolder( String projectPath ) throws MojoExecutionException { projectPath = forceNoSlashOnDir( projectPath ); while ( !FileUtils.fileExists( projectPath + File.separator + ".git" ) ) { int lastSlashIndex = projectPath.lastIndexOf( File.separator ); if ( lastSlashIndex < 1 ) { throw new MojoExecutionException( "There are no local git repository associated with this project" ); } projectPath = projectPath.substring( 0, lastSlashIndex ); } return projectPath + File.separator + ".git"; }
/** * Tests if there is an existing recording with the provided name string. * * @param name The provided name string. * @return true if recording exists, false otherwise. */ private boolean doesRecordingExist(String name) { Path destinationPath = PathManager.getInstance().getRecordingPath(name); return FileUtils.fileExists(destinationPath.toString()); }
/** * Returns true if there is at least one resource folder inside the project. * * @param project * @return */ public static boolean hasResourceFolders( MavenProject project ){ List<Resource> resources = project.getResources(); for ( Resource res : resources ){ if ( FileUtils.fileExists( res.getDirectory() ) ){ return true; } } return false; }
if ( FileUtils.fileExists( extractedRunnerPath ) ) { FileUtils.cleanDirectory( extractedRunnerPath ); if ( ! FileUtils.fileExists( projectTestOutputJar ) ) { throw new MojoExecutionException( "Project Test Jar could not be found. Make sure you use 'test-jar'" + " goal of the 'maven-jar-plugin' in your project's pom" ); Properties prop = new Properties(); String configPropertiesFilePath = extractedRunnerPath + "project.properties"; if ( FileUtils.fileExists( configPropertiesFilePath ) ) {
executor.executeCommand( command, parameters ); if ( FileUtils.fileExists( outputApk ) )
return FileUtils.fileExists( fileString ); return !FileUtils.fileExists( fileString );
return FileUtils.fileExists( fileString ); return !FileUtils.fileExists( fileString );
if (!FileUtils.fileExists(timestampDirectory)) { FileUtils.mkdir(timestampDirectory);
/** * Reads a build config file, and returns the List of all compiler arguments. * * @param fileName the filename of the argfile * @param outputDir the build output area * @return * @throws IOException */ public static List<String> readBuildConfigFile( String fileName, File outputDir ) throws IOException { List<String> arguments = new ArrayList<String>(); File argFile = new File( outputDir, fileName ); if ( FileUtils.fileExists( argFile.getAbsolutePath() ) ) { FileReader reader = new FileReader( argFile ); BufferedReader bufRead = new BufferedReader( reader ); String line = null; do { line = bufRead.readLine(); if ( null != line ) { arguments.add( line ); } } while ( null != line ); } return arguments; }
/** * Based on a set of weavedirs returns a set of all the files to be weaved. * * @return * @throws MojoExecutionException */ public static Set<String> getWeaveSourceFiles( String[] weaveDirs ) throws MojoExecutionException { Set<String> result = new HashSet<String>(); for ( int i = 0; i < weaveDirs.length; i++ ) { String weaveDir = weaveDirs[i]; if ( FileUtils.fileExists( weaveDir ) ) { try { result.addAll( FileUtils.getFileNames( new File( weaveDir ), "**/*.class", DEFAULT_EXCLUDES, true ) ); } catch ( IOException e ) { throw new MojoExecutionException( "IO Error resolving weavedirs", e ); } } } return result; }
/** * Reads a build config file, and returns the List of all compiler arguments. * * @param fileName the filename of the argfile * @param outputDir the build output area * @return * @throws IOException */ public static List<String> readBuildConfigFile( String fileName, File outputDir ) throws IOException { List<String> arguments = new ArrayList<String>(); File argFile = new File( outputDir, fileName ); if ( FileUtils.fileExists( argFile.getAbsolutePath() ) ) { FileReader reader = new FileReader( argFile ); BufferedReader bufRead = new BufferedReader( reader ); String line = null; do { line = bufRead.readLine(); if ( null != line ) { arguments.add( line ); } } while ( null != line ); } return arguments; }
/** * Based on a set of weavedirs returns a set of all the files to be weaved. * * @return * @throws MojoExecutionException */ public static Set<String> getWeaveSourceFiles( String[] weaveDirs ) throws MojoExecutionException { Set<String> result = new HashSet<String>(); for ( int i = 0; i < weaveDirs.length; i++ ) { String weaveDir = weaveDirs[i]; if ( FileUtils.fileExists( weaveDir ) ) { try { result.addAll( FileUtils.getFileNames( new File( weaveDir ), "**/*.class", DEFAULT_EXCLUDES, true ) ); } catch ( IOException e ) { throw new MojoExecutionException( "IO Error resolving weavedirs", e ); } } } return result; }
private Metadata getMetaData(String xmlMetaData) throws XmlMappingException, IOException, ClassNotFoundException, SQLException { if (isNotBlank(xmlMetaData)) { return getMetadataFromFile(xmlMetaData); } else if (FileUtils.fileExists(DEFAULT_XML_METADATA)) { return getMetadataFromFile(DEFAULT_XML_METADATA); } else { return getMetadataFromDatabase(); } }
private Metadata getMetaData(String xmlMetaData) throws XmlMappingException, IOException, ClassNotFoundException, SQLException { if (isNotBlank(xmlMetaData)) { return getMetadataFromFile(xmlMetaData); } else if (FileUtils.fileExists(DEFAULT_XML_METADATA)) { return getMetadataFromFile(DEFAULT_XML_METADATA); } else { return getMetadataFromDatabase(); } }
private Celerio getCelerio(String xmlConfiguration) { Celerio celerio; if (FileUtils.fileExists(xmlConfiguration)) { celerio = getCelerioConfigurationFromFile(xmlConfiguration); } else { getLog().warn("****** The Celerio configuration file [" + xmlConfiguration + "] could not be found. Will use default empty configuration ******"); celerio = new Celerio(); } overridePacksAndModules(celerio); return celerio; }
public static FluentSettingsBuilder loadSettings() throws FileNotFoundException, SettingsBuildingException { String settingsPath = getDefaultSystemSettings(); if (settingsPath != null && FileUtils.fileExists(settingsPath)) { return loadSettings(settingsPath); } else { return newSettings(); } }
if ( FileUtils.fileExists( sourceDir ) )
private Celerio getCelerio(String xmlConfiguration) { Celerio celerio; if (FileUtils.fileExists(xmlConfiguration)) { celerio = getCelerioConfigurationFromFile(xmlConfiguration); } else { getLog().warn("****** The Celerio configuration file [" + xmlConfiguration + "] could not be found. Will use default empty configuration ******"); celerio = new Celerio(); } overridePacksAndModules(celerio); return celerio; }
if (!FileUtils.fileExists(filename)) { return;
if (!FileUtils.fileExists(filename)) { return;