Class RepositoryPublishService
- java.lang.Object
-
- org.pentaho.platform.web.http.api.resources.services.RepositoryPublishService
-
public class RepositoryPublishService extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected IPlatformImporter
platformImporter
protected org.pentaho.platform.api.engine.IAuthorizationPolicy
policy
-
Constructor Summary
Constructors Constructor Description RepositoryPublishService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.pentaho.platform.api.repository2.unified.IPlatformImportBundle
buildBundle(String pathId, InputStream fileContents, Boolean overwriteFile)
Deprecated.protected IPlatformImporter
getPlatformImporter()
protected org.pentaho.platform.api.engine.IAuthorizationPolicy
getPolicy()
protected org.pentaho.platform.api.repository2.unified.IPlatformImportBundle
prepareBundle(String fullPath, InputStream fileContents, Optional<Properties> fileProperties)
void
publishFile(String pathId, InputStream fileContents, Boolean overwriteFile)
Deprecated.void
publishFile(String pathId, InputStream fileContents, Optional<Properties> fileProperties)
Publishes the file to the provided path in the repository via registered importers.protected void
validateAccess()
Check if user has the rights to publish or is administratorvoid
writeFile(String pathId, InputStream fileContents, Boolean overwriteFile)
Deprecated.use publishFile(String, InputStream, Boolean) instead
-
-
-
Field Detail
-
policy
protected org.pentaho.platform.api.engine.IAuthorizationPolicy policy
-
platformImporter
protected IPlatformImporter platformImporter
-
-
Method Detail
-
writeFile
@Deprecated public void writeFile(String pathId, InputStream fileContents, Boolean overwriteFile) throws PlatformImportException, org.pentaho.platform.api.engine.PentahoAccessControlException
Deprecated.use publishFile(String, InputStream, Boolean) insteadPublishes 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 theoverwrite
istrue
- Parameters:
pathId
- slash-separated path for the repository file/path/to/file/id
fileContents
- input stream containing the dataoptions
- any options which can be applied to the file- Throws:
org.pentaho.platform.api.engine.PentahoAccessControlException
- if current user is not allowed to publish filesPlatformImportException
- rethrows any exception raised in the importerRuntimeException
- 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()
-
getPlatformImporter
protected IPlatformImporter getPlatformImporter()
-
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)
-
-