public ResolveStageBaseImpl(final MavenWorkingSession session) { Validate.stateNotNull(session, "Maven Working session must not be null"); this.session = session; }
public static LoadPomTask loadPomFromClassLoaderResource(String pathToPomResource, ClassLoader cl, String... profiles) throws IllegalArgumentException, InvalidConfigurationFileException { Validate.notNullOrEmpty(pathToPomResource, "path to CL resource must be specified"); Validate.notNull(cl, "ClassLoader must be specified"); final File file = FileUtil.INSTANCE.fileFromClassLoaderResource(pathToPomResource, cl); return new LoadPomTask(file, profiles); }
@Override public ConfiguredMavenImporter configureFromClassloaderResource(String path, ClassLoader cl) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.isNullOrEmpty(path); Validate.notNull(cl, "ClassLoader is required"); final File file = FileUtil.INSTANCE.fileFromClassLoaderResource(path, cl); return this.configureFromFile(file); }
@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); }
/** * 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); }
@Override public ConfiguredMavenImporter configureFromFile(String pathToFile) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.isNullOrEmpty(pathToFile); new ConfigureSettingsFromFileTask(pathToFile).execute(session); return this; }
private File temporaryFile(final String resourceName) throws IOException { File tmpDir = new File(SecurityActions.getProperty("java.io.tmpdir")); Validate.writeableDirectory(tmpDir.getAbsolutePath(), "Unable to access temporary directory at " + tmpDir.getAbsolutePath()); File localResource = File.createTempFile(resourceName.replace("/", "-").replace("\\", "-") .replace(File.pathSeparator, "-").replaceAll("\\s", "-"), ".tmp", tmpDir); localResource.deleteOnExit(); return localResource; } }
private UNCONFIGURABLERESOLVERSYSTEMTYPE configureFromClassloaderResource(final String path, final ClassLoader loader) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.isNullOrEmpty(path); Validate.notNull(loader, "ClassLoader is required"); final File file = FileUtil.INSTANCE.fileFromClassLoaderResource(path, loader); return this.fromFile(file); }
public static LoadPomTask loadPomFromClassLoaderResource(String pathToPomResource, ClassLoader cl, String... profiles) throws IllegalArgumentException, InvalidConfigurationFileException { Validate.notNullOrEmpty(pathToPomResource, "path to CL resource must be specified"); Validate.notNull(cl, "ClassLoader must be specified"); final File file = FileUtil.INSTANCE.fileFromClassLoaderResource(pathToPomResource, cl); return new LoadPomTask(file, 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(String pathToFile) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.isNullOrEmpty(pathToFile); new ConfigureSettingsFromFileTask(pathToFile).execute(session); return this; }
private File temporaryFile(final String resourceName) throws IOException { File tmpDir = new File(SecurityActions.getProperty("java.io.tmpdir")); Validate.writeableDirectory(tmpDir.getAbsolutePath(), "Unable to access temporary directory at " + tmpDir.getAbsolutePath()); File localResource = File.createTempFile(resourceName.replace("/", "-").replace("\\", "-") .replace(File.pathSeparator, "-").replaceAll("\\s", "-"), ".tmp", tmpDir); localResource.deleteOnExit(); return localResource; } }
public ResolveStageBaseImpl(final MavenWorkingSession session) { Validate.stateNotNull(session, "Maven Working session must not be null"); this.session = session; }
private UNCONFIGURABLERESOLVERSYSTEMTYPE configureFromClassloaderResource(final String path, final ClassLoader loader) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.isNullOrEmpty(path); Validate.notNull(loader, "ClassLoader is required"); final File file = FileUtil.INSTANCE.fileFromClassLoaderResource(path, loader); return this.fromFile(file); }
/** * Checks that the specified array is not null or contain any null values. * * @param objects * The object to check * @param message * The exception message */ public static void notNullAndNoNullValues(final Object[] objects, final String message) { notNull(objects, message); for (Object object : objects) { notNull(object, message); } }
@Override public ConfiguredMavenImporter configureFromClassloaderResource(String path, ClassLoader cl) throws IllegalArgumentException, UnsupportedOperationException, InvalidConfigurationFileException { Validate.isNullOrEmpty(path); Validate.notNull(cl, "ClassLoader is required"); final File file = FileUtil.INSTANCE.fileFromClassLoaderResource(path, cl); return this.configureFromFile(file); }
/** * Checks that the specified array is not null or contain any null values. * * @param objects * The object to check * @param message * The exception message */ public static void notNullAndNoNullValues(final Object[] objects, final String message) { notNull(objects, message); for (Object object : objects) { notNull(object, message); } }
public static LoadPomTask loadPomFromFile(final File pomFile, final String... profiles) { Validate.notNull(pomFile, "POM file must be specified"); return new LoadPomTask(pomFile, profiles); }