Exemplo n.º 1
0
 public void saveAll() throws IOException {
   PhotoCaseManager.getInstance().savePhotoCases();
   // PhotoManager.getInstance().savePhotos();
   DrumcymbalPhotoManager.getInstance().savePhotos();
   UserManager.getInstance().saveClients();
   GlobalsManager.getInstance().saveGlobals();
 }
Exemplo n.º 2
0
  protected void startUp(String rootDir) throws Exception {
    super.startUp(rootDir);
    log.info("AbstractMain.startUp completed");

    log.config(LogBuilder.createSystemMessage().addAction("load image storage").toString());
    // GcsAdapter.Builder gcsAdapterBuilder = new GcsAdapter.Builder();
    ImageStorage.setInstance(new DatastoreAdapter());

    log.config(LogBuilder.createSystemMessage().addAction("load globals").toString());
    GlobalsManager.getInstance().loadGlobals();

    log.config(LogBuilder.createSystemMessage().addAction("load user").toString());
    UserManager.getInstance().init();

    log.config(LogBuilder.createSystemMessage().addAction("init PhotoFactory").toString());
    DrumcymbalPhotoFactory.initialize();
    CoordinateFactory.initialize();

    log.config(LogBuilder.createSystemMessage().addAction("load Photos").toString());
    // PhotoManager.getInstance().init();
    DrumcymbalPhotoManager.getInstance().init();
  }
Exemplo n.º 3
0
  protected void createUser(String userId, String nickName, String emailAddress, String photoDir)
      throws Exception {
    UserManager userManager = UserManager.getInstance();
    new User(userId, nickName, emailAddress);

    // PhotoManager photoManager = PhotoManager.getInstance();
    PhotoManager photoManager = DrumcymbalPhotoManager.getInstance();
    File photoDirFile = new File(photoDir);
    FileFilter photoFileFilter =
        new FileFilter() {
          public boolean accept(File file) {
            // TODO: check and change
            return file.getName().endsWith(".jpg");
          }
        };

    File[] photoFiles = photoDirFile.listFiles(photoFileFilter);
    for (int i = 0; i < photoFiles.length; i++) {
      // TODO: change to datastore/cloud storage
      // Photo newPhoto = photoManager.createPhoto(photoFiles[i]);
      // user.addPhoto(newPhoto);
    }
  }