Browse Source

again small change because of windows

Teh-Hai Julian Zheng 7 years ago
parent
commit
5e9b68d678
1 changed files with 2 additions and 3 deletions
  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);