@@ -0,0 +1,1351 @@
+package otanga;%0A%0A/**%0A * Created with IntelliJ IDEA.%0A * User: cedric%0A * Date: 5/10/13%0A * Time: 12:59 PM%0A * To change this template use File %7C Settings %7C File Templates.%0A */%0Aimport com.google.appengine.api.files.AppEngineFile;%0Aimport com.google.appengine.api.files.FileReadChannel;%0Aimport com.google.appengine.api.files.FileService;%0Aimport com.google.appengine.api.files.FileServiceFactory;%0Aimport com.google.appengine.api.files.FileWriteChannel;%0Aimport com.google.appengine.api.files.GSFileOptions.GSFileOptionsBuilder;%0A%0A%0Aimport org.apache.commons.fileupload.*;%0A%0Aimport java.io.IOException;%0Aimport java.util.UUID;%0A%0Apublic class FileStorage %7B%0A    // Get the file service%0A    private final static FileService fileService = FileServiceFactory.getFileService();%0A%0A    private FileStorage() %7B%7D%0A%0A    public UUID storeImage()%7B%0A        UUID key = UUID.randomUUID();%0A        GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()%0A            .setBucket(%22images%22)%0A            .setKey(key.toString())%0A            .setAcl(%22private%22);%0A%0A        // Create your object%0A%0A        try %7B%0A            AppEngineFile writableFile = fileService.createNewGSFile(optionsBuilder.build());%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();  //To change body of catch statement use File %7C Settings %7C File Templates.%0A        %7D%0A%0A        return key;%0A    %7D%0A%7D%0A

initialize filestorage