public static Properties loadProperties( final File file ) throws IOException { if ( file == null ) { throw new NullPointerException( "file" ); } return loadProperties( new FileInputStream( file ) ); }
public static Properties loadProperties( final URL url ) throws IOException { if ( url == null ) { throw new NullPointerException( "url" ); } return loadProperties( url.openStream() ); }
Properties conf = PropertyUtils.loadProperties( resource.openStream() );
static String getArchiverVersion() { try { final Properties properties = PropertyUtils.loadProperties( JdkManifestFactory.class.getResourceAsStream( "/META-INF/maven/org.codehaus.plexus/plexus-archiver/pom.properties" ) ); return properties != null ? properties.getProperty( "version" ) : null; } catch ( final IOException e ) { throw new AssertionError( e ); } }
public static Properties loadProperties( URL url ) { try { return loadProperties( url.openStream() ); } catch ( Exception e ) { // ignore } return null; }
public static Properties loadProperties( File file ) { try { return loadProperties( new FileInputStream( file ) ); } catch ( Exception e ) { // ignore } return null; }
/** * Programmatically inject properties (and possibly overwrite existing * properties) * * @param project * the current maven project * @param properties * the properties from input stream */ public static void inject(final MavenProject project, final InputStream properties) throws MojoFailureException { final Properties defaults = PropertyUtils.loadProperties(properties); final NarProperties nar = getInstance(project); nar.properties.putAll(defaults); }
private NarProperties(final MavenProject project, File narFile, String customPropertyLocation) throws MojoFailureException { final Properties defaults = PropertyUtils.loadProperties(NarUtil.class.getResourceAsStream(AOL_PROPERTIES)); if (defaults == null) { throw new MojoFailureException("NAR: Could not load default properties file: '" + AOL_PROPERTIES + "'."); } this.properties = new Properties(defaults); FileInputStream fis = null; try { if (project != null) { fis = new FileInputStream(narFile); this.properties.load(fis); } } catch (final FileNotFoundException e) { if (customPropertyLocation != null) { // We tried loading from a custom location - so throw the exception throw new MojoFailureException("NAR: Could not load custom properties file: '" + customPropertyLocation + "'."); } } catch (final IOException e) { // ignore (FIXME) } finally { try { if (fis != null) { fis.close(); } } catch (final IOException e) { // ignore } } }
Properties conf = PropertyUtils.loadProperties( resource.openStream() );
properties = PropertyUtils.loadProperties( url );
properties = PropertyUtils.loadProperties( url );
Properties conf = PropertyUtils.loadProperties( resource.openStream() );
private List<String> getFilteredExtensions( String archetypeFilteredExtentions, File propertyFile ) { List<String> filteredExtensions = new ArrayList<String>(); if ( StringUtils.isNotEmpty( archetypeFilteredExtentions ) ) { filteredExtensions.addAll( Arrays.asList( StringUtils.split( archetypeFilteredExtentions, "," ) ) ); getLog().debug( "Found in command line extensions = " + filteredExtensions ); } if ( filteredExtensions.isEmpty() && propertyFile != null && propertyFile.exists() ) { Properties properties = PropertyUtils.loadProperties( propertyFile ); String extensions = properties.getProperty( Constants.ARCHETYPE_FILTERED_EXTENSIONS ); if ( StringUtils.isNotEmpty( extensions ) ) { filteredExtensions.addAll( Arrays.asList( StringUtils.split( extensions, "," ) ) ); } getLog().debug( "Found in propertyFile " + propertyFile.getName() + " extensions = " + filteredExtensions ); } if ( filteredExtensions.isEmpty() ) { filteredExtensions.addAll( Constants.DEFAULT_FILTERED_EXTENSIONS ); getLog().debug( "Using default extensions = " + filteredExtensions ); } return filteredExtensions; }
Properties properties = PropertyUtils.loadProperties( propertyFile );
private List<String> getFilteredExtensions( String archetypeFilteredExtentions, File propertyFile ) { List<String> filteredExtensions = new ArrayList<String>(); if ( StringUtils.isNotEmpty( archetypeFilteredExtentions ) ) { filteredExtensions.addAll( Arrays.asList( StringUtils.split( archetypeFilteredExtentions, "," ) ) ); getLog().debug( "Found in command line extensions = " + filteredExtensions ); } if ( filteredExtensions.isEmpty() && propertyFile != null && propertyFile.exists() ) { Properties properties = PropertyUtils.loadProperties( propertyFile ); String extensions = properties.getProperty( Constants.ARCHETYPE_FILTERED_EXTENSIONS ); if ( StringUtils.isNotEmpty( extensions ) ) { filteredExtensions.addAll( Arrays.asList( StringUtils.split( extensions, "," ) ) ); } getLog().debug( "Found in propertyFile " + propertyFile.getName() + " extensions = " + filteredExtensions ); } if ( filteredExtensions.isEmpty() ) { filteredExtensions.addAll( Constants.DEFAULT_FILTERED_EXTENSIONS ); getLog().debug( "Using default extensions = " + filteredExtensions ); } return filteredExtensions; }
Properties properties = PropertyUtils.loadProperties( propertyFile );
Properties properties = PropertyUtils.loadProperties( tmpPropertiesFile );
if ( filterFile.isFile() ) properties.putAll( PropertyUtils.loadProperties( filterFile ) );
File filterFile = new File(s); if (filterFile.isFile()) { properties.putAll(PropertyUtils.loadProperties(filterFile));
Properties properties = PropertyUtils.loadProperties( inputStream ); if ( inputStream == null )