public class RepositoryPublishResource extends Object
Modifier and Type | Field and Description |
---|---|
protected RepositoryPublishService |
repositoryPublishService |
Constructor and Description |
---|
RepositoryPublishResource() |
Modifier and Type | Method and 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) |
protected RepositoryPublishService repositoryPublishService
public javax.ws.rs.core.Response writeFile(String pathId, InputStream fileContents, Boolean overwriteFile, com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
Example Request:
POST pentaho/api/repo/publish/publishfile
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).public javax.ws.rs.core.Response writeFileWithEncodedName(String pathId, InputStream fileContents, Boolean overwriteFile, com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
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
:
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).public javax.ws.rs.core.Response writeFileWithEncodedNameWithOptions(String properties, String pathId, InputStream fileContents, com.sun.jersey.core.header.FormDataContentDisposition fileInfo)
protected javax.ws.rs.core.Response buildPlainTextOkResponse(String msg)
protected javax.ws.rs.core.Response buildStatusResponse(javax.ws.rs.core.Response.Status status, int entity)
protected javax.ws.rs.core.Response buildServerErrorResponse(int entity)
Copyright © 2019 Hitachi Vantara. All rights reserved.