Class FileResource
- Author:
- aaron
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected FileServiceprotected static final org.apache.commons.logging.Logprotected org.pentaho.platform.api.mimetype.IPlatformMimeResolverprotected static org.pentaho.platform.api.engine.IAuthorizationPolicyprotected static org.pentaho.platform.api.repository2.unified.IUnifiedRepositorystatic final Stringprotected static org.pentaho.platform.repository2.unified.webservices.DefaultUnifiedRepositoryWebServiceprotected org.pentaho.platform.repository.RepositoryDownloadWhitelistFields inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
acceptableMediaTypes, httpServletRequest, httpServletResponse, TEXT_HTML -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.ResponsebuildOkResponse(Object o, String s) protected jakarta.ws.rs.core.ResponsebuildOkResponse(String msg) protected jakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.ResponsebuildStatusResponse(jakarta.ws.rs.core.Response.Status status) protected jakarta.ws.rs.core.Responsejakarta.ws.rs.core.ResponsecanDownload(String dirPath) Validates if a current user is authorized to download content from the given dir.jakarta.ws.rs.core.ResponseValidates if a current user is authorized to upload content to the given dir.jakarta.ws.rs.core.ResponsecreateFile(String pathId, InputStream fileContents) Creates a new file with the provided contents at a given path.jakarta.ws.rs.core.ResponsedoCopyFiles(String pathId, Integer mode, String params) Copy selected list of files to a new specified location.jakarta.ws.rs.core.ResponsedoCreateDirs(String pathId) Creates a new folder with the specified name.jakarta.ws.rs.core.ResponsedoDeleteFiles(String params) Move a list of files to the user's trash folder.jakarta.ws.rs.core.ResponsedoDeleteFilesPermanent(String params) Permanently deletes the selected list of files from the repository.jakarta.ws.rs.core.ResponsedoDeleteLocale(String pathId, String locale) Delete the locale for the selected file.jakarta.ws.rs.core.ResponsedoesFileExists(String pathId) Checks if a file exists at the specified path in the repository.doGetCanAccess(String pathId, String permissions) Check whether the current user has specific permission on the selected repository file.doGetCanAccessList(String pathId, String permissions) Checks whether the current user has permissions to the selected files.Checks to see if the current user is an administer of the platform and returns a boolean response.Checks the users permission to determine if that user can create new content in the repository.Checks the users permission to determine if that user can edit an existing content in the repository.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapperdoGetChildren(String pathId, String filter, Boolean showHidden, Boolean includeAcls) Retrieve a list of child files from the selected repository path of the repository.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtodoGetContentCreator(String pathId) Retrieves the file by creator idorg.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapperRetrieve the list of files in the user's trash folder.jakarta.ws.rs.core.ResponsedoGetDirAsZip(String pathId) jakarta.ws.rs.core.ResponsedoGetDirAsZip(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile) org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileAclDtodoGetFileAcl(String pathId) Retrieves the ACL settings of the requested repository file in either xml or json format.jakarta.ws.rs.core.ResponsedoGetFileAsInline(String pathId) Retrieves the file from the repository as inline.org.pentaho.platform.api.repository2.unified.webservices.LocaleMapDtoWrapperdoGetFileLocales(String pathId) Retrieves the list of locale maps for the selected repository file.jakarta.ws.rs.core.ResponsedoGetFileOrDir(String pathId) Takes a pathId and returns a Response with the output stream based on the file located at the pathId.jakarta.ws.rs.core.ResponsedoGetFileOrDirAsDownload(String userAgent, String pathId, String strWithManifest) Download the selected file or folder from the repository.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapperdoGetGeneratedContent(String pathId) Retrieve the list of executed contents for a selected content from the repository.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapperdoGetGeneratedContentForUser(String pathId, String user) Retrieve the executed contents for a selected repository file and a given user.org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDtoWrapperdoGetLocaleProperties(String pathId, String locale) Retrieve the list of locale properties for a given locale.org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDtoWrapperdoGetMetadata(String pathId) Retrieve the metadata of the selected file.doGetPathsAccessList(StringListWrapper pathsWrapper) Checks whether the current user has permissions to the provided list of paths.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtodoGetProperties(String pathId) Retrieves the properties of a selected repository file.jakarta.ws.rs.core.ResponseReturns the list of reserved characters from the repository.jakarta.ws.rs.core.ResponseReturns the list of reserved characters from the repository.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapperdoGetRootChildren(String filter, Boolean showHidden, Boolean includeAcls) Retrieve a list of child files from the root of the repository.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoRetrieves the properties of the root directory.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileTreeDtodoGetRootTree(Integer depth, String filter, Boolean showHidden, Boolean includeAcls) Retrieve the recursive list of files from root of the repository based on the filters provided.org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileTreeDtodoGetTree(String pathId, Integer depth, String filter, Boolean showHidden, Boolean includeAcls, Boolean includeSystemFolders) Retrieve the recursive list of children of the selected repository file.doIsParameterizable(String pathId) Determines whether a selected file supports parameters or notjakarta.ws.rs.core.ResponseMoves a list of files from its current location to another.jakarta.ws.rs.core.ResponseRename the selected file.jakarta.ws.rs.core.ResponseRestores a list of files from the user's trash folder to their previous locations.jakarta.ws.rs.core.ResponsedoSetContentCreator(String pathId, StreamSource contentCreatorXml) Store content creator for the given path of created content.jakarta.ws.rs.core.ResponsedoSetContentCreator(String pathId, org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDto contentCreator) Store content creator for the given path of created content.jakarta.ws.rs.core.ResponsedoSetLocaleProperties(String pathId, String locale, List<org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDto> properties) Save list of locale properties for a given locale.jakarta.ws.rs.core.ResponsedoSetMetadata(String pathId, org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDtoWrapper metadata) Store the metadata of the selected file.org.pentaho.platform.repository2.unified.webservices.FileVersioningConfigurationdoVersioningConfiguration(String pathId) This method is used to determine whether versioning should be active for the given pathprotected Stringprotected ByteArrayOutputStreamprotected org.pentaho.platform.api.engine.IContentGeneratorgetContentGenerator(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile) protected Exporterprotected FileInputStreamgetFileInputStream(File file) protected Messagesstatic org.pentaho.platform.api.engine.IAuthorizationPolicystatic org.pentaho.platform.api.repository2.unified.IUnifiedRepositorystatic org.pentaho.platform.repository2.unified.webservices.DefaultUnifiedRepositoryWebServiceprotected XMLStreamReadergetSecureXmlStreamReader(StreamSource xmlSource) protected org.pentaho.platform.api.engine.IPentahoSessionprotected org.pentaho.platform.engine.core.solution.SimpleParameterProviderprotected jakarta.ws.rs.core.StreamingOutputprotected jakarta.xml.bind.UnmarshallergetUnmarshaller(Class<?> clazz) protected Stringorg.pentaho.platform.repository.RepositoryDownloadWhitelistprotected booleanhasParameterUi(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile) static Stringprotected booleanisPathValid(String path) protected org.dom4j.DocumentvoidsetConverterHandler(org.pentaho.platform.api.repository2.unified.IRepositoryContentConverterHandler converterHandler) jakarta.ws.rs.core.ResponsesetFileAcls(String pathId, StreamSource aclXml) This method is used to update and save the acls of the selected file to the repository.jakarta.ws.rs.core.ResponsesetFileAcls(String pathId, org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileAclDto acl) This method is used to update and save the acls of the selected file to the repository.voidsetMimeResolver(org.pentaho.platform.api.mimetype.IPlatformMimeResolver mimeResolver) voidsetWhitelist(org.pentaho.platform.repository.RepositoryDownloadWhitelist whitelist) jakarta.ws.rs.core.ResponsesystemBackup(jakarta.ws.rs.core.MultivaluedMap<String, String> formParams) Performs a system back up of the Pentaho system.jakarta.ws.rs.core.ResponsesystemRestore(InputStream fileUpload, String overwriteFile, String applyAclSettings, String overwriteAclSettings, String logFile, String logLevel, String backupBundlePath) Performs a system restore of the Hitachi Vantara system.Methods inherited from class org.pentaho.platform.web.http.api.resources.AbstractJaxRSResource
setHttpHeaders
-
Field Details
-
APPLICATION_ZIP
- See Also:
-
REPOSITORY_ADMIN_USERNAME
- See Also:
-
logger
protected static final org.apache.commons.logging.Log logger -
fileService
-
whitelist
protected org.pentaho.platform.repository.RepositoryDownloadWhitelist whitelist -
repository
protected static org.pentaho.platform.api.repository2.unified.IUnifiedRepository repository -
repoWs
protected static org.pentaho.platform.repository2.unified.webservices.DefaultUnifiedRepositoryWebService repoWs -
policy
protected static org.pentaho.platform.api.engine.IAuthorizationPolicy policy -
mimeResolver
protected org.pentaho.platform.api.mimetype.IPlatformMimeResolver mimeResolver
-
-
Constructor Details
-
FileResource
public FileResource() -
FileResource
public FileResource(jakarta.servlet.http.HttpServletResponse httpServletResponse)
-
-
Method Details
-
idToPath
-
systemBackup
@POST @Path("/backup") @Consumes("application/x-www-form-urlencoded") public jakarta.ws.rs.core.Response systemBackup(jakarta.ws.rs.core.MultivaluedMap<String, String> formParams) Performs a system back up of the Pentaho system. This includes content, schedules, users, roles, datasources, and the metastore.Example Request:
GET pentaho/api/repo/files/backup- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
Encrypted file stream
-
systemRestore
@POST @Path("/systemRestore") @Consumes("multipart/form-data") public jakarta.ws.rs.core.Response systemRestore(InputStream fileUpload, String overwriteFile, String applyAclSettings, String overwriteAclSettings, String logFile, String logLevel, String backupBundlePath) Performs a system restore of the Hitachi Vantara system. This includes content, schedules, users, roles, datasources, and the metastore.Example Request:
POST pentaho/api/repo/files/systemRestore- Parameters:
fileUpload- The zip file generated using the backup endpoint, used to do a full system restore.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
-
doDeleteFiles
@PUT @Path("/delete") @Consumes("*/*") public jakarta.ws.rs.core.Response doDeleteFiles(String params) Move a list of files to the user's trash folder.Example Request:
PUT pentaho/api/repo/files/deleteImportant Note: This end-point is not intended for concurrent execution by the same user or session. It facilitates the User Console deletion UI, and should not be used in a manner inconsistent with how that UI operates.
- Parameters:
params- Comma separated list of the files to be moved to trash folder.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
-
doDeleteFilesPermanent
@PUT @Path("/deletepermanent") @Consumes("*/*") public jakarta.ws.rs.core.Response doDeleteFilesPermanent(String params) Permanently deletes the selected list of files from the repository.Example Request:
PUT pentaho/api/repo/files/deletepermanentImportant Note: This end-point is not intended for concurrent execution by the same user or session. It facilitates the User Console deletion UI, and should not be used in a manner inconsistent with how that UI operates.
- Parameters:
params- Comma separated list of the files to be deleted.- Returns:
- Server Response indicating the success of the operation.
-
doMove
@PUT @Path("{pathId : .+}/move") @Consumes("*/*") public jakarta.ws.rs.core.Response doMove(@PathParam("pathId") String destPathId, String params) Moves a list of files from its current location to another.Example Request:
PUT pentaho/api/repo/files/{pathId}/move- Parameters:
destPathId- Colon separated path for the destination path.params- Comma separated list of files to be moved.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
-
doRestore
@PUT @Path("/restore") @Consumes("*/*") public jakarta.ws.rs.core.Response doRestore(String params, @QueryParam("overwriteMode") Integer mode) Restores a list of files from the user's trash folder to their previous locations.Example Request:
PUT pentaho/api/repo/files/restore - restore files to original location PUT pentaho/api/repo/files/restore?overwriteMode=2 - restore files to user home folder, RENAME mode- Parameters:
params- comma separated list of file ids to be restored.mode- needed only when restoring files to user home folder, representing which type of overwrite mode to use. Can be one of this values: MODE_OVERWRITE (1) - will just replace existing RENAME (2) - adds a number to the end of the file name. MODE_NO_OVERWRITE (3) - will not overwrite if file exist. null - no overwrite mode
-
createFile
@PUT @Path("{pathId : .+}") @Consumes("*/*") public jakarta.ws.rs.core.Response createFile(@PathParam("pathId") String pathId, InputStream fileContents) Creates a new file with the provided contents at a given path.Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml
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.fileContents- An Input Stream with the contents of the file to be created.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
This response does not contain data.
-
doCopyFiles
@PUT @Path("{pathId : .+}/children") @Consumes("text/plain") public jakarta.ws.rs.core.Response doCopyFiles(@PathParam("pathId") String pathId, @QueryParam("mode") Integer mode, String params) Copy selected list of files to a new specified location.Example Request:
PUT pentaho/api/repo/files/{pathId}/children?mode=2- Parameters:
pathId- Colon separated path for the destination for files to be copied.mode- Default is RENAME (2) which adds a number to the end of the file name. MODE_OVERWRITE (1) will just replace existing or MODE_NO_OVERWRITE (3) will not copy if file exist.params- Comma separated list of file ids to be copied.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
-
doGetFileOrDir
@GET @Path("{pathId : .+}") @Produces("*/*") public jakarta.ws.rs.core.Response doGetFileOrDir(@PathParam("pathId") String pathId) Takes a pathId and returns a Response with the output stream based on the file located at the pathId.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml- Parameters:
pathId- Colon separated path for the repository file.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
This response does not contain data.
-
doesFileExists
@GET @Path("/exists") public jakarta.ws.rs.core.Response doesFileExists(@QueryParam("pathId") String pathId) Checks if a file exists at the specified path in the repository.Example Request:
GET pentaho/api/repo/exists?pathId=%2Fhome%2Fuser%2Ftest_file.wtr- Parameters:
pathId- Encoded path of the repository file to check. Must be URL-encoded.- Returns:
- A jax-rs Response object with the appropriate status code
-
doGetDirAsZip
-
doGetDirAsZip
public jakarta.ws.rs.core.Response doGetDirAsZip(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile) - Parameters:
repositoryFile-- Returns:
-
doIsParameterizable
@GET @Path("{pathId : .+}/parameterizable") @Produces("text/plain") public String doIsParameterizable(@PathParam("pathId") String pathId) throws FileNotFoundException Determines whether a selected file supports parameters or not- Parameters:
pathId- Colon separated path for the repository file.- Returns:
- (" true " or " false ")
- Throws:
FileNotFoundException
-
doGetFileOrDirAsDownload
@GET @Path("{pathId : .+}/download") @Produces("*/*") public jakarta.ws.rs.core.Response doGetFileOrDirAsDownload(@HeaderParam("user-agent") String userAgent, @PathParam("pathId") String pathId, @QueryParam("withManifest") String strWithManifest) Download the selected file or folder from the repository. In order to download file from the repository, the user needs to have Publish action. How the file comes down to the user and where it is saved is system and browser dependent.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/download?locale=de- Parameters:
userAgent- A string representing the type of browser to use. Currently only applicable if contains 'FireFox' as FireFox requires a header with encoding information (UTF-8) and a quoted filename, otherwise encoding information is not supplied and the filename is not quoted.pathId- Colon separated path for the repository file.strWithManifest- true or false (download file with manifest). Defaults to true (include manifest) if this string can't be directly parsed to 'false' (case sensitive). This argument is only used if a directory is being downloaded.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
Encrypted file stream
-
doGetFileAsInline
@GET @Path("{pathId : .+}/inline") @Produces("*/*") public jakarta.ws.rs.core.Response doGetFileAsInline(@PathParam("pathId") String pathId) Retrieves the file from the repository as inline. This is mainly used for css and dependent files for the html document.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/inline- Parameters:
pathId- Colon separated path for the repository file.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><repositoryFileAclDto><entriesInheriting>true</entriesInheriting><id>d45d4972-989e-48d5-8bd0-f7024a77f08f</id><owner>admin</owner><ownerType>0</ownerType></repositoryFileAclDto>
-
setFileAcls
@PUT @Path("{pathId : .+}/acl") @Consumes("application/xml") public jakarta.ws.rs.core.Response setFileAcls(@PathParam("pathId") String pathId, StreamSource aclXml) This method is used to update and save the acls of the selected file to the repository.Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/acl
PUT data:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><repositoryFileAclDto><entriesInheriting>true</entriesInheriting><id>d45d4972-989e-48d5-8bd0-f7024a77f08f</id><owner>admin</owner><ownerType>0</ownerType></repositoryFileAclDto>- Parameters:
pathId- Colon separated path for the repository file.aclXml- Acl of the repository file RepositoryFileAclDto.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
This response does not contain data.
-
setFileAcls
@PUT @Path("{pathId : .+}/acl") @Consumes("application/json") public jakarta.ws.rs.core.Response setFileAcls(@PathParam("pathId") String pathId, org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileAclDto acl) This method is used to update and save the acls of the selected file to the repository.Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/acl
PUT data:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><repositoryFileAclDto><entriesInheriting>true</entriesInheriting><id>d45d4972-989e-48d5-8bd0-f7024a77f08f</id><owner>admin</owner><ownerType>0</ownerType></repositoryFileAclDto>- Parameters:
pathId- Colon separated path for the repository file.acl- Acl of the repository file RepositoryFileAclDto.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
This response does not contain data.
-
getSecureXmlStreamReader
protected XMLStreamReader getSecureXmlStreamReader(StreamSource xmlSource) throws XMLStreamException - Throws:
XMLStreamException
-
getUnmarshaller
protected jakarta.xml.bind.Unmarshaller getUnmarshaller(Class<?> clazz) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
doSetContentCreator
@PUT @Path("{pathId : .+}/creator") @Consumes("application/xml") public jakarta.ws.rs.core.Response doSetContentCreator(@PathParam("pathId") String pathId, StreamSource contentCreatorXml) Store content creator for the given path of created content.- Parameters:
pathId- colon separated path for the repository file that was created by the contenCreator below:path:to:file:idcontentCreatorXml- Repository file that created the file at the above pathId location<repositoryFileDto> <createdDate>1402911997019</createdDate> <fileSize>3461</fileSize> <folder>false</folder> <hidden>false</hidden> <id>ff11ac89-7eda-4c03-aab1-e27f9048fd38</id> <lastModifiedDate>1406647160536</lastModifiedDate> <locale>en</locale> <localePropertiesMapEntries> <localeMapDto> <locale>default</locale> <properties> <stringKeyStringValueDto> <key>file.title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>jcr:primaryType</key> <value>nt:unstructured</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>file.description</key> <value>myFile Description</value> </stringKeyStringValueDto> </properties> </localeMapDto> </localePropertiesMapEntries> <locked>false</locked> <name>myFile.prpt</name></name> <originalParentFolderPath>/public/admin</originalParentFolderPath> <ownerType>-1</ownerType> <path>/public/admin/ff11ac89-7eda-4c03-aab1-e27f9048fd38</path> <title>myFile</title> <versionId>1.9</versionId> <versioned>true</versioned> </repositoryFileAclDto>- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
-
doSetContentCreator
@PUT @Path("{pathId : .+}/creator") @Consumes("application/json") public jakarta.ws.rs.core.Response doSetContentCreator(@PathParam("pathId") String pathId, org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDto contentCreator) Store content creator for the given path of created content.- Parameters:
pathId- colon separated path for the repository file that was created by the contenCreator below:path:to:file:idcontentCreator- Repository file that created the file at the above pathId location<repositoryFileDto> <createdDate>1402911997019</createdDate> <fileSize>3461</fileSize> <folder>false</folder> <hidden>false</hidden> <id>ff11ac89-7eda-4c03-aab1-e27f9048fd38</id> <lastModifiedDate>1406647160536</lastModifiedDate> <locale>en</locale> <localePropertiesMapEntries> <localeMapDto> <locale>default</locale> <properties> <stringKeyStringValueDto> <key>file.title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>jcr:primaryType</key> <value>nt:unstructured</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>file.description</key> <value>myFile Description</value> </stringKeyStringValueDto> </properties> </localeMapDto> </localePropertiesMapEntries> <locked>false</locked> <name>myFile.prpt</name></name> <originalParentFolderPath>/public/admin</originalParentFolderPath> <ownerType>-1</ownerType> <path>/public/admin/ff11ac89-7eda-4c03-aab1-e27f9048fd38</path> <title>myFile</title> <versionId>1.9</versionId> <versioned>true</versioned> </repositoryFileAclDto>- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
-
doGetFileLocales
@GET @Path("{pathId : .+}/locales") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.LocaleMapDtoWrapper doGetFileLocales(@PathParam("pathId") String pathId) Retrieves the list of locale maps for the selected repository file.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/locales- Parameters:
pathId- Colon separated path for the repository file.- Returns:
- List
the list of locales. Example Response:
<localePropertiesMapEntries> <localeMapDto> <locale>default</locale> <properties> <stringKeyStringValueDto> <key>file.title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>jcr:primaryType</key> <value>nt:unstructured</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>file.description</key> <value>myFile Description</value> </stringKeyStringValueDto> </properties> </localeMapDto> </localePropertiesMapEntries>
-
doGetLocaleProperties
@GET @Path("{pathId : .+}/localeProperties") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDtoWrapper doGetLocaleProperties(@PathParam("pathId") String pathId, @QueryParam("locale") String locale) Retrieve the list of locale properties for a given locale.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/localeProperties?locale=ja- Parameters:
pathId- Colon separated path for the repository file.locale- The specified locale.- Returns:
- A list of locale properties.
Example Response:
<stringKeyStringValueDtoes> <stringKeyStringValueDto> <key>file.title</key> <value>File Title</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>jcr:primaryType</key> <value>nt:unstructured</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>title</key> <value>File Title</value> </stringKeyStringValueDto> </stringKeyStringValueDtoes>
-
doSetLocaleProperties
@PUT @Path("{pathId : .+}/localeProperties") @Produces({"application/xml","application/json"}) public jakarta.ws.rs.core.Response doSetLocaleProperties(@PathParam("pathId") String pathId, @QueryParam("locale") String locale, List<org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDto> properties) Save list of locale properties for a given locale.Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/localeProperties?locale=ja
PUT data:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><stringKeyStringValueDtoes><stringKeyStringValueDto><key>file.title</key><value>ãã£ã¼ã鏿ãªã¹ã</value></stringKeyStringValueDto><stringKeyStringValueDto><key>jcr:primaryType</key><value>nt:unstructured</value></stringKeyStringValueDto><stringKeyStringValueDto><key>file.description</key><value>è¤æ°ã®ãã£ã¼ãã¿ã¤ãã表示ãã¾ã</value></stringKeyStringValueDto></stringKeyStringValueDtoes>- Parameters:
pathId- Colon separated path for the repository file.locale- A string representation of the locale to set properties on.properties- The list of locale properties.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
This response does not contain data.
-
doDeleteLocale
@PUT @Path("{pathId : .+}/deleteLocale") @Produces({"application/xml","application/json"}) public jakarta.ws.rs.core.Response doDeleteLocale(@PathParam("pathId") String pathId, @QueryParam("locale") String locale) Delete the locale for the selected file.Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/deleteLocale?locale=ja
PUT data:This PUT body does not contain data.- Parameters:
pathId- Colon separated path for the repository file.locale- A string representations of the locale to be deleted.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
This response does not contain data.
-
doGetRootProperties
@GET @Path("/properties") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDto doGetRootProperties()Retrieves the properties of the root directory.Example Request:
GET pentaho/api/repo/files/properties- Returns:
- file properties object RepositoryFileDto for the root directory.
Example Response:
<repositoryFileDto> <createdDate>1406731649407</createdDate> <fileSize>-1</fileSize> <folder>true</folder> <hidden>false</hidden> <id>6d93372c-4908-47af-9815-3aa6307e392c</id> <locale>en</locale> <locked>false</locked> <name/> <ownerType>-1</ownerType> <path>/</path> <title/> <versioned>false</versioned> </repositoryFileDto>
-
doGetCanAccessList
@GET @Path("{pathId : .+}/canAccessMap") @Produces({"application/xml","application/json"}) public SettingsWrapper doGetCanAccessList(@PathParam("pathId") String pathId, @QueryParam("permissions") String permissions) Checks whether the current user has permissions to the selected files. This can check for more than one permission at once but will only return true if all permissions checked are valid.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.txt/canAccessMap?permissions=1- Parameters:
pathId- Colon separated path for the repository file.permissions- Pipe separated permissions to be checked.- Returns:
- List of permissions for the selected files.
Example Response:
{"setting":[{"name":"1","value":"true"}]}
-
doGetPathsAccessList
@POST @Path("/pathsAccessList") @Consumes({"application/xml","application/json"}) @Produces({"application/xml","application/json"}) public SettingsWrapper doGetPathsAccessList(StringListWrapper pathsWrapper) Checks whether the current user has permissions to the provided list of paths.Example Request:
POST pentaho/api/repo/files/pathsAccessList
POST data:<?xml version="1.0" encoding="UTF-8"?> <stringListWrapper> <strings>/public</strings> </stringListWrapper>- Parameters:
pathsWrapper- Collection of Strings containing the paths to be checked.- Returns:
- A collection of the permission settings for the paths.
Example Response:
<settings> <setting> <name> /public </name> <value> 0 </value> </setting> <setting> <name> /public </name> <value> 1 </value> </setting> </settings>
-
doGetCanAccess
@GET @Path("{pathId : .+}/canAccess") @Produces("text/plain") public String doGetCanAccess(@PathParam("pathId") String pathId, @QueryParam("permissions") String permissions) Check whether the current user has specific permission on the selected repository file.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/canAccess?permissions=1- Parameters:
pathId- Colon separated path for the repository file.permissions- Pipe separated list of permissions.- Returns:
- String "true" if the user has requested permissions on the file, or "false" otherwise.
Example Response:
true
-
doGetCanAdminister
Checks to see if the current user is an administer of the platform and returns a boolean response.Example Request:
GET pentaho/api/repo/files/canAdminister- Returns:
- String "true" if the user can administer the platform, or "false" otherwise.
Example Response:
true
-
doGetReservedChars
@GET @Path("/reservedCharacters") @Produces("text/plain") public jakarta.ws.rs.core.Response doGetReservedChars()Returns the list of reserved characters from the repository.Example Request:
GET pentaho/api/repo/files/reservedCharacters- Returns:
- List of characters that are reserved by the repository.
Example Response:
"/ \"
-
doGetReservedCharactersDisplay
@GET @Path("/reservedCharactersDisplay") @Produces("text/plain") public jakarta.ws.rs.core.Response doGetReservedCharactersDisplay()Returns the list of reserved characters from the repository.Example Request:
GET pentaho/api/repo/files/reservedCharactersDisplay- Returns:
- List of characters that are reserved by the repository.
Example Response:
"/, \, \t, \r, \nF"
-
doGetCanCreate
Checks the users permission to determine if that user can create new content in the repository.Example Request:
GET pentaho/api/repo/files/canCreate- Returns:
- String "true" if the user can create new content, or "false" otherwise.
Example Response:
true
-
doGetCanEdit
Checks the users permission to determine if that user can edit an existing content in the repository.Example Request:
GET pentaho/api/repo/files/canEdit- Returns:
- String "true" if the user can edit existing content, or "false" otherwise.
Example Response:
true
-
doGetFileAcl
@GET @Path("{pathId : .+}/acl") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileAclDto doGetFileAcl(@PathParam("pathId") String pathId) Retrieves the ACL settings of the requested repository file in either xml or json format.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/acl- Parameters:
pathId- colon separated path for the repository file.- Returns:
- RepositoryFileAclDto object containing the ACL settings of the requested file.
Example Response:
<repositoryFileAclDto> <aces> <modifiable>true</modifiable> <permissions>4</permissions> <recipient>admin</recipient> <recipientType>0</recipientType> </aces> <aces> <modifiable>false</modifiable> <permissions>4</permissions> <recipient>Administrator</recipient> <recipientType>1</recipientType> </aces> <entriesInheriting>true</entriesInheriting> <id>068390ba-f90d-46e3-8c55-bbe55e24b2fe</id> <owner>admin</owner> <ownerType>0</ownerType> </repositoryFileAclDto>
-
doGetProperties
@GET @Path("{pathId : .+}/properties") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDto doGetProperties(@PathParam("pathId") String pathId) Retrieves the properties of a selected repository file.Example Request:
GET pentaho/api/repo/files/:/properties- Parameters:
pathId- Colon separated path for the repository file.- Returns:
- A RepositoryDto object containing the properties for the given file.
Example Response:
{ "createdDate":"1406732545857", "description":"description", "fileSize":"1234", "folder":"false", "hidden":"false", "id":"fileId", "lastModifiedDate":"1406732545858", "locale":"en", "localePropertiesMapEntries":[ { "locale":"default", "properties":[ {"key":"file.title","value":"afile"}, {"key":"description","value":"afile.prpti"}, {"key":"jcr:primaryType","value":"nt:unstructured"}, {"key":"title","value":"afile"}, {"key":"file.description","value":"afile.prpti"} ] } ], "locked":"false", "name":"filename", "ownerType":"-1","path":"pathToFile:filename", "title":"title","versioned":"false" }
-
doGetContentCreator
@GET @Path("{pathId : .+}/creator") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDto doGetContentCreator(@PathParam("pathId") String pathId) Retrieves the file by creator id- Parameters:
pathId- Colon separated path for the destination for files to be copied.- Returns:
- file properties object RepositoryFileDto
-
doGetGeneratedContent
@GET @Path("{pathId : .+}/generatedContent") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapper doGetGeneratedContent(@PathParam("pathId") String pathId) Retrieve the list of executed contents for a selected content from the repository.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/generatedContent?locale=de- Parameters:
pathId- Colon separated path for the destination for files to be copied.- Returns:
- A list of RepositoryDto objects containing the executed contents for a selected content from the repository.
Example Response:
<List> <repositoryFileDto> <createdDate>1402911997019</createdDate> <fileSize>3461</fileSize> <folder>false</folder> <hidden>false</hidden> <id>ff11ac89-7eda-4c03-aab1-e27f9048fd38</id> <lastModifiedDate>1406647160536</lastModifiedDate> <locale>en</locale> <localePropertiesMapEntries> <localeMapDto> <locale>default</locale> <properties> <stringKeyStringValueDto> <key>file.title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>jcr:primaryType</key> <value>nt:unstructured</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>file.description</key> <value>myFile Description</value> </stringKeyStringValueDto> </properties> </localeMapDto> </localePropertiesMapEntries> <locked>false</locked> <name>myFile.prpt</name></name> <originalParentFolderPath>/public/admin</originalParentFolderPath> <ownerType>-1</ownerType> <path>/public/admin/ff11ac89-7eda-4c03-aab1-e27f9048fd38</path> <title>myFile</title> <versionId>1.9</versionId> <versioned>true</versioned> </repositoryFileAclDto> </List>
-
doGetGeneratedContentForUser
@GET @Path("{pathId : .+}/generatedContentForUser") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapper doGetGeneratedContentForUser(@PathParam("pathId") String pathId, @QueryParam("user") String user) Retrieve the executed contents for a selected repository file and a given user.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/generatedContentForUser?user=admin- Parameters:
pathId- Colon separated path for the destination for files to be copied.user- The username for the generated content folder.- Returns:
- A list of RepositoryDto objects containing the executed contents for a selected file from the repository.
Example Response:
<List> <repositoryFileDto> <createdDate>1402911997019</createdDate> <fileSize>3461</fileSize> <folder>false</folder> <hidden>false</hidden> <id>ff11ac89-7eda-4c03-aab1-e27f9048fd38</id> <lastModifiedDate>1406647160536</lastModifiedDate> <locale>en</locale> <localePropertiesMapEntries> <localeMapDto> <locale>default</locale> <properties> <stringKeyStringValueDto> <key>file.title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>jcr:primaryType</key> <value>nt:unstructured</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>title</key> <value>myFile</value> </stringKeyStringValueDto> <stringKeyStringValueDto> <key>file.description</key> <value>myFile Description</value> </stringKeyStringValueDto> </properties> </localeMapDto> </localePropertiesMapEntries> <locked>false</locked> <name>myFile.prpt</name></name> <originalParentFolderPath>/public/admin</originalParentFolderPath> <ownerType>-1</ownerType> <path>/public/admin/ff11ac89-7eda-4c03-aab1-e27f9048fd38</path> <title>myFile</title> <versionId>1.9</versionId> <versioned>true</versioned> </repositoryFileAclDto> </List>
-
doGetRootTree
@GET @Path("/tree") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileTreeDto doGetRootTree(@QueryParam("depth") Integer depth, @QueryParam("filter") String filter, @QueryParam("showHidden") Boolean showHidden, @DefaultValue("false") @QueryParam("includeAcls") Boolean includeAcls) Retrieve the recursive list of files from root of the repository based on the filters provided.Example Request:
GET pentaho/api/repo/files/tree?showHidden=falseinvalid input: '&filter'=*|FILESinvalid input: '&'_=1389042244670- Parameters:
depth- How many level should the search go.filter- Filter to be applied for search. The filter can be broken down into 3 parts; File types, Child Node Filter, and Member Filters. Each part is separated with a pipe (|) character. File Types are represented by a word phrase. This phrase is recognized as a file type phrase and processed accordingly. Valid File Type word phrases include "FILES", "FOLDERS", and "FILES_FOLDERS" and denote whether to return files, folders, or both files and folders, respectively. The Child Node Filter is a list of allowed names of files separated by the pipe (|) character. Each file name in the filter may be a full name or a partial name with one or more wildcard characters ("*"). The filter does not apply to root node. The Member Filter portion of the filter parameter allows the caller to specify which properties of the metadata to return. Member Filters start with "includeMembers=" or "excludeMembers=" followed by a list of comma separated field names that are to be included in, or, excluded from, the list. Valid field names can be found in org.pentaho.platform.repository2.unified.webservices#RepositoryFileAdapter. Omission of a member filter will return all members. It is invalid to both and includeMembers= and an excludeMembers= clause in the same service call.showHidden- Include or exclude hidden files from the file list.- Returns:
- A RepositoryFileTreeDto object containing the files at the root of the repository. Will return files but not folders under the "/" folder. The fields returned will include the name, filesize, description, id and title.
Example Response:
<repositoryFileTreeDto> <children> <file> <createdDate>1405356318621</createdDate> <fileSize>-1</fileSize> <folder>true</folder> <hidden>false</hidden> <id>fileId;/id> <locale>en</locale> <locked>false</locked> <name>admin</name> <ownerType>-1</ownerType> <path>/path/to/dir</path> <title>admin</title> <versioned>false</versioned> </file> </children> </repositoryFileTreeDto>
-
doGetRootChildren
@GET @Path("/children") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapper doGetRootChildren(@QueryParam("filter") String filter, @QueryParam("showHidden") Boolean showHidden, @DefaultValue("false") @QueryParam("includeAcls") Boolean includeAcls) Retrieve a list of child files from the root of the repository.Example Request:
GET pentaho/api/repo/files/children?showHidden=falseinvalid input: '&filter'=*|FILESinvalid input: '&'_=1389042244670- Parameters:
filter- Filter to be applied for search. The filter can be broken down into 3 parts; File types, Child Node Filter, and Member Filters. Each part is separated with a pipe (|) character. File Types are represented by a word phrase. This phrase is recognized as a file type phrase and processed accordingly. Valid File Type word phrases include "FILES", "FOLDERS", and "FILES_FOLDERS" and denote whether to return files, folders, or both files and folders, respectively. The Child Node Filter is a list of allowed names of files separated by the pipe (|) character. Each file name in the filter may be a full name or a partial name with one or more wildcard characters ("*"). The filter does not apply to root node. The Member Filter portion of the filter parameter allows the caller to specify which properties of the metadata to return. Member Filters start with "includeMembers=" or "excludeMembers=" followed by a list of comma separated field names that are to be included in, or, excluded from, the list. Valid field names can be found in org.pentaho.platform.repository2.unified.webservices#RepositoryFileAdapter. Omission of a member filter will return all members. It is invalid to both and includeMembers= and an excludeMembers= clause in the same service call.showHidden- Include or exclude hidden files from the file list.includeAcls- Include permission information about the file in the output.- Returns:
- A RepositoryFileTreeDto object containing the files at the root of the repository. Will return files but not folders under the "/" folder. The fields returned will include the name, filesize, description, id and title.
Example Response:
<repositoryFileTreeDto> <children> <file> <createdDate>1405356318621</createdDate> <fileSize>-1</fileSize> <folder>true</folder> <hidden>false</hidden> <id>fileId;/id> <locale>en</locale> <locked>false</locked> <name>admin</name> <ownerType>-1</ownerType> <path>/path/to/dir</path> <title>admin</title> <versioned>false</versioned> </file> </children> </repositoryFileTreeDto>
-
doGetTree
@GET @Path("{pathId : .+}/tree") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileTreeDto doGetTree(@PathParam("pathId") String pathId, @QueryParam("depth") Integer depth, @QueryParam("filter") String filter, @QueryParam("showHidden") Boolean showHidden, @DefaultValue("false") @QueryParam("includeAcls") Boolean includeAcls, @DefaultValue("false") @QueryParam("includeSysDirs") Boolean includeSystemFolders) Retrieve the recursive list of children of the selected repository file.Example Request:
GET pentaho/api/repo/files/:public/tree?showHidden=falseinvalid input: '&filter'=*|FILESinvalid input: '&'_=1389042244670- 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.depth- How many level should the search go.filter- Filter to be applied for search. The filter can be broken down into 3 parts; File types, Child Node Filter, and Member Filters. Each part is separated with a pipe (|) character. File Types are represented by a word phrase. This phrase is recognized as a file type phrase and processed accordingly. Valid File Type word phrases include "FILES", "FOLDERS", and "FILES_FOLDERS" and denote whether to return files, folders, or both files and folders, respectively. The Child Node Filter is a list of allowed names of files separated by the pipe (|) character. Each file name in the filter may be a full name or a partial name with one or more wildcard characters ("*"). The filter does not apply to root node. The Member Filter portion of the filter parameter allows the caller to specify which properties of the metadata to return. Member Filters start with "includeMembers=" or "excludeMembers=" followed by a list of comma separated field names that are to be included in, or, excluded from, the list. Valid field names can be found in org.pentaho.platform.repository2.unified.webservices#RepositoryFileAdapter. Omission of a member filter will return all members. It is invalid to both and includeMembers= and an excludeMembers= clause in the same service call.showHidden- Include or exclude hidden files from the file list.includeAcls- Include permission information about the file in the output.- Returns:
- A RepositoryFileTreeDto object containing the files at the root of the repository. Will return files but not folders under the "/" folder. The fields returned will include the name, filesize, description, id and title.
Example Response:
<repositoryFileTreeDto> <children> <file> <createdDate>1405356318621</createdDate> <fileSize>-1</fileSize> <folder>true</folder> <hidden>false</hidden> <id>fileId;/id> <locale>en</locale> <locked>false</locked> <name>admin</name> <ownerType>-1</ownerType> <path>/path/to/dir</path> <title>admin</title> <versioned>false</versioned> </file> </children> </repositoryFileTreeDto>
-
doGetChildren
@GET @Path("{pathId : .+}/children") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapper doGetChildren(@PathParam("pathId") String pathId, @QueryParam("filter") String filter, @QueryParam("showHidden") Boolean showHidden, @DefaultValue("false") @QueryParam("includeAcls") Boolean includeAcls) Retrieve a list of child files from the selected repository path of the repository.Example Request:
GET pentaho/api/repo/files/:jmeter-test/children- 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.filter- Filter to be applied for search. The filter can be broken down into 3 parts; File types, Child Node Filter, and Member Filters. Each part is separated with a pipe (|) character. File Types are represented by a word phrase. This phrase is recognized as a file type phrase and processed accordingly. Valid File Type word phrases include "FILES", "FOLDERS", and "FILES_FOLDERS" and denote whether to return files, folders, or both files and folders, respectively. The Child Node Filter is a list of allowed names of files separated by the pipe (|) character. Each file name in the filter may be a full name or a partial name with one or more wildcard characters ("*"). The filter does not apply to root node. The Member Filter portion of the filter parameter allows the caller to specify which properties of the metadata to return. Member Filters start with "includeMembers=" or "excludeMembers=" followed by a list of comma separated field names that are to be included in, or, excluded from, the list. Valid field names can be found in org.pentaho.platform.repository2.unified.webservices#RepositoryFileAdapter. Omission of a member filter will return all members. It is invalid to both and includeMembers= and an excludeMembers= clause in the same service call.showHidden- Include or exclude hidden files from the file list.includeAcls- Include permission information about the file in the output.- Returns:
- A RepositoryFileTreeDto object containing the files at the selected repository path of the repository. Will return files but not folders under the "/" folder. The fields returned will include the name, filesize, description, id and title.
Example Response:
<repositoryFileTreeDto> <children> <file> <createdDate>1405356318621</createdDate> <fileSize>-1</fileSize> <folder>true</folder> <hidden>false</hidden> <id>fileId;/id> <locale>en</locale> <locked>false</locked> <name>admin</name> <ownerType>-1</ownerType> <path>/path/to/dir</path> <title>admin</title> <versioned>false</versioned> </file> </children> </repositoryFileTreeDto>
-
doGetDeletedFiles
@GET @Path("/deleted") @Produces({"application/xml","application/json"}) public org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileDtoWrapper doGetDeletedFiles()Retrieve the list of files in the user's trash folder.Example Request:
GET pentaho/api/repo/files/deleted- Returns:
- A list of RepositoryDto objects containing the files in the trash folder of the repository.
Example Response:
<repositoryFileDtoes> <repositoryFileDto> <createdDate>1405356406448</createdDate> <deletedDate>1406573914167</deletedDate> <fileSize>10477</fileSize> <folder>false</folder> <hidden>false</hidden> <id>fileId</id> <lastModifiedDate>1405356406448</lastModifiedDate> <locale>en</locale> <localePropertiesMapEntries> <locale>default</locale> <properties> <key>file.title</key> <value>File Title</value> </properties> <properties> <key>jcr:primaryType</key> <value>nt:unstructured</value> </properties> <properties> <key>title</key> <value>filename</value> </properties> <properties> <key>file.description</key> <value /> </properties> </localePropertiesMapEntries> <locked>false</locked> <name>filename.ext</name> <originalParentFolderPath>/original/path/to/file</originalParentFolderPath> <ownerType>-1</ownerType> <path>/path/to/file</path> <title>File Title</title> <versionId>1.3</versionId> <versioned>true</versioned> </repositoryFileDto> </repositoryFileDtoes>
-
doGetMetadata
@GET @Path("{pathId : .+}/metadata") @Produces("application/json") public org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDtoWrapper doGetMetadata(@PathParam("pathId") String pathId) Retrieve the metadata of the selected file. Even though the hidden flag is a property of the file node itself, and not the metadata child, it is considered metadata from PUC and is included in the setMetadata call.Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/metadata- 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:
<stringKeyStringValueDtos> <stringKeyStringValueDto> <key>KEY<key> <value>KEY<value> </stringKeyStringValueDto> </stringKeyStringValueDtos>
-
doRename
@PUT @Path("{pathId : .+}/rename") @Consumes("*/*") @Produces("*/*") public jakarta.ws.rs.core.Response doRename(@PathParam("pathId") String pathId, @QueryParam("newName") String newName) Rename the selected file.Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/rename?newName=test_file_8
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.newName- String indicating the new name of the file.- Returns:
- Response with 200 OK, if the file does not exist to be renamed the response will return 200 OK with the string "File to be renamed does not exist".
Example Response:
This response does not contain data.
-
doSetMetadata
@PUT @Path("{pathId : .+}/metadata") @Produces({"application/xml","application/json"}) @Consumes("application/json") public jakarta.ws.rs.core.Response doSetMetadata(@PathParam("pathId") String pathId, org.pentaho.platform.api.repository2.unified.webservices.StringKeyStringValueDtoWrapper metadata) Store the metadata of the selected file. Even though the hidden flag is a property of the file node itself, and not the metadata child, it is considered metadata from PUC and is included in the setMetadata call.Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/metadata
PUT data:<?xml version="1.0" encoding="UTF-8" standalone="yes"?><stringKeyStringValueDtoes><stringKeyStringValueDto><key>metadata.key.1</key><value>metadata.value.1</value></stringKeyStringValueDto></stringKeyStringValueDtoes>- 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.metadata- A list of StringKeyStringValueDto objects.- Returns:
- A jax-rs Response object with the appropriate status code, header, and body.
Example Response:
This response does not contain data.
-
doCreateDirs
@PUT @Path("{pathId : .+}/createDir") @Consumes("*/*") public jakarta.ws.rs.core.Response doCreateDirs(@PathParam("pathId") String pathId) Creates a new folder with the specified name.Example Request:
PUT pentaho/api/repo/files/:public:jmeter-test-dir/createDir
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:
This response does not contain data.
-
doVersioningConfiguration
@GET @Path("{pathId : .+}/versioningConfiguration") @Produces({"application/xml","application/json"}) public org.pentaho.platform.repository2.unified.webservices.FileVersioningConfiguration doVersioningConfiguration(@PathParam("pathId") String pathId) This method is used to determine whether versioning should be active for the given pathExample Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.ktr/versioningConfiguration- Parameters:
pathId- Colon separated path for the repository file.- Returns:
- The Versioning Configuration applicable to the path submitted
Example Response:
<fileVersioningConfiguration> <versionCommentEnabled>true</versionCommentEnabled> <versioningEnabled>true</versioningEnabled> </fileVersioningConfiguration>
-
canDownload
@GET @Path("/canDownload") @Produces("text/plain") public jakarta.ws.rs.core.Response canDownload(@QueryParam("dirPath") @DefaultValue("") String dirPath) Validates if a current user is authorized to download content from the given dir.Example Request:
GET pentaho/api/repo/files/canDownload- Parameters:
dirPath- to be validated for download action for the current user.- Returns:
- A boolean response based on the current user being authorized to download within the system.
Example Response:
false
-
canUpload
@GET @Path("/canUpload") @Produces("text/plain") public jakarta.ws.rs.core.Response canUpload(@QueryParam("dirPath") @DefaultValue("") String dirPath, @QueryParam("ignoreUploadDirExistenceChecks") @DefaultValue("false") boolean ignoreUploadDirExistenceChecks) Validates if a current user is authorized to upload content to the given dir.Example Request:
GET pentaho/api/repo/files/canUpload?dirPath=/public/new-reportinvalid input: '&ignoreUploadDirExistenceChecks'=trueExample Response:
false- Parameters:
dirPath- The path to be validated for upload action for the current user. If not specified, only the user roles authorization is checked. Default is an empty string.ignoreUploadDirExistenceChecks- Iftrue, skips checks to see if the upload folder exists and if the user has write access to it. It is useful when the upload folder is being created, or the ACL will change, as part of the upload operation. Default isfalse.- Returns:
- A boolean response based on the current user being authorized to upload to the given folder path.
-
isPathValid
-
getWhitelist
public org.pentaho.platform.repository.RepositoryDownloadWhitelist getWhitelist() -
setWhitelist
public void setWhitelist(org.pentaho.platform.repository.RepositoryDownloadWhitelist whitelist) -
getPolicy
public static org.pentaho.platform.api.engine.IAuthorizationPolicy getPolicy() -
getRepository
public static org.pentaho.platform.api.repository2.unified.IUnifiedRepository getRepository() -
getRepoWs
public static org.pentaho.platform.repository2.unified.webservices.DefaultUnifiedRepositoryWebService getRepoWs() -
setConverterHandler
public void setConverterHandler(org.pentaho.platform.api.repository2.unified.IRepositoryContentConverterHandler converterHandler) -
setMimeResolver
public void setMimeResolver(org.pentaho.platform.api.mimetype.IPlatformMimeResolver mimeResolver) -
buildOkResponse
protected jakarta.ws.rs.core.Response buildOkResponse() -
buildOkResponse
-
buildPlainTextOkResponse
-
buildStatusResponse
protected jakarta.ws.rs.core.Response buildStatusResponse(jakarta.ws.rs.core.Response.Status status) -
buildServerErrorResponse
-
buildServerErrorResponse
-
buildSafeHtmlServerErrorResponse
-
buildOkResponse
protected jakarta.ws.rs.core.Response buildOkResponse(FileService.RepositoryFileToStreamWrapper wrapper) -
buildZipOkResponse
-
buildOkResponse
-
getExporter
-
getFileInputStream
- Throws:
FileNotFoundException
-
getStreamingOutput
-
hasParameterUi
protected boolean hasParameterUi(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile) -
getContentGenerator
protected org.pentaho.platform.api.engine.IContentGenerator getContentGenerator(org.pentaho.platform.api.repository2.unified.RepositoryFile repositoryFile) -
getSimpleParameterProvider
protected org.pentaho.platform.engine.core.solution.SimpleParameterProvider getSimpleParameterProvider() -
encode
- Throws:
UnsupportedEncodingException
-
getSession
protected org.pentaho.platform.api.engine.IPentahoSession getSession() -
getByteArrayOutputStream
-
parseText
- Throws:
org.dom4j.DocumentException
-
getMessagesInstance
-
getUserHomeFolder
-