Class DirectoryResource
- java.lang.Object
-
- org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
-
- org.pentaho.platform.web.http.api.resources.DirectoryResource
-
public class DirectoryResource extends AbstractJaxRSResource
This resource manages folders in the repository and provides methods for creating new folders.
-
-
Field Summary
Fields Modifier and Type Field Description protected FileService
fileService
-
Fields inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
acceptableMediaTypes, httpServletRequest, httpServletResponse, TEXT_HTML
-
-
Constructor Summary
Constructors Constructor Description DirectoryResource()
DirectoryResource(javax.servlet.http.HttpServletResponse httpServletResponse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
createDirs(String pathId)
Creates a new folder with the specified name.javax.ws.rs.core.Response
getDefaultLocation(String pathId)
Checks to see if the current user is an administer of the platform and returns a boolean response.javax.ws.rs.core.Response
isDirVisible(String pathId)
Determines whether a current user has permission to see the folder or not-
Methods inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
setHttpHeaders
-
-
-
-
Field Detail
-
fileService
protected FileService fileService
-
-
Method Detail
-
createDirs
public javax.ws.rs.core.Response createDirs(String pathId)
Creates a new folder with the specified name.Example Request:
PUT pentaho/api/repo/dirs/home
PUT data:This PUT body does not contain data.
- Parameters:
pathId
- The path from the root folder to the root node of the tree to return using colon characters in place of / or \ characters. To clarify /path/to/file, the encoded pathId would be :path:to:file.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
couldNotCreateFolderDuplicate
-
isDirVisible
public javax.ws.rs.core.Response isDirVisible(String pathId)
Determines whether a current user has permission to see the folder or notExample Request:
GET pentaho/api/repo/dirs/home/isVisible- Parameters:
pathId
- The path from the root folder to the root node of the tree to return using colon characters in place of / or \ characters. To clarify /path/to/file, the encoded pathId would be :path:to:file.- Returns:
- String "true" if the folder is visible to the current user, or "false" otherwise.
Example Response:
true
-
getDefaultLocation
public javax.ws.rs.core.Response getDefaultLocation(String pathId)
Checks to see if the current user is an administer of the platform and returns a boolean response.Example Request:
GET pentaho/api/repo/dirs/home/defaultSaveLocation- Returns:
- path for a default save location.
Example Response:
/public
-
-