package de.prob2.ui.project;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

public class Machine {
	private String name;
	private String description;
	private List<String> preferences;
	private String location;
	
	public Machine(String name, String description, List<String> preferences, Path location) {
		this.name = name;
		this.description = description;
		this.preferences = preferences;
		this.location = location.toString();
	}
	
	public Machine(String name, String description, Path location) {
		this.name = name;
		this.description = description;
		this.location = location.toString();
		this.preferences = new ArrayList<>();
	}
	
	public String getName() {
		return name;
	}
	
	public String getFileName() {
		String[] s = location.split(File.separator);
		return s[s.length-1];
	}
	
	public String getDescription() {
		return description;
	}
	
	public List<String> getPreferences() {
		return preferences;
	}
	
	public Path getPath() {
		return Paths.get(location);
	}
	
	@Override
	public String toString() {
		return this.name;
	}
}

@@ -149,16 +149,48 @@
 il.List;
+%0Aimport java.util.regex.Pattern;
 %0A%0Apublic
@@ -838,59 +838,169 @@
 ring
-%5B%5D s = location.split(File.separator);%0A%09%09return s%5Bs
+ pattern = Pattern.quote(System.getProperty(%22file.separator%22));%0A%09%09String%5B%5D splittedFileName = location.split(pattern);%0A%09%09return splittedFileName%5BsplittedFileName
 .len

fix edit file in win10