src/main/java/com/atlassian/uwc/ui/ConverterEngine.java [2464:2539]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	protected Properties loadProperties(String fileLocation) {
		/* most of this code grabbed from ConfluenceSettingsForm.populateConfluenceSettings*/
		Properties properties = new Properties();
		File confSettings = new File(fileLocation);
		if (confSettings.exists()) {
			// load properties file
			FileInputStream fis;
			try {
				fis = new FileInputStream(fileLocation);
				properties.load(fis);
				fis.close();
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return properties;
	}

	/**
	 * calculates the number of bytes the given maxString represents
	 * @param maxString file size described as a String.
	 * Example: 5B, 5K, 5M, 5G, etc.
	 * @return as Bytes.
	 * Respectively: 5, 5120, 5242880, 5368709120
	 */
	protected int getAsBytes(String maxString) {
		String maxRegex = "^(\\d+)(\\D)";
		if (maxString == null || "".equals(maxString)) 
			return -1;

		int power, num = 0;
		String numString, unitString = null;
		if (Pattern.matches("^\\d+$", maxString)) {
			unitString = "B";
			numString = maxString;
		}
		else {
			numString = maxString.replaceFirst(maxRegex, "$1");
			unitString = maxString.replaceFirst(maxRegex, "$2");
		}
		try {
			num = Integer.parseInt(numString);
		} catch (NumberFormatException e) {
			String message = PROP_ATTACHMENT_SIZE_MAX + " setting is malformed.\n" +
					"Setting must be formatted like so: [number][unit], where unit is\n" +
					"one of the following: B, K, M, G. No max attachment size set.";
			log.error(message);
			return -1;
		}
		unitString = unitString.toUpperCase();
		char unit = unitString.toCharArray()[0]; //first char in that string

		switch (unit) {
		case ('B'): power = 0;break;
		case ('K'): power = 1;break;
		case ('M'): power = 2;break;
		case ('G'): power = 3;break;
		default: return -1;
		}

		int multiplier = (int) Math.pow(1024, power);
		int value = num * multiplier;
		return value;
	}

	/**
	 * @param page
	 * @param file
	 * @return true if a particular page already has a particular
	 * file attached.
	 */
	protected boolean alreadyAttached(Page page, File file) {
		String pagename = page.getName();
		String filename = file.getName();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/com/atlassian/uwc/ui/ConverterEngine_v2.java [864:939]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected Properties loadProperties(String fileLocation) {
    	/* most of this code grabbed from ConfluenceSettingsForm.populateConfluenceSettings*/
    	Properties properties = new Properties();
        File confSettings = new File(fileLocation);
        if (confSettings.exists()) {
            // load properties file
            FileInputStream fis;
            try {
                fis = new FileInputStream(fileLocation);
				properties.load(fis);
                fis.close();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return properties;
    }

    /**
     * @param maxString file size described as a String.
     * Example: 5B, 5K, 5M, 5G, etc.
     * @return as Bytes.
     * Respectively: 5, 5120, 5242880, 5368709120
     */
    protected int getAsBytes(String maxString) {
    	String maxRegex = "^(\\d+)(\\D)";
    	if (maxString == null || "".equals(maxString)) 
    		return -1;
    	
    	int power, num = 0;
    	String numString, unitString = null;
    	if (Pattern.matches("^\\d+$", maxString)) {
    		unitString = "B";
    		numString = maxString;
    	}
    	else {
	    	numString = maxString.replaceFirst(maxRegex, "$1");
	    	unitString = maxString.replaceFirst(maxRegex, "$2");
    	}
    	try {
    	num = Integer.parseInt(numString);
    	} catch (NumberFormatException e) {
    		String message = PROP_ATTACHMENT_SIZE_MAX + " setting is malformed.\n" +
    				"Setting must be formatted like so: [number][unit], where unit is\n" +
    				"one of the following: B, K, M, G. No max attachment size set.";
    		log.error(message);
    		return -1;
    	}
    	unitString = unitString.toUpperCase();
    	char unit = unitString.toCharArray()[0]; //first char in that string
		
    	switch (unit) {
			case ('B'): power = 0;break;
			case ('K'): power = 1;break;
			case ('M'): power = 2;break;
			case ('G'): power = 3;break;
			default: return -1;
		}
		
		int multiplier = (int) Math.pow(1024, power);
		int value = num * multiplier;
		return value;
	}


	/**
     * @param page
     * @param file
     * @return true if a particular page already has a particular
     * file attached.
     */
    protected boolean alreadyAttached(Page page, File file) {
		String pagename = page.getName();
		String filename = file.getName();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



