File Management APIs File Resource
This service provides comprehensive file management operations including upload, download, delete, permissions, and metadata management.
Performs a backup of the existing Pentaho System including content, schedules, users, roles, datasources, and the metastore.
Example Request:
POST pentaho/api/repo/files/backupcURL Example:
curl -X POST \
"http://localhost:8080/pentaho/api/repo/files/backup" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "logFile=/path/to/export.log&logLevel=INFO&outputFile=/path/to/backup.zip"Path to the log file for the backup operation
/path/to/export.logLog level for the backup operation
INFOPath for the output backup file
/path/to/backup.zipSuccessfully exported the existing Pentaho System
Encrypted file stream containing the backup
User has provided an invalid file path
User does not have administrative permissions
Failure to complete the export
POST /repo/files/backup HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 86
"logFile='/path/to/export.log'&logLevel='INFO'&outputFile='/path/to/backup.zip'"binaryPerforms 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/systemRestorecURL Example:
curl -X POST \
"http://localhost:8080/pentaho/api/repo/files/systemRestore" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "overwriteFile=true" \
-F "applyAclSettings=true" \
-F "overwriteAclSettings=true" \
-F "logFile=/path/to/import.log" \
-F "logLevel=INFO" \
-F "backupBundlePath=/path/to/bundle"The zip file generated using the backup endpoint, used to do a full system restore
The file to be imported
/path/to/overwrite.zipWhether to overwrite existing files during restore. If kept at the default of true, overwrites any value found on the system with the matching value that is being imported. Values that exist on the system, but do not exist in the import will not be deleted. When the overwrite flag is equal to false, any value that is found in the import process that already exists will not be imported.
trueWhether to apply ACL settings from the backup
trueWhether to overwrite existing ACL settings
truePath to the log file for the restore operation
/path/to/import.logLog level for the restore operation
INFOPath to the backup bundle
/path/to/bundleSuccessfully imported the Pentaho System
No content
User has provided an invalid file path
User does not have administrative permissions
Failure to complete the import
POST /repo/files/systemRestore HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: multipart/form-data
Accept: */*
Content-Length: 226
{
"fileUpload": "binary",
"overwriteFile": "/path/to/overwrite.zip",
"overwrite": "true",
"applyAclSettings": "true",
"overwriteAclSettings": "true",
"logFile": "/path/to/import.log",
"logLevel": "INFO",
"backupBundlePath": "/path/to/bundle"
}No content
Move a list of files to the user's trash folder.
Important 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.
Example Request:
PUT pentaho/api/repo/files/deletecURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/delete" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: text/plain" \
-d "home:admin:file1.txt,home:admin:file2.txt"Comma separated list of the files to be moved to trash folder
home:admin:file1.txt,home:admin:file2.txtSuccessfully moved file to trash
No content
Failure move the file to the trash
PUT /repo/files/delete HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: */*
Accept: */*
Content-Length: 43
"home:admin:file1.txt,home:admin:file2.txt"No content
Permanently delete files from the repository system. This operation cannot be undone.
**Important 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.
Example Request:
PUT pentaho/api/repo/files/deletepermanentcURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/deletepermanent" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: text/plain" \
-d "home:admin:file1.txt,home:admin:file2.txt"Comma separated list of the files to be deleted permanently
home:admin:file1.txt,home:admin:file2.txtSuccessfully deleted the comma separated list of fileIds from the system
No content
Failure to delete the file due to path not found
PUT /repo/files/deletepermanent HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: */*
Accept: */*
Content-Length: 43
"home:admin:file1.txt,home:admin:file2.txt"No content
Checks if a file exists at the specified path in the repository.
Example Request:
GET pentaho/api/repo/exists?pathId=%2Fhome%2Fuser%2Ftest_file.wtrcURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/exists?pathId=%2Fhome%2Fuser%2Ftest_file.wtr" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="Encoded path of the repository file to check. Must be URL-encoded.
home%2Fuser%2Ftest_file.wtrSuccessfully finds the file
No content
Failed to find the file or invalid input
For any other exceptions
GET /repo/files/exists?pathId=home%2Fuser%2Ftest_file.wtr HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
No content
Takes a pathId and returns a JAX-RS Response object with the appropriate status code, header, and body containing the output stream based on the file located at the pathId.
Produces MediaType.WILDCARD (/) to support any content type based on the file being retrieved.
Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xmlcURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/jmeter-test:test_file_1.xml" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: */*"Colon separated path for the repository file
jmeter-test:test_file_1.xmlSuccessfully get the file or directory
File content stream with appropriate headers (supports any media type)
Failed to find the file or resource
Failed to open content
GET /repo/files/{pathId} HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
binaryCreates a new file with the provided contents at a given path. Returns a JAX-RS Response object with the appropriate status code, header, and body.
Consumes MediaType.WILDCARD (/) to accept any content type for the file being created.
Example Request:
PUT /repo/files/:jmeter-test:test_file_1.xmlcURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/jmeter-test:test_file_1.xml" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: */*" \
--data-binary @file_content.xmlThe 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
jmeter-test:test_file_1.xmlAn Input Stream with the contents of the file to be created
Successfully created the file
No content
Failure to create the file due to permissions, file already exists, or invalid path id
PUT /repo/files/{pathId} HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: */*
Accept: */*
Content-Length: 8
"binary"No content
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/aclcURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/acl" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Colon separated path for the repository file
jmeter-test:test_file_1.xmlReturns the requested file permissions in xml or json format
File failed to be retrieved. This could be caused by an invalid path, or the file does not exist
GET /repo/files/{pathId}/acl HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"id": "acl-12345",
"owner": "admin",
"ownerType": 0,
"inheriting": true,
"entriesInheriting": true,
"aces": [
{
"recipient": "user1",
"recipientType": 0,
"permissions": [
0,
1,
2
]
}
]
}This method is used to update and save the acls of the selected file to the repository. Supports both XML and JSON formats.
Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/aclcURL Example (JSON):
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/acl" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/json" \
-d '{"entriesInheriting":true,"id":"d45d4972-989e-48d5-8bd0-f7024a77f08f","owner":"admin","ownerType":0}'cURL Example (XML):
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/acl" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/xml" \
-d '<?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>'Colon separated path for the repository file
jmeter-test:test_file_1.xmlRepository file access control list
Unique identifier for the ACL
acl-12345Owner of the file
adminType of owner (USER, ROLE)
0Whether ACL inherits from parent
trueWhether entries inherit
trueSuccessfully saved file
No content
Failed to save acls due to malformed xml
Failed to save acls due to missing or incorrect properties
Failed to save acls due to another error
PUT /repo/files/{pathId}/acl HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 162
{
"id": "acl-12345",
"owner": "admin",
"ownerType": 0,
"inheriting": true,
"entriesInheriting": true,
"aces": [
{
"recipient": "user1",
"recipientType": 0,
"permissions": [
0,
1,
2
]
}
]
}No content
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=1cURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/canAccess?permissions=1" \
-H "Authorization: Basic YWRtaW06cGFzc3dvcmQ="Example Response:
trueColon separated path for the repository file
:jmeter-test:test_file_1.xmlPipe separated list of permissions
1Successfully retrieved the permissions of the given paths
String "true" if the user has requested permissions on the file, or "false" otherwise
Unable to retrieve the permissions of the given paths due to some other error
GET /repo/files/{pathId}/canAccess HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
trueChecks 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=1cURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.txt/canAccessMap?permissions=1" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Colon separated path for the repository file
home:admin:test_file_1.txtPipe separated permissions to be checked
1Successfully retrieved the permissions of the file
Unable to retrieve the permissions of the file due to some other error
GET /repo/files/{pathId}/canAccessMap?permissions=1 HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<settingsWrapper>
<setting>
<name>1</name>
<value>true</value>
</setting>
</settingsWrapper>
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=decURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/download?locale=de" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "User-Agent: Mozilla/5.0" \
-o test_file_1.xmlExample Response:
Encrypted file streamColon separated path for the repository file.
:jmeter-test:test_file_1.xmltrue 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.
trueA 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.
Mozilla/5.0Successful download
Encrypted file stream
Usually a bad pathId
pathId points at a file the user doesn't have access to
File not found
Failed to download file for another reason
GET /repo/files/{pathId}/download HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
binaryRetrieves 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/inlinecURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/inline" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="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>Colon separated path for the repository file
:jmeter-test:test_file_1.xmlSuccessfully retrieved file
The file content for inline display
Failed to retrieve file due to permission problem
Failed to retrieve file due because file was not found
Failed to download file because of some other error
GET /repo/files/{pathId}/inline HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
binaryRetrieves the list of locale maps for the selected repository file.
Example Request:
GET pentaho/api/repo/files/:jmeter-test:test_file_1.xml/localescURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/locales" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Colon separated path for the repository file
:jmeter-test:test_file_1.xmlSuccessfully retrieved locale information
Failed to retrieve locales because the file was not found
Unable to retrieve locales due to some other error
GET /repo/files/{pathId}/locales HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"localePropertiesMapEntries": [
{
"locale": "default",
"properties": [
{
"key": "file.title",
"value": "myFile"
},
{
"key": "jcr:primaryType",
"value": "nt:unstructured"
},
{
"key": "title",
"value": "myFile"
},
{
"key": "file.description",
"value": "myFile Description"
}
]
}
]
}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=jacURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/localeProperties?locale=ja" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Colon separated path for the repository file
:jmeter-test:test_file_1.xmlThe specified locale
jaSuccessfully retrieved locale properties
Unable to retrieve locale properties due to some other error
GET /repo/files/{pathId}/localeProperties?locale=ja HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"stringKeyStringValueDtoes": [
{
"key": "file.title",
"value": "File Title"
},
{
"key": "jcr:primaryType",
"value": "nt:unstructured"
},
{
"key": "title",
"value": "File Title"
}
]
}Save list of locale properties for a given locale.
Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/localeProperties?locale=jacURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/localeProperties?locale=ja" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/xml" \
-d '<?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>'Example Response:
This response does not contain data.Colon separated path for the repository file
:jmeter-test:test_file_1.xmlA string representation of the locale to set properties on
jaSuccessfully updated locale properties
This response does not contain data
Unable to update locale properties due to some other error
PUT /repo/files/{pathId}/localeProperties?locale=ja HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 228
{
"stringKeyStringValueDtoes": [
{
"key": "file.title",
"value": "チャート選択リスト"
},
{
"key": "jcr:primaryType",
"value": "nt:unstructured"
},
{
"key": "file.description",
"value": "複数のチャートタイプを表示します"
}
]
}<?xml version="1.0"?>
<object/>
Delete the locale for the selected file.
Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/deleteLocale?locale=jacURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/deleteLocale?locale=ja" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="Example Response:
This response does not contain data.Colon separated path for the repository file
:jmeter-test:test_file_1.xmlA string representations of the locale to be deleted
jaSuccessfully deleted the locale
This response does not contain data
Unable to delete the locale properties due to some other error
PUT /repo/files/{pathId}/deleteLocale?locale=ja HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<?xml version="1.0"?>
<object/>
Retrieve a list of child files from the selected repository path of the repository.
Example Request:
GET pentaho/api/repo/files/:jmeter-test/childrencURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test/children" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"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.
:jmeter-testFilter 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.
Include or exclude hidden files from the file list
falseInclude permission information about the file in the output
falseSuccessfully retrieved the list of child files from selected repository path of the repository
Server Error
GET /repo/files/{pathId}/children HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<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>
Retrieve the recursive list of children of the selected repository file.
Example Request:
GET pentaho/api/repo/files/:public/tree?showHidden=false&filter=*|FILES&_=1389042244670cURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:public/tree?showHidden=false&filter=*|FILES&_=1389042244670" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"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.
:publicHow many level should the search go.
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.
*|FILESInclude or exclude hidden files from the file list.
falseInclude permission information about the file in the output.
falseInclude system directories in the output.
falseSuccessfully retrieved the list of files from root of the repository. 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.
Invalid parameters.
Server Error.
GET /repo/files/{pathId}/tree HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"children": [
{
"file": {
"createdDate": 1405356318621,
"fileSize": -1,
"folder": true,
"hidden": false,
"id": "fileId",
"locale": "en",
"locked": false,
"name": "admin",
"ownerType": -1,
"path": "/path/to/dir",
"title": "admin",
"versioned": false
}
}
]
}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/canAdministercURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/canAdminister" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="Successfully returns a boolean value, either true or false
String "true" if the user can administer the platform, or "false" otherwise.
GET /repo/files/canAdminister HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Successfully returns a boolean value, either true or false
trueChecks the users permission to determine if that user can create new content in the repository.
Example Request:
GET pentaho/api/repo/files/canCreatecURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/canCreate" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="Successfully returns true or false depending on the users permissions
String "true" if the user can create new content, or "false" otherwise.
GET /repo/files/canCreate HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Successfully returns true or false depending on the users permissions
trueReturns the list of reserved characters from the repository.
Example Request:
GET pentaho/api/repo/files/reservedCharacterscURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/reservedCharacters" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="Successfully returns a list of repositroy reserved characters
List of characters that are reserved by the repository.
GET /repo/files/reservedCharacters HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Successfully returns a list of repositroy reserved characters
/ "Returns the list of reserved characters from the repository.
Example Request:
GET pentaho/api/repo/files/reservedCharactersDisplaycURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/reservedCharactersDisplay" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="Successfully returns a list of repositroy reserved characters
List of characters that are reserved by the repository.
GET /repo/files/reservedCharactersDisplay HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Successfully returns a list of repositroy reserved characters
/, \, \t, \r, \nFChecks the users permission to determine if that user can edit an existing content in the repository.
Example Request:
GET pentaho/api/repo/files/canEditcURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/canEdit" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="Successfully returns true or false depending on the users permissions
String "true" if the user can edit existing content, or "false" otherwise.
GET /repo/files/canEdit HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Successfully returns true or false depending on the users permissions
trueRename the selected file.
Example Request:
PUT pentaho/api/repo/files/:jmeter-test:test_file_1.xml/rename?newName=test_file_8cURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/rename?newName=test_file_8" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="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.
:jmeter-test:test_file_1.xmlString indicating the new name of the file.
test_file_8Successfully renamed file.
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".
Forbidden.
File not found.
PUT /repo/files/{pathId}/rename?newName=test_file_8 HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
This response does not contain data.Retrieves the properties of the root directory.
Example Request:
GET pentaho/api/repo/files/propertiescURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/properties" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Successfully retrieved the properties of the root directory.
Unable to retrieve the properties of the root directory due to file not found error.
Unable to retrieve the properties of the root directory due to some other error.
GET /repo/files/properties HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"createdDate": 1406731649407,
"fileSize": -1,
"folder": true,
"hidden": false,
"id": "6d93372c-4908-47af-9815-3aa6307e392c",
"locale": "en",
"locked": false,
"name": "",
"ownerType": -1,
"path": "/",
"title": "",
"versioned": false
}Retrieves the properties of a selected repository file.
Example Request:
GET pentaho/api/repo/files/:/propertiescURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/home:admin:report.prpt/properties" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Colon separated path for the repository file.
home:admin:report.prptSuccessfully retrieved the properties for a file.
Invalid file path.
GET /repo/files/{pathId}/properties HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"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"
}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/metadatacURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/home:admin:report.prpt/metadata" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"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.
:jmeter-test:test_file_1.xmlSuccessfully retrieved metadata.
Invalid path.
Server Error.
GET /repo/files/{pathId}/metadata HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"stringKeyStringValueDtoes": [
{
"key": "KEY",
"value": "VALUE"
}
]
}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/metadatacURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/metadata" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/json" \
-d '{
"stringKeyStringValueDtoes": [
{
"key": "metadata.key.1",
"value": "metadata.value.1"
}
]
}'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.
:jmeter-test:test_file_1.xmlSuccessfully retrieved metadata.
No content
Invalid payload.
Invalid path.
Server Error.
PUT /repo/files/{pathId}/metadata HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 83
{
"stringKeyStringValueDtoes": [
{
"key": "metadata.key.1",
"value": "metadata.value.1"
}
]
}No content
Creates a new folder with the specified name.
Example Request:
PUT pentaho/api/repo/files/:public:jmeter-test-dir/createDircURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/api/repo/files/:public:jmeter-test-dir/createDir" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="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.
:public:jmeter-test-dirSuccessfully created folder.
No content
Forbidden.
Path already exists.
Server Error.
PUT /repo/files/{pathId}/createDir HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
No content
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=decURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/generatedContent?locale=de" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Colon separated path for the destination for files to be copied.
:jmeter-test:test_file_1.xmlSuccessfully retrieved the list of RepositoryFileDto objects.
GET /repo/files/{pathId}/generatedContent HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Successfully retrieved the list of RepositoryFileDto objects.
{
"repositoryFileDtoes": [
{
"createdDate": 1402911997019,
"fileSize": 3461,
"folder": false,
"hidden": false,
"id": "ff11ac89-7eda-4c03-aab1-e27f9048fd38",
"lastModifiedDate": 1406647160536,
"locale": "en",
"localePropertiesMapEntries": [
{
"locale": "default",
"properties": [
{
"key": "file.title",
"value": "myFile"
},
{
"key": "jcr:primaryType",
"value": "nt:unstructured"
},
{
"key": "title",
"value": "myFile"
},
{
"key": "file.description",
"value": "myFile Description"
}
]
}
],
"locked": false,
"name": "myFile.prpt",
"originalParentFolderPath": "/public/admin",
"ownerType": -1,
"path": "/public/admin/ff11ac89-7eda-4c03-aab1-e27f9048fd38",
"title": "myFile",
"versionId": "1.9",
"versioned": true
}
]
}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=admincURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/:jmeter-test:test_file_1.xml/generatedContentForUser?user=admin" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Colon separated path for the destination for files to be copied.
:jmeter-test:test_file_1.xmlThe username for the generated content folder.
adminSuccessfully retrieved the list of RepositoryFileDto objects.
Server Error.
GET /repo/files/{pathId}/generatedContentForUser HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"children": [
{
"aclNode": false,
"createdDate": 1406647160654,
"creatorId": "admin",
"deleted": false,
"description": "Generated content for user admin",
"fileSize": 2048,
"folder": false,
"hidden": false,
"id": "ff11ac89-7eda-4c03-aab1-e27f9048fd38",
"locale": "en",
"locked": false,
"name": "admin_output.pdf",
"originalParentFolderPath": "/public/admin/generated",
"ownerType": -1,
"path": "/public/admin/generated/ff11ac89-7eda-4c03-aab1-e27f9048fd38",
"title": "Generated Report for admin",
"versionId": "1.0",
"versioned": false
},
{
"aclNode": false,
"createdDate": 1406647220912,
"creatorId": "admin",
"deleted": false,
"description": "Generated content for user admin",
"fileSize": 1024,
"folder": false,
"hidden": false,
"id": "bb22ac89-7eda-4c03-aab1-e27f9048fd99",
"locale": "en",
"locked": false,
"name": "admin_data.xlsx",
"originalParentFolderPath": "/public/admin/generated",
"ownerType": -1,
"path": "/public/admin/generated/bb22ac89-7eda-4c03-aab1-e27f9048fd99",
"title": "Generated Data Export for admin",
"versionId": "1.0",
"versioned": false
}
]
}Validates if a current user is authorized to download content from the given dir.
Example Request:
GET pentaho/api/repo/files/canDownloadcURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/canDownload" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="to be validated for download action for the current user.
""Returns a boolean response.
GET /repo/files/canDownload HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Returns a boolean response.
falseValidates if a current user is authorized to upload content to the given dir
Example Request:
GET pentaho/api/repo/files/canUploadcURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/canUpload" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="to be validated for upload action for the current user.
""Returns a boolean response.
GET /repo/files/canUpload HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Returns a boolean response.
falseRetrieve a list of child files from the root of the repository.
Example Request:
GET pentaho/api/repo/files/children?showHidden=false&filter=*|FILES&_=1389042244670cURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/children?showHidden=false&filter=*|FILES" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"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.
*|FILESInclude or exclude hidden files from the file list.
falseInclude permission information about the file in the output.
falseSuccessfully retrieved the list of child files from root of the repository.
Server Error.
GET /repo/files/children HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"children": [
{
"aclNode": false,
"createdDate": 1389042244670,
"creatorId": "admin",
"deleted": false,
"description": "Public folder for shared content",
"fileSize": -1,
"folder": true,
"hidden": false,
"id": "95dcf4d8-3011-4d8b-9716-7cc8c5de21b4",
"locale": "en",
"locked": false,
"name": "public",
"originalParentFolderPath": "/",
"ownerType": -1,
"path": "/public",
"title": "Public",
"versionId": "1.0",
"versioned": false
},
{
"aclNode": false,
"createdDate": 1389042244671,
"creatorId": "admin",
"deleted": false,
"description": "Home directories for users",
"fileSize": -1,
"folder": true,
"hidden": false,
"id": "a1bcf4d8-3011-4d8b-9716-7cc8c5de21c5",
"locale": "en",
"locked": false,
"name": "home",
"originalParentFolderPath": "/",
"ownerType": -1,
"path": "/home",
"title": "Home",
"versionId": "1.0",
"versioned": false
}
]
}Retrieve a list of files in the trash folder of the repository.
Example Request:
GET pentaho/api/repo/files/deletedcURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/deleted" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Successfully retrieved the list of files from trash folder of the repository.
Server Error.
GET /repo/files/deleted HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"children": [
{
"createdDate": 1405356406448,
"deletedDate": 1406573914167,
"fileSize": 10477,
"folder": false,
"hidden": false,
"id": "fileId",
"lastModifiedDate": 1405356406448,
"locale": "en",
"localePropertiesMapEntries": [
{
"locale": "default",
"properties": [
{
"key": "file.title",
"value": "File Title"
},
{
"key": "jcr:primaryType",
"value": "nt:unstructured"
},
{
"key": "title",
"value": "filename"
},
{
"key": "file.description",
"value": ""
}
]
}
],
"locked": false,
"name": "filename.ext",
"originalParentFolderPath": "/original/path/to/file",
"ownerType": -1,
"path": "/path/to/file",
"title": "File Title",
"versionId": "1.3",
"versioned": true
}
]
}Checks whether the current user has permissions to the provided list of paths.
Example Request:
POST pentaho/api/repo/files/pathsAccessListcURL Example (JSON):
curl -X POST \
"http://localhost:8080/pentaho/api/repo/files/pathsAccessList" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/json" \
-d '{
"strings": ["/public", "/home/admin", "/etc"]
}'cURL Example (XML):
curl -X POST \
"http://localhost:8080/pentaho/api/repo/files/pathsAccessList" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/xml" \
-d '<?xml version="1.0" encoding="UTF-8"?>
<stringListWrapper>
<strings>/public</strings>
<strings>/home/admin</strings>
<strings>/etc</strings>
</stringListWrapper>'Wrapper for list of strings
List of strings
["item1","item2","item3"]Successfully retrieved the permissions of the given paths.
Unable to retrieve the permissions of the given paths due to some other error.
POST /repo/files/pathsAccessList HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 44
{
"strings": [
"/public",
"/home/admin",
"/etc"
]
}{
"settings": [
{
"name": "/public",
"value": "1"
},
{
"name": "/home/admin",
"value": "1"
},
{
"name": "/etc",
"value": "0"
}
]
}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=false&filter=*|FILES&_=1389042244670cURL Example:
curl -X GET \
"http://localhost:8080/pentaho/api/repo/files/tree?showHidden=false&filter=*|FILES" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"How many level should the search go.
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.
*|FILESInclude or exclude hidden files from the file list.
falseInclude permission information about the file in the output.
falseSuccessfully retrieved the list of files from root of the repository. 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.
Invalid parameters.
Server Error.
GET /repo/files/tree HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
{
"children": [
{
"file": {
"createdDate": 1405356318621,
"fileSize": -1,
"folder": true,
"hidden": false,
"id": "fileId",
"locale": "en",
"locked": false,
"name": "admin",
"ownerType": -1,
"path": "/path/to/dir",
"title": "admin",
"versioned": false
}
}
]
}Was this helpful?

