Class RepositoryPublishResource


  • public class RepositoryPublishResource
    extends Object
    Publishes a content file to the repository. Used for Analyzer and Report Writer publish
    Author:
    tkafalas
    • Constructor Detail

      • RepositoryPublishResource

        public RepositoryPublishResource()
    • Method Detail

      • writeFile

        public javax.ws.rs.core.Response writeFile​(String pathId,
                                                   InputStream fileContents,
                                                   Boolean overwriteFile,
                                                   com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
        Publishes the file to the provided path in the repository. The file will be overwritten if the overwrite flag is set to true.

        Example Request:
        POST pentaho/api/repo/publish/publishfile

        Parameters:
        pathId - Path for the repository file, e.g. /public/file.txt
        fileContents - Input stream containing the data.
        overwriteFile - Flag to determine whether to overwrite the existing file in the repository or not.
        fileInfo - File information (Currently not being used).
        Returns:
        A jax-rs Response object with the appropriate status code, header, and body.
      • writeFileWithEncodedName

        public javax.ws.rs.core.Response writeFileWithEncodedName​(String pathId,
                                                                  InputStream fileContents,
                                                                  Boolean overwriteFile,
                                                                  com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
        Publishes the file to the provided path in the repository. The file will be overwritten if overwriteFile is true. This method should be used instead of writeFile(String, InputStream, Boolean, FormDataContentDisposition). Contrary to FileResource convention, it expects pathId not to be separated by colons, but to be simply encoded with URLEncoder. Also it expects pathId to be a well-formatted Unix-style path with no slash at the end. Examples of correct pathId:
        • %2Fpublic%2Fmyfile.txt
        • %2Fpublic%2Fmyfile
        • %2Fpublic%2Fmyfile
        • %2Fpublic%2Fmyfile%22quoted%22
        Parameters:
        pathId - slash-separated path for the repository file
        fileContents - input stream containing the data
        overwriteFile - flag to determine whether to overwrite the existing file in the repository or not
        fileInfo - file information (Currently not being used).
        Returns:
        A jax-rs Response object with the appropriate status code, header, and body.
      • writeFileWithEncodedNameWithOptions

        public javax.ws.rs.core.Response writeFileWithEncodedNameWithOptions​(String properties,
                                                                             String pathId,
                                                                             InputStream fileContents,
                                                                             com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
      • buildPlainTextOkResponse

        protected javax.ws.rs.core.Response buildPlainTextOkResponse​(String msg)
      • buildStatusResponse

        protected javax.ws.rs.core.Response buildStatusResponse​(javax.ws.rs.core.Response.Status status,
                                                                int entity)
      • buildServerErrorResponse

        protected javax.ws.rs.core.Response buildServerErrorResponse​(int entity)