/** * Checks that the specified String is not null or empty and represents a readable file, throws exception if it is * empty or null and does not represent a path to a file. * * @param path * The path to check * @param message * The exception message * @throws IllegalArgumentException * Thrown if path is empty, null or invalid */ public static void readable(final String path, final String message) throws IllegalArgumentException { notNullOrEmpty(path, message); readable(new File(path), message); }
/** * Checks that the specified String is not null or empty and represents a readable file, throws exception if it is * empty or null and does not represent a path to a file. * * @param path * The path to check * @param message * The exception message * @throws IllegalArgumentException * Thrown if path is empty, null or invalid */ public static void readable(final String path, final String message) throws IllegalArgumentException { notNullOrEmpty(path, message); readable(new File(path), message); }
public static LoadPomTask loadPomFromFile(final String pathToPomFile, final String... profiles) throws IllegalArgumentException, InvalidConfigurationFileException { Validate.notNullOrEmpty(pathToPomFile, "Path to a POM file must be specified"); Validate.readable(pathToPomFile, "Path to the pom.xml ('" + pathToPomFile + "')file must be defined and accessible"); return new LoadPomTask(new File(pathToPomFile), profiles); }
public static LoadPomTask loadPomFromFile(final String pathToPomFile, final String... profiles) throws IllegalArgumentException, InvalidConfigurationFileException { Validate.notNullOrEmpty(pathToPomFile, "Path to a POM file must be specified"); Validate.readable(pathToPomFile, "Path to the pom.xml ('" + pathToPomFile + "')file must be defined and accessible"); return new LoadPomTask(new File(pathToPomFile), profiles); }
@Override public MavenWorkingSession execute(final MavenWorkingSession session) { Validate.notNull(pomFile, "Path to pom.xml file must not be null"); Validate.readable(pomFile, "Path to the POM ('" + pomFile + "') file must be defined and accessible"); return session.loadPomFromFile(pomFile, profiles); }
@Override public MavenWorkingSession execute(final MavenWorkingSession session) { Validate.notNull(pomFile, "Path to pom.xml file must not be null"); Validate.readable(pomFile, "Path to the POM ('" + pomFile + "') file must be defined and accessible"); return session.loadPomFromFile(pomFile, profiles); }
@Override public ConfiguredMavenImporter configureFromFile(File file) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.notNull(file, "settings file must be specified"); Validate.readable(file, "settings file is not readable: " + file.getAbsolutePath()); new ConfigureSettingsFromFileTask(file).execute(session); return this; }
@Override public ConfiguredMavenImporter configureFromFile(File file) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.notNull(file, "settings file must be specified"); Validate.readable(file, "settings file is not readable: " + file.getAbsolutePath()); new ConfigureSettingsFromFileTask(file).execute(session); return this; }
@Override public UNCONFIGURABLERESOLVERSYSTEMTYPE fromFile(File file) throws IllegalArgumentException, InvalidConfigurationFileException { Validate.notNull(file, "settings file must be specified"); Validate.readable(file, "settings file is not readable: " + file.getAbsolutePath()); new ConfigureSettingsFromFileTask(file).execute(this.getSession()); return this.getUnconfigurableView(); }
@Override public UNCONFIGURABLERESOLVERSYSTEMTYPE fromFile(File file) throws IllegalArgumentException, InvalidConfigurationFileException { Validate.notNull(file, "settings file must be specified"); Validate.readable(file, "settings file is not readable: " + file.getAbsolutePath()); new ConfigureSettingsFromFileTask(file).execute(this.getSession()); return this.getUnconfigurableView(); }