Class RepositoryPublishResource
- java.lang.Object
-
- org.pentaho.platform.web.http.api.resources.RepositoryPublishResource
-
public class RepositoryPublishResource extends Object
Publishes a content file to the repository. Used for Analyzer and Report Writer publish- Author:
- tkafalas
-
-
Field Summary
Fields Modifier and Type Field Description protected RepositoryPublishService
repositoryPublishService
-
Constructor Summary
Constructors Constructor Description RepositoryPublishResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected javax.ws.rs.core.Response
buildPlainTextOkResponse(String msg)
protected javax.ws.rs.core.Response
buildServerErrorResponse(int entity)
protected javax.ws.rs.core.Response
buildStatusResponse(javax.ws.rs.core.Response.Status status, int entity)
javax.ws.rs.core.Response
writeFile(String pathId, InputStream fileContents, Boolean overwriteFile, com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
Deprecated.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.javax.ws.rs.core.Response
writeFileWithEncodedNameWithOptions(String properties, String pathId, InputStream fileContents, com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
-
-
-
Field Detail
-
repositoryPublishService
protected RepositoryPublishService repositoryPublishService
-
-
Method Detail
-
writeFile
public javax.ws.rs.core.Response writeFile(String pathId, InputStream fileContents, Boolean overwriteFile, com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
Deprecated.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.txtfileContents
- 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 ifoverwriteFile
istrue
. This method should be used instead of writeFile(String, InputStream, Boolean, FormDataContentDisposition). Contrary to FileResource convention, it expectspathId
not to be separated by colons, but to be simply encoded with URLEncoder. Also it expectspathId
to be a well-formatted Unix-style path with no slash at the end. Examples of correctpathId
:- %2Fpublic%2Fmyfile.txt
- %2Fpublic%2Fmyfile
- %2Fpublic%2Fmyfile
- %2Fpublic%2Fmyfile%22quoted%22
- Parameters:
pathId
- slash-separated path for the repository filefileContents
- input stream containing the dataoverwriteFile
- flag to determine whether to overwrite the existing file in the repository or notfileInfo
- 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)
-
-