/**
  * DOC mhelleboid Comment method "getTempFolder".
  *
  * @param project TODO
  * @return
  */
 private IPath getTempFolderPath(Project project) {
   IProject iProject;
   IFolder iFolder = null;
   try {
     iProject = ResourceModelHelper.getProject(project);
     iFolder = ResourceUtils.getFolder(iProject, RepositoryConstants.TEMP_DIRECTORY, false);
     if (!iFolder.exists()) {
       ResourceUtils.createFolder(iFolder);
     }
   } catch (PersistenceException e) {
     // e.printStackTrace();
     ExceptionHandler.process(e);
   }
   return iFolder.getFullPath();
 }
Пример #2
0
 protected Object getFullFolder(Project project, ERepositoryObjectType itemType, String path)
     throws PersistenceException {
   Object folder = getFolder(project, itemType);
   if (folder == null) {
     return null;
   }
   Object fullFolder;
   if (folder instanceof IFolder) {
     fullFolder = getFolder(project, itemType);
     if (path != null && !"".equals(path)) { // $NON-NLS-1$
       fullFolder = ((IFolder) fullFolder).getFolder(new Path(path));
     }
   } else {
     // FolderItem
     if (path != null && !"".equals(path)) { // $NON-NLS-1$
       // MOD mzhao feature 9207
       if (folder == null) {
         fullFolder = ResourceUtils.getProject(project).getFolder(new Path(path));
       } else {
         fullFolder =
             this.getFolderHelper(project.getEmfProject())
                 .getFolder(
                     ((FolderItem) folder).getProperty().getLabel() + "/" + path); // $NON-NLS-1$
       }
     } else {
       fullFolder = folder;
     }
   }
   return fullFolder;
 }
Пример #3
0
  @Override
  public RootContainer<String, IRepositoryViewObject> getRoutineFromProject(Project project)
      throws PersistenceException {
    RootContainer<String, IRepositoryViewObject> toReturn =
        new RootContainer<String, IRepositoryViewObject>();
    ERepositoryObjectType type = ERepositoryObjectType.ROUTINES;
    if (type != null) {
      IProject fsProject = ResourceUtils.getProject(project);

      IFolder objectFolder =
          ResourceUtils.getFolder(fsProject, ERepositoryObjectType.getFolderName(type), true);

      addFolderMembers(project, type, toReturn, objectFolder, true);
      saveProject(project);
    }
    return toReturn;
  }