package com.google.sps.data;

import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;

public final class Folder {

    private String folderName;
    private String folderDefaultLanguage;
    private String folderKey;
    private String parentKey;

    public Folder(
        String folderName,
        String folderDefaultLanguage) {
        
        this.folderName = folderName;
        this.folderDefaultLanguage = folderDefaultLanguage;
        this.folderKey = "null";
    }

    public Folder(Entity entity) {
        this.folderName = (String) entity.getProperty("folderName");
        this.folderDefaultLanguage = (String) entity.getProperty("folderDefaultLanguage");
        this.folderKey = (String) entity.getProperty("folderKey");
    }

    public String getFolderName() {
        return this.folderName;
    }

    public String getFolderDefaultLanguage() {
        return this.folderDefaultLanguage;
    }

    public String getFolderKey() {
        return this.folderKey;
    }

    public void setFolderName(String newFolderName) {
        this.folderName = newFolderName;
    }

    public void setFolderKey(String folderKey) {
        this.folderKey = folderKey;
    }

    public void setParentKey(String key) {
        parentKey = key;
    }

    public Entity createEntity() {
        // Set owner of folder 
        Entity folder = new Entity("Folder", KeyFactory.stringToKey(parentKey));

        folder.setProperty("folderName", this.folderName);
        folder.setProperty("folderDefaultLanguage", this.folderDefaultLanguage);

        return folder;
    }
}
@@ -331,18 +331,16 @@
 lder %7B%0A%0A
-  
   privat
@@ -360,18 +360,16 @@
 erName;%0A
-  
   privat
@@ -400,18 +400,16 @@
 nguage;%0A
-  
   privat
@@ -428,18 +428,16 @@
 derKey;%0A
-  
   privat
@@ -457,18 +457,16 @@
 ntKey;%0A%0A
-  
   public
@@ -474,20 +474,16 @@
 Folder(%0A
-    
     Stri
@@ -501,20 +501,16 @@
 me,%0A    
-  
-  
 String f
@@ -541,21 +541,13 @@
     
-    %0A  
+%0A
     
-  
 this
@@ -572,20 +572,16 @@
 erName;%0A
-    
     this
@@ -628,28 +628,24 @@
 nguage;%0A    
- 
-   
 this.folderK
@@ -655,31 +655,27 @@
 = %22null%22;%0A  
- 
- 
 %7D%0A%0A
-  
   public Fol
@@ -691,36 +691,32 @@
 y entity) %7B%0A    
- 
-   
 this.folderName 
@@ -756,28 +756,24 @@
 lderName%22);%0A
-    
     this.fol
@@ -847,28 +847,24 @@
 uage%22);%0A    
- 
-   
 this.folderK
@@ -910,25 +910,21 @@
 rKey%22);%0A
-  
   %7D%0A%0A
-  
   public
@@ -945,36 +945,32 @@
 derName() %7B%0A    
- 
-   
 return this.fold
@@ -973,33 +973,29 @@
 folderName;%0A
-  
   %7D%0A%0A
-  
   public Str
@@ -1023,28 +1023,24 @@
 anguage() %7B%0A
-    
     return t
@@ -1066,25 +1066,21 @@
 nguage;%0A
-  
   %7D%0A%0A
-  
   public
@@ -1100,28 +1100,24 @@
 lderKey() %7B%0A
-    
     return t
@@ -1127,33 +1127,29 @@
 .folderKey;%0A
-  
   %7D%0A%0A
-  
   public voi
@@ -1184,28 +1184,24 @@
 lderName) %7B%0A
-    
     this.fol
@@ -1225,25 +1225,21 @@
 erName;%0A
-  
   %7D%0A%0A
-  
   public
@@ -1273,28 +1273,24 @@
 olderKey) %7B%0A
-    
     this.fol
@@ -1305,35 +1305,31 @@
  folderKey;%0A
-  
   %7D%0A%0A  
- 
- 
 public void 
@@ -1351,28 +1351,24 @@
 ring key) %7B%0A
-    
     parentKe
@@ -1380,19 +1380,15 @@
 ey;%0A
-  
   %7D%0A%0A  
- 
- 
 publ
@@ -1414,20 +1414,16 @@
 ity() %7B%0A
-    
     // S
@@ -1446,20 +1446,16 @@
 er %0A    
-   
- 
 Entity f
@@ -1516,28 +1516,24 @@
 rentKey));%0A%0A
-    
     folder.s
@@ -1579,20 +1579,16 @@
 e);%0A    
-   
- 
 folder.s
@@ -1653,20 +1653,16 @@
 uage);%0A%0A
-    
     retu
@@ -1672,15 +1672,13 @@
 folder;%0A
-  
   %7D%0A%7D

Make indent 2 spaces