use of org.pentaho.platform.repository2.unified.fileio.RepositoryFileContentItem in project pentaho-platform by pentaho.
the class XactionUtil method deleteContentItem.
static void deleteContentItem(IContentItem contentItem, IUnifiedRepository unifiedRepository) {
if (contentItem instanceof RepositoryFileContentItem) {
String path = contentItem.getPath();
RepositoryFile repositoryFile = unifiedRepository.getFile(path);
// repositoryFile can be null if we have not access or file does not exist
if (repositoryFile != null) {
unifiedRepository.deleteFile(repositoryFile.getId(), true, null);
}
} else if (contentItem instanceof FileContentItem) {
// Files in the file system must not be deleted here
String path = ((FileContentItem) contentItem).getFile().getName();
logger.warn(Messages.getInstance().getString("XactionUtil.SKIP_REMOVING_OUTPUT_FILE", path));
}
}
Aggregations