Examples of IStorage


Examples of org.maqetta.server.IStorage

   * @see org.davinci.server.user.IUser#getWorkbenchSettings(java.lang.String)
   */
  public IStorage getWorkbenchSettings(String base) throws IOException {
 
   
    IStorage baseFile = userDirectory.newInstance(this.userDirectory,base);
    IStorage settingsDirectory = userDirectory.newInstance(baseFile,IDavinciServerConstants.SETTINGS_DIRECTORY_NAME);
    if(!isValid(settingsDirectory.getAbsolutePath())) return null;
   
    if(!settingsDirectory.exists())
      settingsDirectory.mkdirs();
   

    return settingsDirectory;
  }
View Full Code Here

Examples of org.maqetta.server.IStorage

  public void copyDirectory(IStorage sourceDir, IStorage destinationDir) throws IOException {
    destinationDir.mkdirs();
    IStorage[] file = sourceDir.listFiles();
    for (int i = 0; i < file.length; i++) {
      if (file[i].isFile()) {
        IStorage sourceFile = file[i];

        IStorage targetFile = destinationDir.newInstance(destinationDir, file[i].getName());
        copyFile(sourceFile, targetFile);
      }

      if (file[i].isDirectory()) {
        IStorage destination = destinationDir.newInstance(destinationDir, file[i].getName());
        copyDirectory(file[i], destination);
      }
    }
  }
View Full Code Here

Examples of org.maqetta.server.IStorage

    public void handleCommand(HttpServletRequest req, HttpServletResponse resp, IUser user) throws IOException {
        String id = req.getParameter("id");
        String base = req.getParameter("base");
       
        IStorage settingsDir = user.getWorkbenchSettings(base);
        IStorage settingsFile = settingsDir.newInstance(settingsDir, id + IDavinciServerConstants.SETTINGS_EXTENSION);
       
        if(! user.isValid(settingsFile.getAbsolutePath()) ) return;
       
        if (!settingsFile.exists()) {
            settingsFile.createNewFile();
        }
        OutputStream os = new BufferedOutputStream(settingsFile.getOutputStream());
        Command.transferStreams(req.getInputStream(), os, false);
    }
View Full Code Here

Examples of org.maqetta.server.IStorage

    this.projectName = projectName;
  }

  public IStorage getCommentsFileStorage() throws IOException {
    IDesignerUser ru = ReviewManager.getReviewManager().getDesignerUser(ownerId);
    IStorage commentingDir = ru.getCommentingDirectory();
    IStorage commentsFileStorage = commentingDir.newInstance(commentingDir, "snapshot/comments.xml");
    return commentsFileStorage;
  }
View Full Code Here

Examples of org.maqetta.server.IStorage

   * lang.String)
   */
  public void deleteVersion(String versionTime) throws IOException {
    Version version = this.getVersion(versionTime);
    versions.remove(version);
    IStorage versionDir = this.userDirectory.newInstance(
        this.getCommentingDirectory(), "snapshot/" + versionTime);
    if (versionDir.exists()) {
      deleteDir(versionDir);
    }
  }
View Full Code Here

Examples of org.maqetta.server.IStorage

        }
        return password.equals(person.password);
    }

    protected void loadUsers() {
      IStorage baseDirectory = getBaseDirectory();
        IStorage userFile = baseDirectory.newInstance(baseDirectory, IDavinciServerConstants.USER_LIST_FILE);
        if (userFile.exists()) {
            new UsersFile().load(userFile);

        }
    }
View Full Code Here

Examples of org.maqetta.server.IStorage

        }
    }

    protected void savePersons() throws IOException {
      IStorage baseDirectory = getBaseDirectory();
        IStorage userFile = baseDirectory.newInstance(baseDirectory, IDavinciServerConstants.USER_LIST_FILE);
        new UsersFile().save(userFile, this.persons.values());
    }
View Full Code Here

Examples of org.maqetta.server.IStorage

            return;
        }
        /*
         * would call this.personManager.removePerson(userName) here
         */
        IStorage userDir = this.baseDirectory.newInstance(this.baseDirectory, userName);
        VResourceUtils.deleteDir(userDir);
    
        this.usersCount--;
    }
View Full Code Here

Examples of org.maqetta.server.IStorage

        }
        return null;
    }

    protected boolean checkUserExists(String userName) {
        IStorage userDir = this.baseDirectory.newInstance(this.baseDirectory, userName);
        return userDir.exists();
    }
View Full Code Here

Examples of org.maqetta.server.IStorage

                public String getDisplayName() {
                  return "";
                }
            }

          IStorage userDir = this.baseDirectory;
            userDir.mkdir();

            localUser = new User(new LocalPerson(), userDir);
             IStorage settingsDir = this.baseDirectory.newInstance(userDir, IDavinciServerConstants.SETTINGS_DIRECTORY_NAME);
            if (!settingsDir.exists()) {
                 settingsDir.mkdir();
                localUser.createProject(IDavinciServerConstants.DEFAULT_PROJECT);
            }
        } catch (IOException e) {
          return null; //TODO
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.