package utility;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ResourceBundle;

import view.utilities.Alerts;

/**
 * Created by rhondusmithwick on 4/29/16.
 *
 * @author Rhondu Smithwick
 */
public class FilePathRelativizer {
    private FilePathRelativizer () {
    }

    public static String getBaseDirectory() {
        return System.getProperty("user.dir");

    }
    public static String relativize (String otherDirectory, ResourceBundle myResources) {
        Path base = Paths.get(getBaseDirectory());
        Path other = Paths.get(otherDirectory);
        try {
            return base.relativize(other).toString();
        } catch (IllegalArgumentException e) {
            boolean inner = new File(base.toString(), other.toString()).exists();
            if (inner) {
                return otherDirectory;
            }
            throw new IllegalArgumentException("Relativize problem");
        }
    }

}

@@ -125,39 +125,8 @@
 e;%0A%0A
-import view.utilities.Alerts;%0A%0A
 /**%0A

remove import