jbackup/src/main/java/org/jbundle/jbackup/Scanner.java
public static void main(String[] args)
	{
		Properties properties = new Properties();
		if (args != null)
		{		// Move the args to a property file
			for (int i = 0; i < args.length; i++)
			{
				int iEquals = args[i].indexOf('=');
				if (iEquals != -1)
					if (iEquals < args[i].length() - 1)
						properties.setProperty(args[i].substring(0, iEquals), args[i].substring(iEquals + 1));
			}
		}
		String strPropertyFileName = properties.getProperty(PROPERTY_FILENAME_PARAM);
		if (strPropertyFileName != null)
		{
			Properties propertiesRead = AppUtilities.readProperties(strPropertyFileName);
			propertiesRead.putAll(properties);		// Add the read-in properties
			properties = propertiesRead;
		}
		Scanner scanner = new Scanner(properties);
		scanner.run();
		AppUtilities.writeProperties(strPropertyFileName, properties);
	}
public static void main(String[] args)
	{
		Properties properties = new Properties();
		if (args != null)
		{		// Move the args to a property file
			for (int i = 0; i < args.length; i++)
			{
				int iEquals = args[i].indexOf('=');
				if (iEquals != -1)
					if (iEquals < args[i].length() - 1)
						properties.setProperty(args[i].substring(0, iEquals), args[i].substring(iEquals + 1));
			}
		}
		String strPropertyFileName = properties.getProperty(PROPERTY_FILENAME_PARAM);
		if (strPropertyFileName != null)
		{
			Properties propertiesRead = AppUtilities.readProperties(strPropertyFileName);
			propertiesRead.putAll(properties);		// Add the read-in properties
			properties = propertiesRead;
		}
		Scanner scanner = new Scanner(properties);
		scanner.run();
		AppUtilities.writeProperties(strPropertyFileName, properties);
	}
public static void main ( String [ ] args ) { Properties properties = new Properties ( ) ; if ( args != null ) { // Move the args to a property file for ( int i = 0 ; i < args . length ; i ++ ) { int iEquals = args [ i ] . indexOf ( ' ' ) ; if ( iEquals != - 1 ) if ( iEquals < args [ i ] . length ( ) - 1 ) properties . setProperty ( args [ i ] . substring ( 0 , iEquals ) , args [ i ] . substring ( iEquals + 1 ) ) ; } } String strPropertyFileName = properties . getProperty ( PROPERTY_FILENAME_PARAM ) ; if ( strPropertyFileName != null ) { Properties propertiesRead = AppUtilities . readProperties ( strPropertyFileName ) ; propertiesRead . putAll ( properties ) ; // Add the read-in properties properties = propertiesRead ; } Scanner scanner = new Scanner ( properties ) ; scanner . run ( ) ; AppUtilities . writeProperties ( strPropertyFileName , properties ) ; }
Standalone support.
Usually you specify a property file to use (ie., property.filename=c:\\temp\\updatesite.properties)
Standalone support . Usually you specify a property file to use ( ie . property . filename = c : \\ temp \\ updatesite . properties )