Class RepositoryPublishService


  • public class RepositoryPublishService
    extends Object
    • Field Detail

      • policy

        protected org.pentaho.platform.api.engine.IAuthorizationPolicy policy
    • Constructor Detail

      • RepositoryPublishService

        public RepositoryPublishService()
    • Method Detail

      • writeFile

        @Deprecated
        public void writeFile​(String pathId,
                              InputStream fileContents,
                              Boolean overwriteFile)
                       throws PlatformImportException,
                              org.pentaho.platform.api.engine.PentahoAccessControlException
        Publishes the file to the provided path in the repository. The file will be overwritten if the overwrite flag is set to true
        Parameters:
        pathId - path for the repository file
                       /path/to/file/id
                       
        fileContents - (input stream containing the data)
        overwriteFile - (flag to determine whether to overwrite the existing file in the repository or not)
                       true
                       
        Throws:
        PlatformImportException
        org.pentaho.platform.api.engine.PentahoAccessControlException
      • publishFile

        @Deprecated
        public void publishFile​(String pathId,
                                InputStream fileContents,
                                Boolean overwriteFile)
                         throws PlatformImportException,
                                org.pentaho.platform.api.engine.PentahoAccessControlException
        Deprecated.
        We need to keep the additional options for file will use #publishFile(String, InputStream, Boolean, String) We keep the method for backward compatibility
        Throws:
        PlatformImportException
        org.pentaho.platform.api.engine.PentahoAccessControlException
        Since:
        pentaho 8.1
      • publishFile

        public void publishFile​(String pathId,
                                InputStream fileContents,
                                Optional<Properties> fileProperties)
                         throws PlatformImportException,
                                org.pentaho.platform.api.engine.PentahoAccessControlException
        Publishes the file to the provided path in the repository via registered importers. The file will be overwritten if the overwrite is true
        Parameters:
        pathId - slash-separated path for the repository file
         /path/to/file/id
                              
        fileContents - input stream containing the data
        options - any options which can be applied to the file
        Throws:
        org.pentaho.platform.api.engine.PentahoAccessControlException - if current user is not allowed to publish files
        PlatformImportException - rethrows any exception raised in the importer
        RuntimeException - rethrows any exception raised in the importer
      • validateAccess

        protected void validateAccess()
                               throws org.pentaho.platform.api.engine.PentahoAccessControlException
        Check if user has the rights to publish or is administrator
        Throws:
        org.pentaho.platform.api.engine.PentahoAccessControlException
      • getPolicy

        protected org.pentaho.platform.api.engine.IAuthorizationPolicy getPolicy()
      • buildBundle

        @Deprecated
        protected org.pentaho.platform.api.repository2.unified.IPlatformImportBundle buildBundle​(String pathId,
                                                                                                 InputStream fileContents,
                                                                                                 Boolean overwriteFile)
        Deprecated.
      • prepareBundle

        protected org.pentaho.platform.api.repository2.unified.IPlatformImportBundle prepareBundle​(String fullPath,
                                                                                                   InputStream fileContents,
                                                                                                   Optional<Properties> fileProperties)