Преглед на файлове

again small change because of windows

Teh-Hai Julian Zheng преди 7 години
родител
ревизия
5e9b68d678
променени са 1 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 2 3
      src/ui/controller/SaveController.java

+ 2 - 3
src/ui/controller/SaveController.java

@@ -271,7 +271,6 @@ public class SaveController {
 	 */
 	private void storeData(ArchiveOutputStream stream) throws IOException {
 		// TODO Auto-generated method stub
-		System.out.println(System.getProperty("user.home"));
 		File images = new File(System.getProperty("user.home") + "/HolonGUI/Images");
 		File background = new File(System.getProperty("user.home") + "/HolonGUI/BackgroundImages");
 		addFilesToSave(images, stream);
@@ -428,9 +427,9 @@ public class SaveController {
 	 */
 	private void addFileToSave(File src, ArchiveOutputStream stream, boolean dir) throws IOException {
 		String entryName = (dir == true ? src.getCanonicalPath() : src.getName());
-		entryName = entryName.replace("C:", "");
+		String partition = entryName.substring(0, entryName.indexOf(":"));
+		entryName = entryName.replace(partition, "");
 		entryName = entryName.replace(System.getProperty("user.home") + "/HolonGUI/", "");
-		
 
 		ZipArchiveEntry entry = new ZipArchiveEntry(entryName);
 		stream.putArchiveEntry(entry);