Package org.eclipse.orion.internal.server.servlets.workspace

Examples of org.eclipse.orion.internal.server.servlets.workspace.WebWorkspace


  }

  public WebWorkspace createWorkspace(String workspaceName) throws CoreException {
    // see org.eclipse.orion.server.servlets.WorkspaceServlet.doCreateWorkspace()
    WebWorkspace workspace =  webuser.createWorkspace(workspaceName);
    URI loc = URI.create(Activator.LOCATION_WORKSPACE_SERVLET);
    JSONObject result = WorkspaceResourceHandler.toJSON(workspace, loc, loc);
    String resultLocation = result.optString(ProtocolConstants.KEY_LOCATION);

    // add user rights for the workspace
    AuthorizationService.addUserRight(this.getUserID(), URI.create(resultLocation).getPath());
    AuthorizationService.addUserRight(this.getUserID(), URI.create(resultLocation).getPath() + "/*"); //$NON-NLS-1$
    // add user rights for file servlet location
    String filePath = Activator.LOCATION_FILE_SERVLET + '/' + workspace.getId();
    AuthorizationService.addUserRight(this.getUserID(), filePath);
    AuthorizationService.addUserRight(this.getUserID(), filePath + "/*"); //$NON-NLS-1$

    return workspace;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.orion.internal.server.servlets.workspace.WebWorkspace

Copyright © 2018 www.massapicom. 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.